Skip to content

my fork update #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Next Next commit
[flutter_local_notifications] updates how launch intent is read for g…
…etNotificationAppLaunchDetails (MaikuB#1672)

* updates how launch intent is read for getNotificationAppLaunchDetails

* Google Java Format

Co-authored-by: github-actions <>
  • Loading branch information
MaikuB authored Aug 14, 2022
commit 66687fdcab17445fbb998b92ff8eaed71f054630
4 changes: 4 additions & 0 deletions flutter_local_notifications/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [9.7.1]

* [Android] updated how launch intent is read on Android for the `getNotificationAppLaunchDetails` method

# [9.7.0]

* [Android] added support to specify notification count via the `number` property that has been added to the `AndroidNotificationDetails` class. Thanks to the PR from [Katsuya Kato](https://github.com/katsuyax)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public class FlutterLocalNotificationsPlugin
private MethodChannel channel;
private Context applicationContext;
private Activity mainActivity;
private Intent launchIntent;

@SuppressWarnings("deprecation")
public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
Expand Down Expand Up @@ -1174,9 +1173,6 @@ private static boolean launchedActivityFromHistory(Intent intent) {

private void setActivity(Activity flutterActivity) {
this.mainActivity = flutterActivity;
if (mainActivity != null) {
launchIntent = mainActivity.getIntent();
}
}

private void onAttachedToEngine(Context context, BinaryMessenger binaryMessenger) {
Expand All @@ -1197,7 +1193,6 @@ public void onDetachedFromEngine(FlutterPluginBinding binding) {}
public void onAttachedToActivity(ActivityPluginBinding binding) {
binding.addOnNewIntentListener(this);
mainActivity = binding.getActivity();
launchIntent = mainActivity.getIntent();
}

@Override
Expand Down Expand Up @@ -1363,14 +1358,18 @@ private void show(MethodCall call, Result result) {
private void getNotificationAppLaunchDetails(Result result) {
Map<String, Object> notificationAppLaunchDetails = new HashMap<>();
String payload = null;
Boolean notificationLaunchedApp =
mainActivity != null
&& SELECT_NOTIFICATION.equals(mainActivity.getIntent().getAction())
&& !launchedActivityFromHistory(mainActivity.getIntent());
notificationAppLaunchDetails.put(NOTIFICATION_LAUNCHED_APP, notificationLaunchedApp);
if (notificationLaunchedApp) {
payload = launchIntent.getStringExtra(PAYLOAD);
Boolean notificationLaunchedApp = false;
if (mainActivity != null) {
Intent launchIntent = mainActivity.getIntent();
notificationLaunchedApp =
launchIntent != null
&& SELECT_NOTIFICATION.equals(launchIntent.getAction())
&& !launchedActivityFromHistory(launchIntent);
if (notificationLaunchedApp) {
payload = launchIntent.getStringExtra(PAYLOAD);
}
}
notificationAppLaunchDetails.put(NOTIFICATION_LAUNCHED_APP, notificationLaunchedApp);
notificationAppLaunchDetails.put(PAYLOAD, payload);
result.success(notificationAppLaunchDetails);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
Expand All @@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
2 changes: 1 addition & 1 deletion flutter_local_notifications/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flutter_local_notifications
description: A cross platform plugin for displaying and scheduling local
notifications for Flutter applications with the ability to customise for each
platform.
version: 9.7.0
version: 9.7.1
homepage: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications

dependencies:
Expand Down