I'm having issues with Urban Airship, specifically for registering users for Rich Push. I have the following code in 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];
}
This allows my code to register the device under Device Tokens, as well as auto-generate a user for Rich Push. However, the alias and device token are not passed into the Rich Push user, which I suspect is not allowing UA to send a rich push down to my device.
What am I missing? I looked through the docs for iOS push and have all the same code. Any help would be appreciated!
Update:
So I've created a user hitting the /api/user API
endpoint and brute-forcing the alias/device_token. However, my device is still not getting the rich push. I went to /api/user/user_id
and verified that badge > 0, so Urban Airship is attempting to send these rich push. Anyone know why it's getting lost?