Opting Into Notifications
As an app developer, you can assume that most users will use default settings for push notification handling. But whether the app receives push notifications at all depends on whether the user allowed or denied them when the app was first installed.
All platforms require users to opt into receiving push notifications for each app that uses push. Android and iOS present the user with dialog boxes similar to the following when the app first installs:
After the app is installed, iOS presents the user with a different dialog box for each service that the app uses.
For push notifications, the user will be prompted with "app_name Would Like to Send You Push Notifications". The user must click OK to allow push notifications for your app. If the user denies push notifications for the app, the OS will ignore notifications for that app when they are received. The user can later enable push notifications for that app in the Notification Center.
During app installation, Android asks the user to approve all permissions for the app in a single dialog box.
In the list of app permissions for Android, the "Network communication: Receive data from Internet" permission includes permissions to receive push notifications.
The user must click the Allow button to allow all app services at once, including push notifications. If the user does not allow all permissions, the app is not installed.
After a user allows push notifications for the app, then the app attempts to register with a notification services (APNS for iOS devices and GCM for Android devices).
If the user does not allow notifications, then the device will not register with a notification service. Furthermore, the device will not register with the Akula Server push service. As a result, the device will not be included in any push request, and the device will not receive any push notifications.
If the user later allows push notifications, either through app settings (Android) or the Notification Center (iOS), then the app will attempt to register with the notification service and the Akula Server push service.
Each combination of user, device, and client app can allow or deny push notifications. A user can allow push in one app, but deny it in another. Similarly, a user can allow push for the app on one device, and deny push for the app on another device.
After allowing push notifications in the app, the user can also change the notification settings on the client device. How these properties are overridden is determined by the device's OS:
- iOS – Device owners use the Notification Center to customize how and/or whether the device handles a push notification. For example, the user can decide if an Alert should be shown as a popup dialog box, a banner, or nothing at all.
- Android – Device owners can customize push notification settings in various places. Sounds are enabled or disabled for notification types in the Settings > Personalize > Sound > Notification Sounds screen.
Additionally, users can decide whether badges can be added to app icons, and whether sounds play when a push notification is received. A further consideration is that even if the device's settings show that it will display a sound when it receives a push notification, if the system volume is turned down or disabled, then no sound will play.