菜鸟教程小白 发表于 2022-12-12 10:58:07

ios - Urban Airship Phonegap 插件未在 iOS 应用上注册设备 token


                                            <p><p>我正在使用带有 Urban Airship 插件的 Phonegap 开发一个应用程序。我已经连接并配置了教程中提到的所有内容,但该应用仍未向 UA 注册 token 。</p>

<p>这是我的应用日志:</p>

<pre><code>2013-05-15 18:20:10.791 MyApp Multi-tasking -&gt; Device: YES, App: YES
2013-05-15 18:20:10.917 MyApp + App Key: app_key
2013-05-15 18:20:10.918 MyApp + App Secret: app_secret
2013-05-15 18:20:10.920 MyApp + Server: https://device-api.urbanairship.com
2013-05-15 18:20:10.965 MyApp - Setting User-Agent for UA requests to MyApp 1.0 (iPhone; iPhone OS 6.1.3; UALib 1.4.0; p3R6RpCWSB2EZ_z9CmbBGg; ru_RU)
2013-05-15 18:20:11.001 MyApp void PrintReachabilityFlags(SCNetworkReachabilityFlags, const char *) Reachability Flag Status: -R -----l- networkStatusForFlags
2013-05-15 18:20:11.032 MyApp - Migrating User Info: {
   UAUserRecoveryKey = 0;
   UAUserRecoveryKeySent = 0;
   UAUserTagsKey =      (
   );
   UAUserUrlKey = &#34;https://device-api.urbanairship.com/api/user/mRBbpmi2R_SeZad_R2WSxg/&#34;;
}
2013-05-15 18:20:11.078 MyApp - User Info: {
   UAUserRecoveryKey = 0;
   UAUserRecoveryKeySent = 0;
   UAUserTagsKey =      (
   );
   UAUserUrlKey = &#34;https://device-api.urbanairship.com/api/user/mRBbpmi2R_SeZad_R2WSxg/&#34;;
}
2013-05-15 18:20:11.087 MyApp 175.806999ms
2013-05-15 18:20:11.091 MyApp 180.313051ms
2013-05-15 18:20:11.263 MyApp - Checking registration status after foreground notification
2013-05-15 18:20:11.265 MyApp - Checking registration on app foreground disabled on app initialization
2013-05-15 18:20:11.706 MyApp - ListenForDeviceTokenReg
2013-05-15 18:20:11.874 MyApp Resetting plugins due to page load.
2013-05-15 18:20:12.512 MyApp DEPRECATION NOTICE: The Connection ReachableViaWWAN return value of &#39;2g&#39; is deprecated as of Cordova version 2.6.0 and will be changed to &#39;cellular&#39; in a future release.
2013-05-15 18:20:13.875 MyApp Finished load of: file:///var/mobile/Applications/F5AA9FE8-7DCD-40A8-825B-8E0F5D12368B/MyApp.app/www/index.html
2013-05-15 18:20:15.489 MyApp - Checking registration state
2013-05-15 18:20:15.506 MyApp - Device token is nil. Registration will be attempted at a later time
2013-05-15 18:20:26.090 MyApp + Retrieved device id info from keychain.
2013-05-15 18:20:26.092 MyApp + Device ID result is not nil.
2013-05-15 18:20:26.094 MyApp + Loaded Device ID: 55ADD1F9-C71E-4604-8EB1-EB9888194468
2013-05-15 18:20:26.095 MyApp + Loaded Model Name: iPhone3,1
2013-05-15 18:20:26.477 MyApp - Analytics data sent successfully. Status: 200
</code></pre>

<p>我的 index.html 文件中也有 push.enablePush()。我正在使用 Xcode 4.6.2 和 Phonegap 2.7.0。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>问题如下:我没有像 iOS 示例中那样做所有事情:
<a href="https://github.com/urbanairship/phonegap-ua-push/blob/master/ios-sample/www/index.html" rel="noreferrer noopener nofollow">https://github.com/urbanairship/phonegap-ua-push/blob/master/ios-sample/www/index.html</a> </p>

<p>我想有一个 registerForNotificationTypes 可以为 iOS 注册通知(Android 没有这种方法)。</p>

<p>所以,通过在代码中添加这一行来解决问题。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Urban Airship Phonegap 插件未在 iOS 应用上注册设备 token ,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/16567880/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/16567880/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Urban Airship Phonegap 插件未在 iOS 应用上注册设备 token