【问题标题】:Urban Airship can't receive rich pushUrban Airship 收不到富推
【发布时间】:2013-03-31 01:04:42
【问题描述】:

我在使用 Urban Airship 时遇到问题,特别是在注册 Rich Push 用户时。我在AppDelegate中有以下代码

//Create Airship options dictionary and add the required UIApplication launchOptions
NSMutableDictionary *takeOffOptions = [NSMutableDictionary dictionary];
[takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey];

[UAirship takeOff:takeOffOptions];
[[UAPush shared] resetBadge];

// Register for remote notfications with the UA Library. This call is required.
[[UAPush shared] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
                                                     UIRemoteNotificationTypeSound |
                                                     UIRemoteNotificationTypeAlert)];

- (void)application:(UIApplication *)application  didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
// Updates the device token and registers the token with UA.
NSString *myAlias = @"Your Alias";
[UAPush shared].alias = myAlias;    
[[UAPush shared] registerDeviceToken:deviceToken];
}

这允许我的代码在设备令牌下注册设备,以及自动生成富推送用户。但是,别名和设备令牌没有传递给 Rich Push 用户,我怀疑这不允许 UA 向我的设备发送丰富的推送。

我错过了什么?我查看了有关 iOS 推送的文档并拥有所有相同的代码。任何帮助将不胜感激!

更新:

所以我创建了一个用户点击/api/user API 端点并暴力破解别名/device_token。但是,我的设备仍然没有得到丰富的推送。我去了/api/user/user_id并验证了徽章> 0,因此Urban Airship正在尝试发送这些丰富的推送。有人知道它为什么会丢失吗?

【问题讨论】:

    标签: ios urbanairship.com


    【解决方案1】:

    在我看来,Rich push 的文档记录很差。我自己对此感到困惑,并联系了 UA 支持。他们在这里向我推荐了收件箱示例:https://github.com/urbanairship/ios-library

    研究此示例是了解如何在 iOS 端实现富推送的良好开端。

    我还在这里找到了 UA 类的参考文档: http://docs.urbanairship.com/ios-lib/

    浏览每个 UAInbox* 类。文档还可以(不是很好)。

    我希望他们有一个关于如何实施 Rich Push 的概述文档,就像他们解释如何实施推送通知一样。我敢肯定,这将为许多开发人员节省大量时间...

    贾德

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-14
      • 1970-01-01
      • 1970-01-01
      • 2012-09-19
      • 1970-01-01
      相关资源
      最近更新 更多