import java.io.IOException

This commit is contained in:
Michele Bombardi 2017-09-26 17:05:44 +02:00
parent 4c8581211a
commit d119de19d4
1 changed files with 9 additions and 3 deletions

View File

@ -27,6 +27,7 @@ import com.google.firebase.messaging.RemoteMessage.Notification;
import io.invertase.firebase.Utils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
import java.util.Set;
@ -74,9 +75,14 @@ public class RNFirebaseMessaging extends ReactContextBaseJavaModule implements L
@ReactMethod
public void deleteInstanceId(Promise promise){
Log.d(TAG, "Deleting instance id");
FirebaseInstanceId.getInstance().deleteInstanceId();
promise.resolve(null);
try {
Log.d(TAG, "Deleting instance id");
FirebaseInstanceId.getInstance().deleteInstanceId();
promise.resolve(null);
} catch (IOException e) {
e.printStackTrace();
promise.reject(null,e.getMessage());
}
}
@ReactMethod