Reputation: 1523
I have followed the Parse guide on how to set this up twice now, but it isn't working.
appdelegate.m
, at didFinishLaunchingWithOptions
method after my Parse registration key. [application registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge| UIRemoteNotificationTypeAlert| UIRemoteNotificationTypeSound];
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
// Store the deviceToken in the current installation and save it to Parse.
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackground];
}
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
[PFPush handlePush:userInfo];
}
I simply cannot figure out what is not working.
My provisioning profiles have worked fine, I've been working on the app for a few months now (local development and TestFlight testing).
I'm not sure if maybe the Parse tutorial is out of date? Maybe it is done differently now? Can anyone provide any insight?
Very much appreciated!
Upvotes: 1
Views: 373
Reputation: 40038
You have to set app ID and client key before you set the device token:
[Parse setApplicationId:PARSE_APP_ID
clientKey:PARSE_CLIENT_KEY];
Upvotes: 2