1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Fix push token not updated

This commit is contained in:
xmflsct
2023-02-28 20:43:37 +01:00
parent 4ce3ce58ab
commit 0450019cac
3 changed files with 13 additions and 17 deletions

View File

@ -11,20 +11,16 @@ export const updateExpoToken = async (): Promise<string> => {
await setChannels()
}
if (expoToken?.length) {
return Promise.resolve(expoToken)
} else {
if (isDevelopment) {
setGlobalStorage('app.expo_token', 'ExponentPushToken[DEVELOPMENT_1]')
return Promise.resolve('ExponentPushToken[DEVELOPMENT_1]')
}
return await Notifications.getExpoPushTokenAsync({
experienceId: '@xmflsct/tooot',
applicationId: 'com.xmflsct.app.tooot'
}).then(({ data }) => {
setGlobalStorage('app.expo_token', data)
return data
})
if (isDevelopment) {
setGlobalStorage('app.expo_token', 'ExponentPushToken[DEVELOPMENT_1]')
return 'ExponentPushToken[DEVELOPMENT_1]'
}
return await Notifications.getExpoPushTokenAsync({
experienceId: '@xmflsct/tooot',
applicationId: 'com.xmflsct.app.tooot'
}).then(({ data }) => {
setGlobalStorage('app.expo_token', data)
return data
})
}