Alex Alex - 3 months ago 30
iOS Question

Change LSApplicationQueriesSchemes at Runtime

A friend asked me to find a way to change the plist property LSApplicationQueriesSchemes from within the iOS app itself to added new schema url at runtime. The app is distributed with an Enterprise account. I told him this is impossible for me, but I don't find anything about it to provide an evidence. Could someone provide me some useful information (e.g. a link) to support my thought?

Answer

It's not possible. This is a measure Apple explicitly added to prevent developers from abusing canOpenURL to figure out what apps users had installed. Certain company was misusing this method - even updating their list dynamically - to learn what apps users had and installed and because of this Apple decided that your app should try to open other apps that it has defined at development time only. Even if you did find a way around this, Apple would most definitely fix it in the next release and break the app from that point onwards. Furthermore, the Info.plist is in your App Bundle, which is read-only.