• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

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

[复制链接]
菜鸟教程小白 发表于 2022-12-12 10:58:07 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

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

这是我的应用日志:

2013-05-15 18:20:10.791 MyApp[37284:907] Multi-tasking -> Device: YES, App: YES
2013-05-15 18:20:10.917 MyApp[37284:907] [I] +[UAirship takeOff:] [Line 215] App Key: app_key
2013-05-15 18:20:10.918 MyApp[37284:907] [I] +[UAirship takeOff:] [Line 216] App Secret: app_secret
2013-05-15 18:20:10.920 MyApp[37284:907] [I] +[UAirship takeOff:] [Line 217] Server: https://device-api.urbanairship.com
2013-05-15 18:20:10.965 MyApp[37284:907] [D] -[UAirship configureUserAgent] [Line 362] 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[37284:907] [D] void PrintReachabilityFlags(SCNetworkReachabilityFlags, const char *) [Line 79] Reachability Flag Status: -R -----l- networkStatusForFlags
2013-05-15 18:20:11.032 MyApp[37284:907] [D] -[UAUser migrateUser] [Line 168] Migrating User Info: {
     UAUserRecoveryKey = 0;
     UAUserRecoveryKeySent = 0;
     UAUserTagsKey =      (
     );
     UAUserUrlKey = "https://device-api.urbanairship.com/api/user/mRBbpmi2R_SeZad_R2WSxg/";
}
2013-05-15 18:20:11.078 MyApp[37284:907] [D] -[UAUser loadUser] [Line 249] User Info: {
     UAUserRecoveryKey = 0;
     UAUserRecoveryKeySent = 0;
     UAUserTagsKey =      (
     );
     UAUserUrlKey = "https://device-api.urbanairship.com/api/user/mRBbpmi2R_SeZad_R2WSxg/";
}
2013-05-15 18:20:11.087 MyApp[37284:907] [CDVTimer][pushnotificationplugin] 175.806999ms
2013-05-15 18:20:11.091 MyApp[37284:907] [CDVTimer][TotalPluginStartup] 180.313051ms
2013-05-15 18:20:11.263 MyApp[37284:907] [D] -[UAPush applicationDidBecomeActive] [Line 555] Checking registration status after foreground notification
2013-05-15 18:20:11.265 MyApp[37284:907] [D] -[UAPush applicationDidBecomeActive] [Line 561] Checking registration on app foreground disabled on app initialization
2013-05-15 18:20:11.706 MyApp[37284:907] [D] -[UAUser listenForDeviceTokenReg] [Line 931] ListenForDeviceTokenReg
2013-05-15 18:20:11.874 MyApp[37284:907] Resetting plugins due to page load.
2013-05-15 18:20:12.512 MyApp[37284:907] DEPRECATION NOTICE: The Connection ReachableViaWWAN return value of '2g' is deprecated as of Cordova version 2.6.0 and will be changed to 'cellular' in a future release. 
2013-05-15 18:20:13.875 MyApp[37284:907] 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[37284:907] [D] -[UAPush updateRegistration] [Line 589] Checking registration state
2013-05-15 18:20:15.506 MyApp[37284:907] [D] -[UAPush updateRegistration] [Line 609] Device token is nil. Registration will be attempted at a later time
2013-05-15 18:20:26.090 MyApp[37284:907] [D] +[UAKeychainUtils getDeviceID] [Line 275] Retrieved device id info from keychain.
2013-05-15 18:20:26.092 MyApp[37284:907] [D] +[UAKeychainUtils getDeviceID] [Line 279] Device ID result is not nil.
2013-05-15 18:20:26.094 MyApp[37284:907] [D] +[UAKeychainUtils getDeviceID] [Line 288] Loaded Device ID: 55ADD1F9-C71E-4604-8EB1-EB9888194468
2013-05-15 18:20:26.095 MyApp[37284:907] [D] +[UAKeychainUtils getDeviceID] [Line 289] Loaded Model Name: iPhone3,1
2013-05-15 18:20:26.477 MyApp[37284:907] [D] -[UAAnalytics requestDidSucceed:response:responseData:] [Line 461] Analytics data sent successfully. Status: 200

我的 index.html 文件中也有 push.enablePush()。我正在使用 Xcode 4.6.2 和 Phonegap 2.7.0。



Best Answer-推荐答案


问题如下:我没有像 iOS 示例中那样做所有事情: https://github.com/urbanairship/phonegap-ua-push/blob/master/ios-sample/www/index.html

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

所以,通过在代码中添加这一行来解决问题。

关于ios - Urban Airship Phonegap 插件未在 iOS 应用上注册设备 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16567880/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap