Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS support for Google Cloud Messaging

I saw in google's developer console that GCM allows to generate a API key for iOS. I searched in the web for any kind of documentation about how to implement Push Notifications through GCM in an iOS App, but i didn't find answers.

Is it really possible to implement Push Notifications jet using GCM in iOS apps? documentation, examples or something to learn how to do this?

like image 755
Alejandro Fraenkel Avatar asked Mar 22 '13 19:03

Alejandro Fraenkel


People also ask

Does FCM work with iOS?

Once your client app is installed on a device, it can receive messages through the FCM APNs interface. You can immediately start sending notifications to user segments with the Notifications composer, or messages built on your application server.

Does FCM uses APNs?

APNS channel The most common way is sending the message via APNs. If you're using the FCM v1 HTTP API to request a message delivery or if you're using the legacy FCM API to send display messages, FCM will contact APNs to deliver the notification.

Is Google Cloud Messaging free?

Send messages to any device Firebase Cloud Messaging (FCM) provides a reliable and battery-efficient connection between your server and devices that allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost.


1 Answers

YES

I tried it and it works great. Follow this https://developers.google.com/cloud-messaging/ios/start

This is how it works.

You create app entry at google console. Upload development and production certificated in creation wizard.(You have to upload both) and follow the steps in docs.

Logic works as follows

  1. We request device token from apns as usual.
  2. Then we send that token to gcm service with provided api.
  3. Then gcm sends back a another token.
  4. We send that token to app server.
  5. App server can send notifications using that token.

Cool Features.

GCM for iOS has some cool features as

  • Subscribe to notification based on a particular topic. Ignore others.

  • Send Notification to other devices within the app.

If you want to try google sample app. UPDATE: it's Google with a capital G now. Just

pod try Google 

There you will get an example in ObjC , swift and even mac app that can send notification.

Update.

Google is moving to Firebase cloud messageing from GCM.

like image 73
MadNik Avatar answered Sep 17 '22 14:09

MadNik