catch more firebase library bugs

This commit is contained in:
Daniel Gultsch 2019-08-06 15:04:59 +02:00
parent ffc16faf7b
commit 1ff17fc3f0

View file

@ -147,7 +147,14 @@ public class PushManagementService {
} }
private void retrieveFcmInstanceToken(final OnGcmInstanceTokenRetrieved instanceTokenRetrieved) { 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()) { if (!task.isSuccessful()) {
Log.d(Config.LOGTAG, "unable to get Firebase instance token", task.getException()); Log.d(Config.LOGTAG, "unable to get Firebase instance token", task.getException());
} }