dimanche 14 août 2016

Push Notification method in iOS Objective-C with FCM

i`m wondering what method we can use in Xcode with Objective-C code to trigger push notifications in this function:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// Print message ID.
NSLog(@"Message ID: %@", userInfo[@"gcm.message_id"]);

// Pring full message.
NSLog(@"%@", userInfo);

NSLog(@"Type: %@", userInfo[@"type"]);
}

note: i have try to trigger push notifications from Firebase Console and it succeeded, i got the the push notifications,

but now i`m trying to send push notifications from my backend server (Rails), using http://ift.tt/2bqhmC8

i got the data when i send notifications from my backend server, but i`m confused to handle data from my backend server to trigger the push notifications in iOS, what method can i use?

Aucun commentaire:

Enregistrer un commentaire