How to call API when App is killed in react native?

后端 未结 1 787
余生分开走
余生分开走 2021-01-06 20:13

I Want to call API in the background when App killed and set the data in AsyncStorage. I used the following library but not working for me.

react-native-bac

1条回答
  •  北海茫月
    2021-01-06 20:43

    You would need to implement the componentWillUnmount method on the root of your app or use a library like realm to save the state throughout the use of your app.

    Maybe worth checking out this answer

    0 讨论(0)
提交回复
热议问题