-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App rerender after click on push notification #701
Comments
I find out, why app gets rerender. Because when I clicked on notification, app goes to background and then it comes to foreground. |
Did you add android:launchMode="singleTop" to your AndroidManifest.xml? |
@martinosmartinos yes, I added it. |
Try to move your logic into componentWillMount lifecycle instead and see if it helps. |
Thanks for your support @martinosmartinos. But it didn't work. |
Hello @janaka120 I'm wondering if the entire app is re-rendering or if you mean that the current screen gets re-rendered (react-lifecycle)? |
Hi @rgomezp My entire app is rendering when I tap on push-notification. |
@janaka120 I see. Is the metro-bundler rebuilding everything or do you simply get taken back to the splash-screen and/or homepage? |
@rgomezp I don't get back to the splash-screen. I get back to the homepage. When I console my main app.js after tap on push notification, it rendered So my app route to home screen. |
@janaka120 ok so just to confirm, the app is not being re-bundled correct? |
@rgomezp yes. It's not rebundling. |
This sounds like a deep-linking issue. Please read our documentation on setting deep-links correctly and verify that you did everything correctly. https://documentation.onesignal.com/docs/links |
@rgomezp I didn't use any deep-link with push-notification. |
Can you please test on iOS to see if you are getting the same result? I'm not sure why this is happening. React will re-render when state changes |
Closing due to no response |
That could solve your problem: |
i have same issue. But my question, is there any problem that i must concern if change to SINGLETASK?? |
@rgomezp I believe I'm experiencing the same problem as the original poster on Android. My application is running, and I minimize it. A push notification arrives, and I tap it to open the application. At this point, the entire application reinitializes. It does not behave this way on iOS. I am currently using |
Use singleTask instead. |
Thanks @hotaryuzaki, after posting my comment yesterday I tried out |
Yes I got confirmed by them about that, but they weren't mentioned the detail which problem they mean. |
Howdy, |
@rgomezp : Can you provide possible issue detail that may occure on changing launchMode from 'singleTop' to 'singleTask'. Right now I had swithed to 'singleTask' |
Setting it to singleTask may result in multiple copies of your activity being created |
@rgomezp : |
@rgomezp As per React Native documentation (https://facebook.github.io/react-native/docs/linking) Linking requires the MainActivity to be |
@rgomezp Thank you for working on this and is this issue fixed yet? |
This feature request has not been implemented yet |
@rgomezp is there an ETA for when the fix will come through? IMO: This is the biggest problem with onesignal for react native in its current state. I have also switched to I am not seeing multiple copies of the activity being created when using |
Having same problems with push notifications on android. But I do use deep links. |
@KestasVenslauskas did you managed to solve this cause I also implement the deep link and the same problem is coming to me |
Description:
When I clicked on push notification, my Android app is getting render again. I didn't check it on IOS.
Environment
react-native-onesignal: 3.2.11,
react: 16.6.0-alpha.8af6728,
react-native: 0.57.4,
I used
npm install --save react-native-onesignal
command to install oneSignal.I configured the oneSignal package according to this documentation. https://documentation.onesignal.com/v5.0/docs/react-native-sdk-setup
Steps to Reproduce Issue:
I'm using
react-navigation: 2.16
.This is my code.
I removed all the event listeners(received, opened), I used. But when I clicked on the push notification. My Android app rerender.
I try to find out a solution, But I couldn't. If some has any idea about this Please tell me.
The text was updated successfully, but these errors were encountered: