When I want to upload an Android application to the Play Store, which one should I use?
I have tried the above but I am still confused about which one is the most effective?
./gradlew assembleRelease
./gradlew installRelease
./gradlew bundleRelease
Run Code Online (Sandbox Code Playgroud)
I expect the best way to do the above.
我使用 React Native FCM 进行消息传递,当用户注销应用程序时,我想删除 FCM 令牌,以便用户不会再次收到通知。
下面是我的注销代码。
_signOutAsync = async () => {
this.logoutEvent()
API.post('customer/auth/logout', null, {
headers: {
Authorization:
'Bearer ' + (await AsyncStorage.getItem(Config.ACCESS_TOKEN))
}
}).then((response) => {
console.log(response)
})
this.clearData()
}
Run Code Online (Sandbox Code Playgroud)
谢谢。
当应用程序被用户杀死时,我想从 API 更改状态数据。
我曾尝试使用 componentWillUnmount 在应用程序关闭时更改数据,我也使用 AppState
_handleAppStateChange = (nextAppState) => {
if (
this.state.appState.match(/inactive|background/) &&
nextAppState === 'active'
) {
console.log('App has come to the foreground!')
}
this.setState({ appState: nextAppState })
}
Run Code Online (Sandbox Code Playgroud)
我希望当应用程序被用户杀死时,它可以自动更改状态。