title: Xcode 7 + canOpenURL, how to have Facebook and Twitter to open my own app links
body: <p>Before Xcode 7, it was working fine. When I post link like "myapp://mylink?id=1" on Facebook and Twitter for social media sharing, the users can click on it and it will open my own iOS app if it is installed. I know xcode 7 put limit of 50 url schemes that any app can ask "canOpenUrl" before actually proceeding with "openUrl". Apparently Facebook and Twitter both still checking canOpenUrl before opening the link (they open in a UIWebView inside their apps), and since they can't add all the world's apps' custom url schemes into their app plist because of the 50 limit, my app now can't be opened from FB and Twitter with my custom url scheme. Log shows following on the console:</p>
  
  <pre><code>Twitter[827] &lt;Warning&gt;: -canOpenURL: failed for URL: "myapp://mylink?id=1" - 
  error: "This app is not allowed to query for scheme myapp"
  </code></pre>
  
  <p><strong>Now the question is, is there any way I can have it working like before, where users can click on some link (myapp://mylink?id=1) on FB and Twitter, then that opens my own app through custom url scheme?</strong> </p>
  
  <p>FYI, I actually post link like <a href="http://myweb.com/link?id=1" rel="nofollow">http://myweb.com/link?id=1</a> on those sites, and the link is processed on my webserver based on the HTTP header request to decide to redirect to actual web, or if iOS then redirect to myapp://mylink?id=1, and if Android then redirect to another url scheme for android app etc. I tested with just posting myapp://mylink?id=1 link directly on Facebook and Twitter, and it's still not working giving same error. </p>
  
  <p><strong>Add on:</strong>
  The iOS9 new rules is that you need to add following, up to 50 of them, to your app plist so that your app can query the OS for canOpenURL, but it also renders unusable for big apps like FB &amp; Twitter:</p>
  
  <pre><code>&lt;key&gt;LSApplicationQueriesSchemes&lt;/key&gt;
  &lt;array&gt;
      &lt;string&gt;myapp-custom-url-scheme&lt;/string&gt;
  &lt;/array&gt;
  </code></pre>
  
  <p>To me from my reading around researching this issue, the solution is:</p>
  
  <ol>
  <li>either Apple should change this restriction to more rate limit based, so that abusing apps (like Amazon something) wouldn't use it to scan for all known url schemes to build statistics of app installs, </li>
  <li>or Facebook and Twitter etc big social media sites should stop checking canOpenURL, and just go ahead and openURL without verifying.</li>
  <li>or even better, we should build some centralized database for custom URL scheme name spaces, and both iOS and the other apps should use it for this kind of general purposes.</li>
  </ol>