iOS Development Those things (iii) external notifications

Source: Internet
Author: User

I. External notification usage Scenario : If you want to share a product with a friend on a treasure, you want to share the URL of the item to your friends. Then your friends click on this URL, if in the case of a treasure, the iphone will automatically jump to a treasure

Two. Implementation steps :

    • Custom URL pattern
    • Responding to URL requests

three. Demo:

    1. The info.plist of the project is added as follows:

? (P.S attention level)

  Now you get the custom URL pattern. You can open your app by calling cornordemo://*********

  2. Responding to URL requests

APPDELEGATE.M in the -(BOOL) application: OpenURL: sourceapplication: Annotation: Custom response code in:

-(BOOL) Application: (UIApplication *) application                *) URL   *) sourceapplication            annotation: (id) annotation {    if ([[URL host] isequaltostring:@ "  Xxxxxxxxxx"])  {
Can pass information }
return YES;

Four. Summary :

    • By using a custom URL pattern, you can provide other apps with the ability to launch the app. You can also pass information through a string query in a URL

iOS Development Those things (iii) external notifications

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.