Urban Airship无法获得丰富的推动力

时间:2013-04-08 19:53:44

标签: ios urbanairship.com

我遇到了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自动生成用户。但是,别名和设备令牌不会传递给Rich Push用户,我怀疑它不允许UA向我的设备发送丰富的下推。

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

更新

所以我创建了一个用户点击/api/user API端点并强制执行alias / device_token。但是,我的设备仍然没有得到丰富的推动。我去了/api/user/user_id并验证了徽章> 0,所以Urban Airship试图发送这些丰富的推动力。任何人都知道为什么会迷路?

1 个答案:

答案 0 :(得分:0)

在我看来,丰富的推动记录非常糟糕。我自己也很难过,并联系了UA的支持。他们在这里向我推荐了inboxSample:https://github.com/urbanairship/ios-library

研究这个示例是了解如何在iOS端实现Rich Push的一个很好的开始。

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

浏览每个UAInbox *类。文件很好(不太好)。

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

贾德