We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38776b5 commit e5e6da8Copy full SHA for e5e6da8
android/src/main/java/com/geektime/rnonesignalandroid/RNOneSignal.java
@@ -236,6 +236,11 @@ public void addEmailSubscriptionObserver() {
236
@ReactMethod
237
public void getDeviceState(Promise promise) {
238
OSDeviceState state = OneSignal.getDeviceState();
239
+ if (state == null) {
240
+ Log.e("OneSignal", "getDeviceState: OSDeviceState is null");
241
+ promise.reject("Null OSDeviceState", "OSDeviceState is null");
242
+ return;
243
+ }
244
promise.resolve(RNUtils.jsonToWritableMap(state.toJSONObject()));
245
}
246
0 commit comments