Please provide the following:
- SDK Version: expo@44.0.4
- Platforms(Android/iOS):
- Notifications
Hi,
Since updating to SDK 44 we have been intermittently receiving the following error in our app related to expo-notifications.
Error: Error encountered while fetching Expo token: TypeError: Network request failed.
I have been unable to replicate the issue via EXPO go or on the standalone app, I am only aware of the issue thanks to the app’s sentry integration. The issue occurs on both iOS and Android devices across multiple OS versions. The majority of users devices do not seem to have the issue and the PUSH notifications work as expected on devices I have access to.
If anyone has any ideas what might be causing the issue it would be great help.
Token Request:
/**
* Get EXPO notification token
*
* @returns {Object} A JSON object of expo token
*/
export async function getTokenAsync () {
// Request token
let experienceId
if (!Constants.manifest) {
// Absence of the manifest means we're in bare workflow
experienceId = '@username/example'
}
const expoPushToken = await Notifications.getExpoPushTokenAsync({
experienceId
})
return expoPushToken
}
Log
xhr
POST https://exp.host/--/api/v2/push/getExpoPushToken [0]
Info
12:11:17
xhr
POST https://exp.host/--/api/v2/push/updateDeviceToken [0]
Info
12:11:18
console
[expo-notifications] Error thrown while updating the device push token with the server: TypeError: Network request failed
{arguments: [[expo-notifications] Error thrown while updating the device push token with the server:, {}], logger: console}
Warning
12:11:18
xhr
POST https://exp.host/--/api/v2/push/updateDeviceToken [0]
Info
12:11:19
console
[expo-notifications] Error thrown while updating the device push token with the server: TypeError: Network request failed
{arguments: [[expo-notifications] Error thrown while updating the device push token with the server:, {}], logger: console}
Warning
12:11:19
exception
Error: Error encountered while fetching Expo token: TypeError: Network request failed.
Error
12:11:19