Most applications writing for mobile platforms need some sort of integration with web services. Unfortunately, most times backend infrastructure becomes an oversight and the app ends up suffering in the long run. Using cloud infrastructure technologies like Parse can help you get from concept to App Store insertion in no time. Parse's simple API, extendable Cloud Code feature and Push notification API let you focus on your app while getting a scalable backend solution.
38. Push Registration
- (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];
}
Friday, March 8, 13
39. Channels
PFInstallation *currentInstallation = [PFInstallation
currentInstallation];
[currentInstallation addUniqueObject:@"Speakers"
forKey:@"channels"];
[currentInstallation saveInBackground];
PFPush *push = [[PFPush alloc] init];
[push setChannel:@"Speakers"];
[push setMessage:@"Thanks for all the fish!"];
[push sendPushInBackground];
Friday, March 8, 13