How to disable SDK's push handler?
Hi,
Also I have an other issue with notifications. My application does not contains only chat feature. I have my own receiver for push notifications which extends FirebaseMessagingService. When i receive message from other user Push messages doubles in notification bar. How can i overcome this?
Thanks
@KAPLANDROID The best way to do this is to customize the Chat SDK push handling. I would recommend looking at the source code for the chat-sdk-firebase-push module - it's not very long. Specifically the DefaultBroadcastReceiver.
If you registered your own broadcast receiver you could copy paste the Chat SDK push handling code into your onReceive method. Then set config.inboundPushHandlingEnabled = false during the Chat SDK setup. That would mean that only your push handling code would be used. To use this option you will need to update to version 4.1.23 of the Chat SDK.
@bensmiley i cant find config.inboundPushHandlingEnabled = false in new version!
@ominfowave the correct method is:
config.setInboundPushHandlingEnabled(false);
@bensmiley I think problem is not solved because notification appeared again. I updated de version to 4.1.25 and saw that ChatSDK.java line 151 shows notification to the notif bar. Can you check this again?
@bensmiley we have implemented our own notification handler which is working fine when app is running but if app is in background and notification comes which is also fine but same notification appears again when we launch the app next time.
@bensmiley I did also make like mentioned but still getting the notifications, I even unimplemented FirebasePushModule but still getting them, worth to mention that I'm getting them only if the app is in bg or closed
@MuhammedRefaat are you using the Firebase Cloud Functions script? If you are, push notifications will be being sent. You could disable that script to stop them.
@bensmiley Actually I'm not using any Firebase Cloud Functions, on the other hand that's how I'm setting the configuration regarding the notification disable:
builder.setShowLocalNotifications(false);
builder.locationMessagesEnabled(false);
builder.setClientPushEnabled(false);
builder.setInboundPushHandlingEnabled(false);
And yet, I'm receiving the push notification when the app is in bg or closed, by displaying the app main logo along with the sender name and message.