The notifications layer is where the tokens and messages are handled and exposed via observables to all the notifications providers.
PoqFirebaseMessagingServiceis an extension of
MessagingServiceEventsPublisheris the interface to send
MessagingServiceEventsis the interface to expose
onMessageReceivedas RxJava observables.
PoqMessagingServiceEventsis the implementation of
To add a new notification provider:
MessagingServiceEventsinto your Application.
- Subscribe to
MessagingServiceEvents.onMessageReceivefrom the Application
onCreateand forward each event to the appropriate method from your notification provider.
Android 13 introduces a runtime permission for posting notifications. This permission is granted on previous Android versions and for your existing users migrating to an Android 13 device.
The PoqSDK offers an onboarding page to request the permission. This page will be filtered out for non-applicable Android versions or users with notifications already enabled. Also, the PoqSDK tries to request the permission every 30 days on the home screen. Based on a system flag, when the user has not allowed the notifications once on the OS dialog, the PoqSDK will show a screen explaining the reason to request the permission before showing the system dialog again. Finally, depending on the specific OS behaviour, if the permission has been denied twice on the OS dialog, the PoqSDK will not be able to request the permission again.