Commit f8aa45b0 authored by Libin Lu's avatar Libin Lu

add show_in_foreground option

parent 7956f1cb
......@@ -65,14 +65,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
......@@ -81,6 +73,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
......@@ -99,7 +99,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 23 Platform (1)" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="okio-1.9.0" level="project" />
<orderEntry type="library" exported="" name="fresco-0.11.0" level="project" />
......@@ -110,14 +110,14 @@
<orderEntry type="library" exported="" name="firebase-core-9.4.0" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="okhttp-urlconnection-3.4.1" level="project" />
<orderEntry type="library" exported="" name="react-native-0.33.0" level="project" />
<orderEntry type="library" exported="" name="android-jsc-r174650" level="project" />
<orderEntry type="library" exported="" name="react-native-0.34.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.2.1" level="project" />
<orderEntry type="library" exported="" name="firebase-common-9.4.0" level="project" />
<orderEntry type="library" exported="" name="firebase-iid-9.4.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.2.1" level="project" />
<orderEntry type="library" exported="" name="fbcore-0.11.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="fbcore-0.11.0" level="project" />
<orderEntry type="library" exported="" name="imagepipeline-0.11.0" level="project" />
<orderEntry type="library" exported="" name="firebase-messaging-9.4.0" level="project" />
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
......
......@@ -160,7 +160,9 @@ public class FIRLocalMessagingHelper {
Intent i = new Intent("com.evollu.react.fcm.ReceiveLocalNotification");
i.putExtras(bundle);
mContext.sendOrderedBroadcast(i, null);
}else{
}
if(!mIsForeground || bundle.getBoolean("show_in_foreground")){
Intent intent = new Intent(mContext, intentClass);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtras(bundle);
......
......@@ -7,7 +7,7 @@
<key>RNFIRMessaging.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
<integer>9</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
......
......@@ -276,9 +276,14 @@ RCT_EXPORT_METHOD(getBadgeNumber: (RCTPromiseResolveBlock)resolve rejecter:(RCTP
- (void)handleNotificationReceived:(NSNotification *)notification
{
NSMutableDictionary *data = [[NSMutableDictionary alloc]initWithDictionary: notification.userInfo];
[data setValue:@(RCTSharedApplication().applicationState == UIApplicationStateInactive) forKey:@"opened_from_tray"];
[_bridge.eventDispatcher sendDeviceEventWithName:FCMNotificationReceived body:data];
if([notification.userInfo valueForKey:@"opened_from_tray"] == nil){
NSMutableDictionary *data = [[NSMutableDictionary alloc]initWithDictionary: notification.userInfo];
[data setValue:@(RCTSharedApplication().applicationState == UIApplicationStateInactive) forKey:@"opened_from_tray"];
[_bridge.eventDispatcher sendDeviceEventWithName:FCMNotificationReceived body:data];
}else{
[_bridge.eventDispatcher sendDeviceEventWithName:FCMNotificationReceived body:notification.userInfo];
}
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment