Please provide the following:
- SDK Version: 38
- Platforms(Android/iOS/web/all): Android, IOS
Hi, im trying to get the expoPushToken with this code:
async function registerForPushNotificationsAsync() {
if (Constants.isDevice) {
const { status: existingStatus } = await Permissions.getAsync(
Permissions.NOTIFICATIONS
);
let finalStatus = existingStatus;
if (existingStatus !== “granted”) {
const { status } = await Permissions.askAsync(
Permissions.NOTIFICATIONS
);
finalStatus = status;
}
if (finalStatus !== “granted”) {
alert(“Failed to get push token for push notification!”);
return;
}
const token = await Notifications.getExpoPushTokenAsync();
console.log(token);
this.setState({ expoPushToken: token });
} else {
alert(“Must use physical device for Push Notifications”);
}
if (Platform.OS === “android”) {
Notifications.createChannelAndroidAsync(“default”, {
name: “default”,
sound: true,
priority: “max”,
vibrate: [0, 250, 250, 250],
});
}
}
and im getting this error/warn:
[Unhandled promise rejection: Error: Fetching the token failed: MISSING_INSTANCEID_SERVICE]
I have seen in videos that have the google.services in the app.json, but since I am using Expo, I did not generate an android app in Firebase, I generated a web App, therefore I do not have the IOS and Android modules in my project , so I can’t get the package Name and google.services.json … I attach images of the content of my app.json
![Captura de pantalla (35)|690x388, 75%]