From 7d95cd1832e7fde7f23350edb093fbdb0cd87c43 Mon Sep 17 00:00:00 2001 From: nuclearfog Date: Thu, 1 Jun 2023 20:15:07 +0200 Subject: [PATCH] bug fix --- app/build.gradle | 6 ++++++ .../twidda/notification/PushNotificationReceiver.java | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b6f9b16e..0fb334d3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,6 +30,10 @@ android { } } + lintOptions { + ignore 'NotificationPermission' + } + packagingOptions { jniLibs { excludes += ['/META-INF/androidx.*', '/META-INF/kotlin*', '/META-INF/com.*', '/META-INF/services/**', '/META-INF/com/**', '/kotlin/**', '/Debug*'] @@ -38,6 +42,8 @@ android { excludes += ['/META-INF/CHANGES', '/META-INF/DEPENDENCIES', '/META-INF/README.md', '/META-INF/androidx.*', '/META-INF/kotlin*', '/META-INF/com.*', '/META-INF/services/**', '/META-INF/com/**', '/kotlin/**', '/Debug*'] } } + + } dependencies { diff --git a/app/src/main/java/org/nuclearfog/twidda/notification/PushNotificationReceiver.java b/app/src/main/java/org/nuclearfog/twidda/notification/PushNotificationReceiver.java index 0ae6ed93..1555dfdd 100644 --- a/app/src/main/java/org/nuclearfog/twidda/notification/PushNotificationReceiver.java +++ b/app/src/main/java/org/nuclearfog/twidda/notification/PushNotificationReceiver.java @@ -11,6 +11,7 @@ import org.nuclearfog.twidda.backend.async.NotificationLoader.NotificationLoader import org.nuclearfog.twidda.backend.async.PushUpdater; import org.nuclearfog.twidda.backend.helper.update.PushUpdate; import org.nuclearfog.twidda.config.GlobalSettings; +import org.unifiedpush.android.connector.ConstantsKt; import org.unifiedpush.android.connector.MessagingReceiver; /** @@ -37,9 +38,11 @@ public class PushNotificationReceiver extends MessagingReceiver implements Async @Override public void onNewEndpoint(@NonNull Context context, @NonNull String endpoint, @NonNull String instance) { - PushUpdater pushUpdater = new PushUpdater(context); - PushUpdate update = new PushUpdate(endpoint); - pushUpdater.execute(update, null); + if (instance.equals(ConstantsKt.INSTANCE_DEFAULT)) { + PushUpdater pushUpdater = new PushUpdater(context); + PushUpdate update = new PushUpdate(endpoint); + pushUpdater.execute(update, null); + } }