Open haideralishah opened 6 years ago
issue 1: I am unable to get custom data (key:value) sent along the notification in the app
If you are setting data
together with notification
. Data will be ignored in Android when the app is in the background. Is this what you are expecting?
issue 2
try to move the get initial notification either outside of component lifecycle or put in in root level component
If you are setting data together with notification. Data will be ignored in Android when the app is in the background. Is this what you are expecting?
How to open a specific screen on click of Notification from drawer then?
What version of RN and react-native-fcm are you running? react-native": "0.51.0",
What device are you using? (e.g iOS9 emulator, Android 6 device)? iOS emulator and android 5 device
Is your app running in foreground, background or not running? My app is working fine and also receiving notifications.
Issue#1 I am unable to get custom data (key:value) sent along the notification in the app, while it was working before. (I was getting data before but from last 1 week it stopped and not getting custom data)
Issue#2 I closed the app and open the app again, it is trigerring and bringing notification via getInitialNotification method. So is there any possibility that it will only go in success of getInitialNotification if there is a click on notification and not for old notification.
My MainApplication.java package com.mageapp;
import android.app.Application;
import com.facebook.react.ReactApplication; import org.devio.rn.splashscreen.SplashScreenReactPackage; import com.evollu.react.fcm.FIRMessagingPackage; // import io.invertase.firebase.RNFirebasePackage; import com.zmxv.RNSound.RNSoundPackage; import com.inprogress.reactnativeyoutube.ReactNativeYouTube; import com.bubblemessage.BubbleMessagePackage; import io.linkpreview.RNReactNativeLinkPreviewPackage; import co.apptailor.googlesignin.RNGoogleSigninPackage; import com.facebook.reactnative.androidsdk.FBSDKPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import com.facebook.CallbackManager; // import io.invertase.firebase.messaging.RNFirebaseMessagingPackage; import java.util.Arrays; import java.util.List;
public class MainApplication extends Application implements ReactApplication { private static CallbackManager mCallbackManager = CallbackManager.Factory.create();
protected static CallbackManager getCallbackManager() { return mCallbackManager; }
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; }
};
@Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; }
@Override public void onCreate() { super.onCreate(); SoLoader.init(this, / native exopackage / false); } }
MainActivity.java
package com.mageapp;
import com.facebook.react.ReactActivity; import com.inprogress.reactnativeyoutube.ReactNativeYouTube; import co.apptailor.googlesignin.RNGoogleSigninPackage; import com.facebook.reactnative.androidsdk.FBSDKPackage; import com.facebook.reactnative.androidsdk.FBSDKPackage; import android.content.Intent; import android.os.Bundle;
import org.devio.rn.splashscreen.SplashScreen;
public class MainActivity extends ReactActivity {
}