Please provide the following:
- SDK Version: 38.0.4
- Platforms(Android/iOS/web/all): all
I am trying to set up redirect URLs for an auth flow using AWS Cognito and WeBroswer.openAuthSessionAsync. I need to return one of three different redirect URLs depending on the environment the app is running in. I using the following code to attempt to do that:
const getRedirect = (): string => {
const appOwnerShip: "expo" | "standalone" | "guest" = Constants.appOwnership;
// development
if (appOwnerShip === "expo") {
return "exp://192.168.0.25:19000/";
}
// Published app in standalone: myapp://
if (appOwnerShip === "standalone") {
return "project-avacodo://";
}
// Published app in Expo client: exp://exp.host/@community/with-webbrowser-redirect
// This does not work
return "exp://exp.host/@reggie3/project-avacodo/";
};
However, apps run in the Expo client have an appOwnerShip of “expo” whether they are run as a Published Project or from the “Recently In Development” menu in the client. Is there some way to tell the programmatically tell the difference?