我正在开发应用程序,将收到来自城市飞艇的推送通知。我设法得到了推送通知。目前,我已经在myapplication类中添加了以下代码
AirshipConfigOptions options = AirshipConfigOptions
.loadDefaultOptions(Myapplication.this);
UAirship.takeOff(this, options);
PushManager.shared().setAlias("test");
// Tags
HashSet<String> tags = new HashSet<String>();
tags.add("tag1");
tags.add("tag2");
PushManager.shared().setTags(tags);
PushManager.enablePush();
PushManager.shared().setIntentReceiver(IntentReceiver.class);
String apid = PushManager.shared().getAPID();
Logger.info("My Application onCreate - App APID: " + apid); 它总是显示“您还没有注册任何设备令牌”。我如何在城市飞艇上注册设备?谁能帮帮我。
发布于 2014-05-27 05:12:37
试试下面这段代码:
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
UA_LINFO(@"APNS device token: %@", deviceToken);
// Updates the device token and registers the token with UA. This won't occur until
// push is enabled if the outlined process is followed. This call is required.
[[UAPush shared] registerDeviceToken:deviceToken];}
https://stackoverflow.com/questions/23782769
复制相似问题