General
Push notifications are delivered on a user’s desktop or mobile screen anytime they have their browser open, regardless of whether or not the user is on the website. These communications may be accompanied by images or gifs to generate a greater impact.
Google customization
If you have custom Firebase classes, you may need to disable the following SDK services, defined in the manifest.xml.
<!-- <service
android:name="com.indigitall.android.push.services.FirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service> -->If this is your case, you must add this code to ensure that notifications sent from indigitall are received and displayed.
In your custom FirebaseMessagingService, override onNewToken to register a refreshed push token.
@Override
public void onNewToken(String token) {
super.onNewToken(token);
FirebaseUtils.setPushToken(this);
}override fun onNewToken(token: String) {
super.onNewToken(token)
FirebaseUtils.setPushToken(this)
}In your custom FirebaseMessagingService, delegate messages to the SDK so Indigitall notifications are displayed.
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage.getData() != null
&& !FirebaseUtils.pushNotificationIndigitall(this, remoteMessage)) {
// Handle messages from your own backend
}
}override fun onMessageReceived(remoteMessage: RemoteMessage) {
if (remoteMessage.data.isNotEmpty()
&& !FirebaseUtils.pushNotificationIndigitall(this, remoteMessage)
) {
// Handle messages from your own backend
}
}Huawei Customization
In the service associated with the com.huawei.push.action.MESSAGING_EVENT action, delegate HMS messages to the SDK so Indigitall notifications are displayed.
// Import com.huawei.hms.push.RemoteMessage for this Huawei service callback.
override fun onMessageReceived(remoteMessage: RemoteMessage) {
if (remoteMessage.data.isNotEmpty()
&& !HMSUtils.pushNotificationIndigitall(this, remoteMessage)
) {
// Handle messages from your own backend
}
}@Override
public void onMessageReceived(com.huawei.hms.push.RemoteMessage remoteMessage) {
try {
if (remoteMessage.getData() != null
&& !HMSUtils.pushNotificationIndigitall(this, remoteMessage)) {
// Handle messages from your own backend
}
} catch (JSONException exception) {
Log.e("Push", "Unable to process HMS message", exception);
}
}