Saturday, April 6, 2024
HomeiOS Developmentreactjs - Push notification IOS expo SDK improve from 48 to 50...

reactjs – Push notification IOS expo SDK improve from 48 to 50 Issues with App retailer builld


I get a push notification on precise gadget that could be a improvement construct and push notifications are working advantageous each when sending and receiving and utilizing expo push notification software. However, once I submit the app to the app retailer and check on testflight, No expo token is generated. It was working advantageous with expo sdk 48 however I not too long ago upgraded to sdk 50 and now the token just isn’t being generated.

 let token;
 let projectId;

 if (Platform.OS === "android") {
   await Notifications.setNotificationChannelAsync("default", {
     title: "default",
     significance: Notifications.AndroidImportance.MAX,
     vibrationPattern: [0, 250, 250, 250],
     lightColor: "#FF231F7C",
   });
 }

 if (Machine.isDevice) {
   const { standing: existingStatus } =
     await Notifications.getPermissionsAsync();
   let finalStatus = existingStatus;
   if (existingStatus !== "granted") {
     const { standing } = await Notifications.requestPermissionsAsync();
     finalStatus = standing;
   }
   if (finalStatus !== "granted") {
     alert("Did not get push token for push notification!");
     return;
   }
   projectId = Constants.expoConfig.additional.eas.projectId;

   token = (
     await Notifications.getExpoPushTokenAsync({
       projectId: projectId,
     })
   ).information;
   console.warn("projectId", projectId);
   console.log("token", token);
   console.log("projectId", projectId);
 } else {
   alert("Should use bodily gadget for Push Notifications");
 }

 return token;
} ````
. Does anybody know what the issue could be?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments