iOS determines if a URL is set within the app schemes

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.