Category: Blog, iOS, Development

Google Cloud Messaging and Parse comparison

Google Cloud Messaging and Parse comparison

Few days ago my friend showed me his Android app with Google Cloud Messaging, which has also iOS support. We usually use Parse or direct access for Apple Push Notifications, so I thought that we should try this APN backend.

Preconfiguration

I assume that you already know how to setup push notification on developer.apple.com, generate certificates, etc. so I will not focus on that part of the setup.

Google Cloud Messaging

First of all, I prepared certificates for APN and enabled Google services for my test app. After that, I had a .plist configuration for my app.

At this step I think Parse is easier and faster to configure, also the Parse documentation is much better than the Google Cloud Messaging one. After that, I had to configure my app for receiving push notifications and registering in APN. I’ve started with adding required Pod – pod 'Google/CloudMessaging'

Parse

If you use Parse, you probably have configured some apps before. You just have to add certificates for APN. It also, supports CocoaPods pod 'Parse'

Parse Apple Push Notification Service Configuration

Implementation

Google Cloud Messaging

That’s the most unpleasant part of implementing Google Cloud Messaging for iOS. First of all, documentation is every hard to read/understand for me.

But this is standard APN registration! What is really important is hidden behind // … Fortunately, there is also link to GitHub example, with the full code – IMHO very poor quality, which I did not expect from Google.

Parse

Parse did this right. You have to add standard registration like in above example and add 4 lines of code to standard AppDelegate methods. It looks very clean and tidy, so again point for Parse.

Conclusion

I took the liberty of refactoring the Google’s implementation which can be found in the link above. Feel free to use it as your personal snippet.

Testing

Google Cloud Messaging

Another problem with GCM is that you do not have any developer’s console for testing. Of course, you can use Postman, but I think it should have something for fast and easy testing without additional configuration.

Parse

Parse gives you the nice tool for sending push notifications with a preview on iPhone mock.

Parse notification form + mock

Conclusion

Furthermore, I made GCM Sender app, which allows you to send push notifications via GCM to iOS and Android recipients in fast and easy way.

screenshot

You have to add your GCM API key and recipient token received in app. That’s all there is to it. Some simple request body is already provided, you can customise it as you want. To send push notification just push button on the right-hand side.

On right-hand tab you will see a response from Google Cloud Messaging (or error if you are offline).

Google Cloud Messaging and Parse summary

As you have seen, Google Cloud Messaging is not as user-friendly as Parse. Implementation of GCM can be hard for the first time, however the best advantage of the GCM is that it is free.

If you have enough time and perseverance you should choose GCM. Otherwise, if you prefer clean and easy solutions and you want to pay for it in the future, Parse will be perfect for you – certain downfall payable when you have more than 1M unique recipients.

About the author

Tomasz Muter

Tomasz Muter

Vice-President/Co-founder

Tomasz, co-founder of Droids On Roids is responsible for strategy, inbound marketing, branding, public relations and recruiting. Thanks to his experience as a developer, designer, project manager, digital marketer and board member, he understands every stage of the software development process from both a business and development perspective. The combination of his exceptional drive and data-driven mindset helps him solve most challenging problems. Tomasz was awarded the prestigious “30 under 30” in 2017 by the Polish edition of Forbes magazine. He is a former McKinsey Student Ambassador and Member of the Board of IT Corner Technology Fellowship of IT Companies from Poland.