iOS support for Google Cloud Messaging

前端 未结 8 1161
故里飘歌
故里飘歌 2021-01-31 09:38

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

8条回答
  •  粉色の甜心
    2021-01-31 09:53

    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.

提交回复
热议问题