You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I installed the react-native-hms-push package and configured all ok, run the app on emulator o phisical device all its ok but when i generate the apk for test i have this error when i get the token of device
Screenshots
If applicable, add screenshots to help explain your issue
The code to obtain the token is this:
`
export async function getTokenFCM() {
// Register the device with FCM
const isHuawei = await validateHuaweiDevice();
let token = '';
if (Platform.OS !== 'ios') {
if (!isHuawei) {
await messaging().registerDeviceForRemoteMessages();
}
}
Description
I installed the react-native-hms-push package and configured all ok, run the app on emulator o phisical device all its ok but when i generate the apk for test i have this error when i get the token of device
Screenshots
If applicable, add screenshots to help explain your issue
The code to obtain the token is this:
`
export async function getTokenFCM() {
// Register the device with FCM
const isHuawei = await validateHuaweiDevice();
let token = '';
if (Platform.OS !== 'ios') {
if (!isHuawei) {
await messaging().registerDeviceForRemoteMessages();
}
}
// Get the token
if (Platform.OS === 'ios') {
token = await messaging().getAPNSToken();
} else {
if (isHuawei) {
token = await HmsPushInstanceId.getToken();
token =
token['result'] && parseInt(token['resultCode']) === 0
? token['result']
: '';
} else {
token = await messaging().getToken();
}
}
console.log('TOKEN OBTAINED', token);
return token;
}
`
Environment
Other
the validateHuaweiDevice function return a Boolean with the @hmscore/react-native-hms-availability service
The text was updated successfully, but these errors were encountered: