Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Handle navigation from push notification #1

Open
adrianha opened this issue Jan 24, 2017 · 7 comments
Open

Handle navigation from push notification #1

adrianha opened this issue Jan 24, 2017 · 7 comments

Comments

@adrianha
Copy link

Hi @sibelius ,
any idea how to do navigation when receiving data from push notification?
You can take at look here: https://github.com/geektimecoil/react-native-onesignal#android-usage
Basically, i need to do navigation outside component because i should configure OneSignal outside for trigger the OneSignal's function onNotificationOpened.

@sibelius
Copy link
Member

I think there are 2 approach to solve this problem:

1 - use redux to send actions to ex-navigation when u receive a push notification
2 - have a component that render nothing, and have the one signal configuration inside of it, something like this: https://github.com/fbsamples/f8app/blob/master/js/PushNotificationsController.js

I'll try to add a recipe for this later on

@adrianha
Copy link
Author

Thank you for the suggestion. I'll take a look at f8 project while looking for your recipe. But i've already tried configuring oneSignal on componentDidMount but the listener was not triggered..

@adrianha
Copy link
Author

i already tried to configure oneSignal inside component that render nothing but it's not triggered unless i configure oneSignal outside the class/component.

@sibelius
Copy link
Member

do u have a repo example using a component that render null, like in f8app ?

@sibelius
Copy link
Member

@adrianha
Copy link
Author

hi @sibelius , apparently the event was not being called because i did some checking when app started. After i removed it, it works like i expected. Thank you for the suggestion to create separate push notification controller like f8app

@sibelius
Copy link
Member

Awesome, could u send a recipe to fix this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants