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

标签 ios cordova urbanairship.com

我正在使用带有 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。

最佳答案

问题如下:我没有像 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/

相关文章:

ios - XCode 版本 6.1 (6A1052d) 更新导致错误 : 'dictionaryWithCapacity' has been explicitly marked unavailable here (Foundation. NSMutableDictionary)

html - 如何在 phonegap 中使用 css 添加背景图像

android - 视口(viewport)元标记在 Android 4.4 WebView 中被忽略

Android Urban Airship 6.0.1,无法拦截推送通知操作

iphone - APNS 提供列表 - 哪些公司是推送通知服务器提供商

ios - 当设备已经在 Beacon 范围内时无法检测到 Beacon 然后我们打开蓝牙 & 应用程序被杀死

iOS NFC 后台标签读取无需用户输入

ios - OCMock [OCMAnyConstraint isProxy] : message sent to deallocated instance, 发生了什么事?

android - 带 Google map 的 PhoneGap/Android 应用程序的域白名单

php - 使用 Urban Airship 和 php 自动向 ios/android 设备发送通知