简体   繁体   中英

How to pass data to Native module from React Native when the app is getting destroyed by the user

I can get the state of the app using AppState but currently it supports only for Foreground and Background but not when the app is completely destroyed.

Is there anyway I can find an event when the app is getting killed? I believe, I could pass some data as arguments to Native Modules when that event occurs.

您可以将AppState与诸如componentWillUnmount之类的Component挂钩一起使用,以便知道用户何时要关闭您的应用程序,因为当前没有任何东西可以告诉您将被关闭。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM