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:
@ -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
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user