mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
remove FcmReceiveService.deleteToken() and tweak pref_background_notifications_explain
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user