Survey notifications
These are optional implementations for Sense360 SDK survey notifications.
Notifying click-data
If your application displays Sense360 surveys in its interface (instead of using the SDK survey notification), it must notify the click data to Sense360 using this code snippet:
By default, Sense360 SDK may display its own notifications with surveys.
Custom notification channel
On devices running Android Oreo, all notifications must be assigned a Notification channel. By default, the Sense360 Android SDK sends survey notifications to the Survey Opportunities channel, which the SDK manages. Surveys sent to this channel have an importance of NotificationManager.IMPORTANCE_DEFAULT
.
To send notifications to a custom channel you manage, do so by calling the Sense360.setNotificationPreferences()
method as in this sample code:
You must manage the custom notification channel you are sending survey notifications to. Additionally, ensure that the channel is created before making the call and that it exists whenever a notification is sent, otherwise the SDK creates and sends a notification to the Survey Opportunities channel.
Notification callbacks
Notification callbacks notify you when a notification is sent, clicked, or cancelled (that is, swiped). Integrating surveys via the Sense360 Android SDK does not require implementing the notification callbacks, as they are already provided track the interaction between users and the survey notifications.
Use this example code to register a BroadcastReceiver
:
If you register for multiple actions, use this intent.getAction()
method to determine what happened: