swift - How to open app from email URL in iOS 9? -
i've tried like:
in appdelegate:
func application(application: uiapplication, handleopenurl url: nsurl) -> bool { var returnvalue = false let urlstring = url.absolutestring print(urlstring) if(urlstring.hasprefix("")){ returnvalue = true } return returnvalue }
in info.plist
<key>cfbundleurltypes</key> <array> <dict> <key>cfbundleurlname</key> <string>co.example.exampleapp</string> <key>cfbundleurlschemes</key> <array> <string>example</string> </array> </dict> </array>
but doesn't work. want app opens link send via email, has idea make work?
for future users, @isashok mentioned in comments, handleopenurl function is deprecated of ios 9.
for newer versions of ios need use following function (apple docs):
optional func application(_ app: uiapplication, open url: url, options: [uiapplicationopenurloptionskey : any] = [:]) -> bool
you'll able keep body of function same before, , work.
Comments
Post a Comment