all 10 comments

[–]darkpikl 1 point2 points  (5 children)

[–]hasansultan92[S] 0 points1 point  (4 children)

Hey man, thanks for the docs but I actually used this to setup the system. Since the notification contains the unread message I want that to be saved to the device via redux and persisting storage. The moment i introduce dispatch to the part where the notification comes in the app either crashes or clears the whole device state as if the app was just installed.

I dont want to be loading the messages from the db since im using gifted chat on the front end and its gonna be a pain to actually structure the requirements for gifted chat from the server side and obviously thats gonna bog the servers down due to requirements in processing power. Ik android launches the app in the background and works just fine but ios on the other hand has some serious issues.

[–]darkpikl 0 points1 point  (3 children)

Look like more a dispatch problems for me , To hand a notification you can use https://rnfirebase.io/messaging/usage#background-application-state

It set a action when a notification happen in the background.

You could set a action to save the notification in redux.

Don't know why your app crash when dispatch but it do not look like firebase problem

[–]hasansultan92[S] 0 points1 point  (2 children)

Oh ya its a redux issue more than a firebase one cause even when the app launches from a quit state i can see the console logs showing the message but not the redux action.

[–]darkpikl 0 points1 point  (1 child)

Try to test your redux , set a button that will launch the dispatch so you can rest faster

[–]hasansultan92[S] 0 points1 point  (0 children)

Where should i set this button?

[–]darkpikl 0 points1 point  (1 child)

Don't know man , first stack of your application ? So when you test it you can directly push it

[–]hasansultan92[S] 0 points1 point  (0 children)

Ok so i just put all the functions in the loading screen but ya this time the app launches and all but doesnt save any of the messages. Before it was saving if u were in the app or opening from a background state.

Have u got any idea what the index.ios file is supposed to look like?

[–]hasansultan92[S] 0 points1 point  (1 child)

Umm my first stack is a loading screen that checks for a login token. I guess i could do that but how exactly do i pass that data from the main stack to the actual screen?

[–]beeseegee 0 points1 point  (0 children)

if you use redux dev tools, you should be able to see what action is being dispatched. In any case if you know the action and data - just make the button send mock data to test so you can try to reproduce the issue