Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/firebase_messaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 7.0.1

* Fix `onLaunch` being called again when resuming an application on Android from the Recents screen

## 7.0.0

* Depend on `firebase_core` and migrate plugin to use `firebase_core` native SDK versioning features;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public void onComplete(@NonNull Task<InstanceIdResult> task) {
channel.invokeMethod("onToken", task.getResult().getToken());
}
});
if (mainActivity != null) {
if (mainActivity != null && !launchedActivityFromHistory(mainActivity.getIntent())) {
sendMessageFromIntent("onLaunch", mainActivity.getIntent());
}
result.success(null);
Expand Down Expand Up @@ -288,6 +288,12 @@ public void run() {
}
}

private static boolean launchedActivityFromHistory(Intent intent) {
return intent != null
&& (intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)
== Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY;
}

@Override
public boolean onNewIntent(Intent intent) {
boolean res = sendMessageFromIntent("onResume", intent);
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_messaging/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: firebase_messaging
description: Flutter plugin for Firebase Cloud Messaging, a cross-platform
messaging solution that lets you reliably deliver messages on Android and iOS.
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging
version: 7.0.0
version: 7.0.1

flutter:
plugin:
Expand Down