Show intent dialog even when the app is closed

Viewed 19

I'm making an app where the users will get alert dialog even when the app is closed.

I made a intent dialog but it only shows when the users is using the app.

MyFirebaseMessagingService.java

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
    super.onMessageReceived(remoteMessage);
    Intent dialogIntent = new Intent(MyFirebaseMessagingService.this,StartCompaignDialogActivity.class);
    dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    this.startActivity(dialogIntent);

StartCompaignDialogActivity is the name of my dialog that I've made

I'm using FCM to send the dialog to the users.

0 Answers
Related