Implementation
The approach for both platforms is more or less the same. If the user launches the app, the device and app will be registered for receiving push notifications. It will result in a token (or an optional registration ID for Android) that you can use later to send a notification to this particular device and for this particular app. The main difference between Android and iOS is that iOS uses an opt-in strategy for receiving notifications, while Android uses an opt-out strategy.
An iPhone user will see a question pop up which asks if he wants to allow the app to receive push notifications (opt-in). This is something the OS does for us when we register as shown as follows:
For Android, we will just register the device and the app ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access