简体   繁体   中英

How to open native iOS app (calendar, notes…) from a link on website?

Is it possible to open native iOS app, eg calendar or notes, from an HTML link which is in website? I tried to find an example but I couldn't. I ran into these URL schemes but I don't know how to use them and what's the URL scheme for calendar or notes. Is it possible just to do something like this:

<a href="calendar://something here?">Click me!</a> 

Is it possible to do it only with HTML or is JavaScript needed?

如果您正在寻找URL架构,iPhone日历是:CALSHOW:

Yes you can very well possible to do that. You're right in placing the link like this:

<a href="calendar://">Click me!</a>

Now go to your iOS app's info.plist file. In that add the following tags:

<key>CFBundleURLTypes</key>
<array>
<dict>
    <key>CFBundleURLName</key>
    <string>com.companyname.appname</string>
    <key>CFBundleURLSchemes</key>
    <array>
        <string>calendar</string>
    </array>
</dict>
</array>

Save the plist file and exit it. After this when you open the web page in Safari browser of your iOS device and click on the link, your iOS app will invoke. I hope it helps!

Calendar and Notes do not have URL schemes. Apple provides a reference for those of their apps that do use URL schemes here:

https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM