首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在城市飞艇上注册设备?

如何在城市飞艇上注册设备?
EN

Stack Overflow用户
提问于 2014-05-21 20:09:54
回答 1查看 504关注 0票数 0

我正在开发应用程序,将收到来自城市飞艇的推送通知。我设法得到了推送通知。目前,我已经在myapplication类中添加了以下代码

代码语言:javascript
复制
       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); 

它总是显示“您还没有注册任何设备令牌”。我如何在城市飞艇上注册设备?谁能帮帮我。

EN

回答 1

Stack Overflow用户

发布于 2014-05-27 05:12:37

试试下面这段代码:

代码语言:javascript
复制
- (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];

}

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23782769

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档