菜鸟教程小白 发表于 2022-12-12 21:50:34

iphone - 没有为 APNS 获取设备的设备 token ?


                                            <p><p>我为 APNS 开发应用程序。我的代码在一台设备上工作正常,我也收到了设备的苹果推送通知。但是当我为设备运行该应用程序时,我获得了设备 token 并通过该 token 我将能够完成所有过程。
现在我的问题是当我为其他设备安装相同的应用程序时,以下方法不起作用。</p>

<pre><code>application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken

application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err
</code></pre>

<p>这意味着我没有获得其他设备的设备 token 。但是是的,当我为该设备安装应用程序时,该应用程序在设备设置的通知部分注册。</p>

<p>该怎么做以及我错过了什么,为什么这些方法不能在具有有效配置的提供配置文件的其他设备上运行?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我遇到了问题...实际上我没有检查其他设备的互联网连接是否正确。由于互联网连接问题,这些方法没有奏效。
所以感谢苹果通过这个给我提供信息
<a href="http://developer.apple.com/library/ios/#technotes/tn2265/_index.html" rel="noreferrer noopener nofollow">http://developer.apple.com/library/ios/#technotes/tn2265/_index.html</a>链接为我提供了很多信息。</p></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - 没有为 APNS 获取设备的设备 token ?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/11338614/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/11338614/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - 没有为 APNS 获取设备的设备 token ?