Disable Push Notification in Flutter

I'm using FCM to push notification from my server. But the problem is when i implement Countly SDK it say "Message wasn't sent from Countly server, so it cannot be handled by Countly SDK". Is there any option to disable this feature? I want to handle the notify manualy

0

Comments

2 comments
  • Official comment
    To handle push notifications manually here are some steps you need to do in your android app:

    -- Add the following to your app's manifest:
    <service
       
    android:name=".java.MyFirebaseMessagingService"
       
    android:exported="false">
       
    <intent-filter>
           
    <action android:name="com.google.firebase.MESSAGING_EVENT" />
       
    </intent-filter>
    </service>
    -- Create a class that extends FirebaseMessagingService.
    public class MyFirebaseMessagingService extends FirebaseMessagingService {

    @Override
    public void onNewToken(String token) {
    super.onNewToken(token);
    }

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
    super.onMessageReceived(remoteMessage);
    }

    @Override
    public void onDeletedMessages() {
    super.onDeletedMessages();
    }
    }
     
    Now, this class will handle the notifications. you can do what you want to do with the notifications received.
    Comment actions Permalink
  • Thanks @Muhammad. Very appreciate it.

    0
    Comment actions Permalink

Please sign in to leave a comment.