remove FcmReceiveService.deleteToken() and tweak pref_background_notifications_explain

This commit is contained in:
adbenitez
2024-08-01 17:18:50 +02:00
parent 3e72837688
commit 08cea81e54
3 changed files with 1 additions and 19 deletions
@@ -10,6 +10,5 @@ import androidx.annotation.Nullable;
public class FcmReceiveService {
public static void register(Context context) {}
public static void waitForRegisterFinished() {}
public static void deleteToken() {}
@Nullable public static String getToken() { return null; }
}
@@ -92,23 +92,6 @@ public class FcmReceiveService extends FirebaseMessagingService {
return prefixedToken;
}
public static void deleteToken() {
if (prefixedToken == null) {
Log.i(TAG, "FCM not registered yet, no token to delete");
return;
}
Util.runOnAnyBackgroundThread(() -> {
try {
Tasks.await(FirebaseMessaging.getInstance().deleteToken());
prefixedToken = null;
Log.i(TAG, "FCM token deleted for " + BuildConfig.APPLICATION_ID);
} catch (Exception e) {
Log.e(TAG, "cannot delete FCM token for " + BuildConfig.APPLICATION_ID + ": " + e);
}
});
}
@Override
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
Log.i(TAG, "FCM push notification received");
+1 -1
View File
@@ -1150,7 +1150,7 @@
<string name="pref_push_notifications_explain">Reliable Push Notifications for Chatmail-Servers</string>
<string name="pref_push_ask_disable">Disable using Push Service?\n\nThis may result in delayed notifications.</string>
<string name="pref_background_notifications">Use Background Connection</string>
<string name="pref_background_notifications_explain">Requires ignored battery optimizations, use if Push Service is unavailable</string>
<string name="pref_background_notifications_explain">Requires ignored battery optimizations, use if notifications don\'t arrive on time</string>
<string name="pref_reliable_service">Force Background Connection</string>
<string name="pref_reliable_service_explain">Causes a permanent notification</string>