user22833405
user22833405

Reputation:

I used FLAG_IMMUTABLE in my pending intent but again I'm getting the below error

targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.? Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

Upvotes: 0

Views: 64

Answers (1)

Predrag Maksimovic
Predrag Maksimovic

Reputation: 31

You need to handle intent in backgroud. here is the code which need to be in your class extendend By FirebaseMessageService

@Override
public void handleIntent(Intent intent) {
    RemoteMessage remoteMessage = new RemoteMessage(intent.getExtras());
    onMessageReceived(remoteMessage);
}

Upvotes: 0

Related Questions