mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
[notifications][android] fix #1527
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user