Sign up for your app to iOS

Source: Internet
Author: User

Registering your app with iOS will use the features in the iOS documentation, and we'll register our program to handle our own special document types.

First, we'll set up document types in the Info.plist file.

<key>CFBundleDocumentTypes</key><array><dict><key>CFBundleTypeName</key> <string>myapp</string><key>LSHandlerRank</key><string>Default</string>< Key>lsitemcontenttypes</key><array><string>com.customapp.myapp</string></array ></dict></array>

Property Description:

Cfbundletypename: Document type name, here I will share the file compression package into *.myapp format

Lshandlerrank: This refers to whether you have a subdocument, and here I set the default

Lsitemcontenttypes: Fill in your app's bundle identifier here

Then we define the UTI:

<key>utexportedtypedeclarations</key><array><dict><key>uttypeconformsto</key ><array><string></string></array><key>uttypeidentifier</key><string >com.customApp.myApp</string><key>UTTypeTagSpecification</key><dict><key> Public.filename-extension</key><string>myapp</string></dict></dict></array >
Uttypeidentifier: Fill in your app'sBundle Identifier

Public.filename-extension: Fill in the extension of your compressed package here.

OK, now our app will appear in the list of open ways. Know how to register, then how to handle the obtained file? Quite simply, in the -application:didfinishlaunchingwithoptions: method, add the following code:

Nsurl *url = (Nsurl *) [launchoptions Valueforkey:uiapplicationlaunchoptionsurlkey];
This URL is the URL to the file you received. Now you can easily handle your own custom type files in your own app.

Resources:

Email Tutorial for Ios:how to Import and Export app Data Via Mail in your IOS app

How does I associate file types with an IPhone application?

Sign up for your app to iOS

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.