From 186a94ac6021b8344d6ac6fa96e6d0a4b2008a93 Mon Sep 17 00:00:00 2001 From: Kyoz Date: Sun, 26 Nov 2023 12:53:05 +0700 Subject: [PATCH 1/2] fix(#2): app reload/crash when clicking on notification if app is on foreground --- android/.project | 28 +++++++++++++++ .../org.eclipse.buildship.core.prefs | 13 +++++++ android/app/.classpath | 6 ++++ android/app/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../LocalNotificationReceiver.java | 4 ++- 6 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 android/.project create mode 100644 android/.settings/org.eclipse.buildship.core.prefs create mode 100644 android/app/.classpath create mode 100644 android/app/.project create mode 100644 android/app/.settings/org.eclipse.buildship.core.prefs diff --git a/android/.project b/android/.project new file mode 100644 index 0000000..d6155b2 --- /dev/null +++ b/android/.project @@ -0,0 +1,28 @@ + + + Godot Local Notification + Project android created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + + + 1700883703541 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..1a2c677 --- /dev/null +++ b/android/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir= +eclipse.preferences.version=1 +gradle.user.home= +java.home=/opt/homebrew/Cellar/openjdk/18/libexec/openjdk.jdk/Contents/Home +jvm.arguments= +offline.mode=false +override.workspace.settings=true +show.console.view=true +show.executions.view=true diff --git a/android/app/.classpath b/android/app/.classpath new file mode 100644 index 0000000..0b62ab9 --- /dev/null +++ b/android/app/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/android/app/.project b/android/app/.project new file mode 100644 index 0000000..dbdaeda --- /dev/null +++ b/android/app/.project @@ -0,0 +1,34 @@ + + + app + Project app created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1700883703543 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/android/app/.settings/org.eclipse.buildship.core.prefs b/android/app/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..b1886ad --- /dev/null +++ b/android/app/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/android/app/src/main/java/vn/kyoz/godot/localnotification/LocalNotificationReceiver.java b/android/app/src/main/java/vn/kyoz/godot/localnotification/LocalNotificationReceiver.java index d0a63ce..b116df1 100644 --- a/android/app/src/main/java/vn/kyoz/godot/localnotification/LocalNotificationReceiver.java +++ b/android/app/src/main/java/vn/kyoz/godot/localnotification/LocalNotificationReceiver.java @@ -49,7 +49,9 @@ public void onReceive(Context context, Intent intent) { } Intent intent2 = new Intent(context, appClass); - intent2.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + intent2.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | + Intent.FLAG_ACTIVITY_SINGLE_TOP | + Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent2, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); From c81a7f22939e5838c29cedb58a931cc7204d8102 Mon Sep 17 00:00:00 2001 From: Kyoz Date: Sun, 26 Nov 2023 22:49:33 +0700 Subject: [PATCH 2/2] feat: support godot 4.1.3 --- build.env | 4 ++-- example/godot_4/export_presets.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.env b/build.env index 683457a..ae9c8c6 100644 --- a/build.env +++ b/build.env @@ -2,8 +2,8 @@ export PLUGIN_NAME="local-notification" export GDAP_FILE="LocalNotification.gdap" export GDIP_FILE="local-notification.gdip" -export ANDROID_TEMPLATES=("3.4" "3.5" "3.5.1" "3.5.2" "3.5.3" "4.0" "4.1") -export IOS_TEMPLATES=("3.4" "3.5" "3.5.1" "3.5.2" "3.5.3" "4.0" "4.1") +export ANDROID_TEMPLATES=("3.4" "3.5" "3.5.1" "3.5.2" "3.5.3" "4.0" "4.1" "4.1.3") +export IOS_TEMPLATES=("3.4" "3.5" "3.5.1" "3.5.2" "3.5.3" "4.0" "4.1" "4.1.3") export DEFAULT_ANDROID_TEMPLATE=3.5.2 export DEFAULT_IOS_TEMPLATE=3.5.2 diff --git a/example/godot_4/export_presets.cfg b/example/godot_4/export_presets.cfg index 7ebafd0..e9ec3ee 100644 --- a/example/godot_4/export_presets.cfg +++ b/example/godot_4/export_presets.cfg @@ -8,7 +8,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../../../../../Downloads/Example.aab" +export_path="../../../../../../Desktop/Example.apk" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false