Recently there is a demand, is another application a need to jump to our B (set URL schemes) to do some operations and then return to a, in return, we need a set a URL schemes to let B jump to return to a within.
But after a jump to B, when B found that a does not have its own URL schemes pass, B is dumbfounded, b how to go back, of course, after the return of the iOS9 back without doing processing, then 9 of the following version, this time in a jump to B before, you need to determine whether a is set The corresponding URL schemes, not set to not let jump.
But the question comes, how can I tell if a is set URL schemes? When I encountered this problem, the first reaction is to Google search answers, but this problem is not how good description, can not find the answer, finally went to StackOverflow asked, the whole of the afternoon has not found the answer.
When I woke up early today, I had seen the code to go back to the current system version of the search code:
nsdictionary* infodict =[[nsbundle Mainbundle] infodictionary]; nsstring* versionnum =[infodict objectforkey:@ "Cfbundleversion"]; Nsstring*appname =[infodict objectforkey:@ "Cfbundledisplayname"]; Nsstring*text =[nsstring stringwithformat:@ "%@%@", Appname,versionnum];
Infodict seems to be the entire program configuration file taken out of the dictionary, can't help printing out. What did you find out?
<key>CFBundleURLTypes</key><array><dict><key>CFBundleTypeRole</key>< string>editor</string><key>cfbundleurlschemes</key><array><string>aaa123</ String></array></dict></array>
There's my own URL Schems set in the app, and then it's taken out directly to solve the problem.
The solution to this problem gave me another way of thinking, in the face of an impossible problem, in addition to the search should also think about a solution, although it may be painful, but must try.
This article is from the "Yunsankai" blog, make sure to keep this source http://yunsankai.blog.51cto.com/8376120/1707165
iOS determines if a URL is set within the app schemes