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:
- 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