'Why am I still getting pushy notifications even when user logs out React Native
I am still getting pushy notifications for users even when they log out. This is my logout function. What is the right way to remove the device token so it removes it from the database?
const beginLogout = async () => {
AuthService.logout();
const formData = new FormData();
const deviceToken = await AsyncStorage.getItem("pushyToken");
console.log("device token at logout: ", deviceToken)
dispatch(logout({ token: accessToken, localDeviceToken: deviceToken }))
.then(unwrapResult)
.then((originalPromiseResult) => {
console.log("Logout Success: " + originalPromiseResult.data.message);
})
.catch((rejectedValue) => {
console.log(
"Error when trying to logout: " + JSON.stringify(rejectedValue)
);
});
dispatch(resetProfile())
dispatch(deAuthenticateConnecticube())
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
