mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Add some additional FCM logging.
This commit is contained in:
parent
7da73bbc30
commit
c364345e1d
@ -50,6 +50,8 @@ public class FcmService extends FirebaseMessagingService implements InjectableTy
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNewToken(String token) {
|
public void onNewToken(String token) {
|
||||||
|
Log.i(TAG, "onNewToken()");
|
||||||
|
|
||||||
if (!TextSecurePreferences.isPushRegistered(getApplicationContext())) {
|
if (!TextSecurePreferences.isPushRegistered(getApplicationContext())) {
|
||||||
Log.i(TAG, "Got a new FCM token, but the user isn't registered.");
|
Log.i(TAG, "Got a new FCM token, but the user isn't registered.");
|
||||||
return;
|
return;
|
||||||
|
@ -91,6 +91,10 @@ public class FcmRefreshJob extends ContextJob implements InjectableType {
|
|||||||
Optional<String> token = FcmUtil.getToken();
|
Optional<String> token = FcmUtil.getToken();
|
||||||
|
|
||||||
if (token.isPresent()) {
|
if (token.isPresent()) {
|
||||||
|
if (!token.get().equals(TextSecurePreferences.getFcmToken(context))) {
|
||||||
|
Log.i(TAG, "New token differs from the old token.");
|
||||||
|
}
|
||||||
|
|
||||||
textSecureAccountManager.setGcmId(token);
|
textSecureAccountManager.setGcmId(token);
|
||||||
TextSecurePreferences.setFcmToken(context, token.get());
|
TextSecurePreferences.setFcmToken(context, token.get());
|
||||||
TextSecurePreferences.setFcmTokenLastSetTime(context, System.currentTimeMillis());
|
TextSecurePreferences.setFcmTokenLastSetTime(context, System.currentTimeMillis());
|
||||||
|
Loading…
Reference in New Issue
Block a user