Flutter and push notifications | Community
Skip to main content
September 10, 2025
Solved

Flutter and push notifications

  • September 10, 2025
  • 1 reply
  • 319 views

 

Hi, I understand that we can implement push notifications with AJO for a Flutter mobile app. However, the documentation isn’t very clear to me.

 

From what I’ve read, it seems that we don’t need native code to initialize the SDK, but we do need to add some native code to pass the Firebase token, for example on Android:

MobileCore.setPushIdentifier(token);
 

After that, we should be able to listen for messages in Flutter using something like:

List<Message> messages = await Messaging.getCachedMessages();
 

Is my understanding correct? I’d really appreciate some guidance on this.

Best answer by Mayank_Gandhi

Flutter wrapper doesn’t expose MobileCore.setPushIdentifier(token) directly. So you have to Fetch the Firebase token in the native Android/iOS code Call MobileCore.setPushIdentifier(token); from native code and not directly from Flutter. @nestorar  After initializing things natively, the messages should be delivered to the app via Firebase/FCM or APNs.
something like this:

FirebaseMessaging.getInstance().getToken() .addOnCompleteListener(new OnCompleteListener<String>() { @Override public void onComplete(@NonNull Task<String> task) { if (task.isSuccessful()) { String token = task.getResult(); MobileCore.setPushIdentifier(token); } } });

sample repo for flutter: https://github.com/adobe/aepsdk_flutter/tree/main

1 reply

Mayank_Gandhi
Adobe Employee
Mayank_GandhiAdobe EmployeeAccepted solution
Adobe Employee
September 10, 2025

Flutter wrapper doesn’t expose MobileCore.setPushIdentifier(token) directly. So you have to Fetch the Firebase token in the native Android/iOS code Call MobileCore.setPushIdentifier(token); from native code and not directly from Flutter. @nestorar  After initializing things natively, the messages should be delivered to the app via Firebase/FCM or APNs.
something like this:

FirebaseMessaging.getInstance().getToken() .addOnCompleteListener(new OnCompleteListener<String>() { @Override public void onComplete(@NonNull Task<String> task) { if (task.isSuccessful()) { String token = task.getResult(); MobileCore.setPushIdentifier(token); } } });

sample repo for flutter: https://github.com/adobe/aepsdk_flutter/tree/main

NestorArAuthor
September 10, 2025

Ok perfect, I understand the part about initialization and the push notifier.

Regarding the messages, if I already have FCM implemented for push notifications in my app, does that mean I’m already set to receive AJO notifications as a RemoteMessage from FirebaseMessaging? Or do I also need a native implementation to handle these new messages from AJO?

Thank you very much for your help.

Mayank_Gandhi
Adobe Employee
Adobe Employee
September 10, 2025

@nestorar I think you should receive the notification with FCM implemented, let us know if you face any issue I will check with our mobile team.