catch more firebase library bugs

This commit is contained in:
Daniel Gultsch 2019-08-06 15:04:59 +02:00
parent ffc16faf7b
commit 1ff17fc3f0
1 changed files with 8 additions and 1 deletions

View File

@ -147,7 +147,14 @@ public class PushManagementService {
}
private void retrieveFcmInstanceToken(final OnGcmInstanceTokenRetrieved instanceTokenRetrieved) {
FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(task -> {
final FirebaseInstanceId firebaseInstanceId;
try {
firebaseInstanceId = FirebaseInstanceId.getInstance();
} catch (IllegalStateException e) {
Log.d(Config.LOGTAG, "unable to get firebase instance token ",e);
return;
}
firebaseInstanceId.getInstanceId().addOnCompleteListener(task -> {
if (!task.isSuccessful()) {
Log.d(Config.LOGTAG, "unable to get Firebase instance token", task.getException());
}