Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is info.plist for React Native projects run in Expo for the purpose of callback URLs?

I am handling OAuth requests in my iOS React Native application. This application is contained and launched through Expo. I want to add in a custom callback url, so that I can return back to the application after jumping into a browser. Supposedly, I do this through modifying the info.plist file, except it is nowhere to be found. My project folder does not contain this file anywhere and I am not entirely sure if npm, the command line tool, is generating it on runtime.

Where on earth is this file?

For context, I am not using Xcode. I am just using sublime to edit my project files with a terminal running npm start.

Edit - After the solution was found:

There is another question on StackOverflow that aims to answer this same question, but for different reasons: "Info.plist file for react native ios app using expo SDK." However, my question is specific to callback urls. As I described in my answer below, Expo has its own callback URL for your app (i.e. no need to edit the info.plist file). If you need that info.plist, see the question linked above. The info.plist file is hidden when using Expo, but there is a work around to accessing some of its fields.

like image 845
Code Doggo Avatar asked Oct 30 '17 12:10

Code Doggo


People also ask

Where is info plist in React Native project?

For non-Expo projects, the location is /YOUR_APP_DIR/ios/YOUR_APP_NAME/Info. plist .

How do I run a React Native project with Expo?

Running your React Native applicationInstall the Expo Go app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo Go app to scan the QR code from your terminal to open your project. On iOS, use the built-in QR code scanner of the default iOS Camera app.


2 Answers

For non-Expo projects, the location is /YOUR_APP_DIR/ios/YOUR_APP_NAME/Info.plist. If you update this file and save, you will see the same file update in Xcode.

like image 53
Sun Lee Avatar answered Sep 21 '22 16:09

Sun Lee


Shubhnik Singh truly helped me out here. For anyone wondering, go here: https://docs.expo.io/versions/latest/workflow/linking/

More specifically, look at the Expo.Linking module section. Instead of creating your own callback url link, you are borrowing Expo's. You are, after all, running everything from with inside another app, so it wouldn't make sense to have your own true callback link.

In all, you do have a callback link that Expo gives you.

Edit: Saturday, March 30th, 2019

As reported in the comments, the original link to the Linking guide is dead. But, it only appears like Expo moved around some stuff on their domain. It is apparent that some of the actually details have slightly been changed (see WayBackMachine's snapshot of the original page). Specifically relating to this question, the callback URL specifics and the names on the actual guide have changed slightly. I have updated my original answer above to reflect this.

like image 21
Code Doggo Avatar answered Sep 18 '22 16:09

Code Doggo