[notifications][android] fix #1527

This commit is contained in:
Salakar
2018-09-25 12:01:42 +01:00
parent ea9b04737b
commit fb6153db94
2 changed files with 10 additions and 2 deletions

View File

@@ -152,7 +152,15 @@ public class Utils {
appProcess.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND
&& appProcess.processName.equals(packageName)
) {
ReactContext reactContext = (ReactContext) context;
ReactContext reactContext;
try {
reactContext = (ReactContext) context;
} catch(ClassCastException exception) {
// Not react context so default to true
return true;
}
return reactContext.getLifecycleState() == LifecycleState.RESUMED;
}
}