We have our app target, and in that Info.plist, we defined URL Schemes that can be used to open the app with a URL.
Now we are adding a today extension. We will want to have a table view who will open that URL from the extension. We see how that is supported in the API.
Can we get the URL scheme from the app's Info.plist, or are we basically "hard coding" the value in the extension for it to call to open?
To get infos.plist values you can use this:
let urlTypesArray = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleURLTypes")
You can find the right key (CFBundleURLTypes) opening the info.plist as Source Code (right click)
then, find the value :
let urlSchemesValue = urlTypesArray![0]["CFBundleURLSchemes"]
print("urlSchemesValue => \(urlSchemesValue)")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With