菜鸟教程小白 发表于 2022-12-11 18:38:40

从 APN 迁移到 Firebase 后未重新生成 iOS 设备 token


                                            <p><p>我为 iOS 和 Android 创建了一个 APP,并使用 APN 获取 iOS 的 deviceToken 和 Android 的 GCM。我决定迁移到 firebase 以简化 token 管理。我注意到一个仅适用于 iOS 应用程序的问题,我想知道是否其他人也遇到了它。
当我将 iOS 应用程序迁移到 firebase 时,除非重新安装应用程序,否则不会重新生成 token 。我关注 <a href="https://developers.google.com/cloud-messaging/ios/ios-migrate-fcm" rel="noreferrer noopener nofollow">firebase guide</a>去做但没有结果。
其他人有这个问题吗?
提前致谢</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我解决了我的问题。</p>

<ol>
<li><p>我关闭并打开功能
<a href="/image/VJGZN.png" rel="noreferrer noopener nofollow"><img src="/image/VJGZN.png" alt="enter image description here"/></a> </p></li>
<li><p>我重启了 XCode</p></li>
<li><p>我将 <strong>FIRInstanceIDAPNSTokenType</strong> 放到 <strong>prod</strong> 中,现在似乎一切正常</p>

<p>func 应用程序(_ 应用程序:UIApplication,didRegisterForRemoteNotificationsWithDeviceToken deviceToken:数据){
      FIRInstanceID.instanceID().token()
      FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.prod)
    }</p></li>
</ol></p>
                                   
                                                <p style="font-size: 20px;">关于从 APN 迁移到 Firebase 后未重新生成 iOS 设备 token ,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/41762136/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/41762136/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: 从 APN 迁移到 Firebase 后未重新生成 iOS 设备 token