Home > Blockchain >  Do I need to add "https" to iOS info.plist and Android manifest files
Do I need to add "https" to iOS info.plist and Android manifest files

Time:06-04

I've read the React Native documentation on the canOpenURL method. From what I understood I have to add http:// and https:// to LSApplicationQueriesSchemes and AndroidManifest.xml but it worked fine without me adding those values.

E.g. canOpenURL('https://stackoverflow.com/');

I tried to find iOS and Android specific documentation on that but I couldn't find a clear answer to that.

So do I actually need to add http and https to plist and manifest?

CodePudding user response:

No, you don't need to add those schemes.

LSApplicationQueriesSchemes was added to prevent apps from abusing the system to produce an "app inventory" by stealth. Http and https do not reveal anything. In fact there probably isn't much point in calling canOpenUrl for these schemes as you know that you can (Maybe the user could have removed all browsers from the device, but it seems an unlikely case).

Also, note that canOpenUrl doesn't check anything after the method; It doesn't tell you anything about the validity of the domain name or url path.

  • Related