try to catch exceptions on FCM token refresh
This commit is contained in:
parent
9caca380b4
commit
f0e96ca60d
1 changed files with 10 additions and 1 deletions
|
@ -1,15 +1,24 @@
|
|||
package de.pixart.messenger.services;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.firebase.iid.FirebaseInstanceIdService;
|
||||
|
||||
import de.pixart.messenger.Config;
|
||||
import de.pixart.messenger.utils.Compatibility;
|
||||
|
||||
public class InstanceIdService extends FirebaseInstanceIdService {
|
||||
|
||||
@Override
|
||||
public void onTokenRefresh() {
|
||||
Intent intent = new Intent(this, XmppConnectionService.class);
|
||||
intent.setAction(XmppConnectionService.ACTION_FCM_TOKEN_REFRESH);
|
||||
startService(intent);
|
||||
try {
|
||||
startService(intent);
|
||||
} catch (Exception e) {
|
||||
Log.e(Config.LOGTAG, "unable to refresh FCM token", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue