【发布时间】: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