Based on the needs of the project, sometimes it is necessary to directly open the client that we have developed through a link or QR code scan.
Of course. The client is not just needed to be opened, but also to jump to the corresponding page, so it is necessary to pass the parameter.
The client wants to use the link to open, must add the corresponding URL types in Info.plist:(if there is no corresponding line please add it yourself!)
After setting up this URL, we're going to respond to an event where the app is opened (linked with a URL)
So.. Go to appdelegate.m .
Implementing an Agent Approach
-(BOOL) Application: (UIApplication *) application Handleopenurl: (Nsurl *) url{ return YES;
Then we can get to the URL that opens the app with the URL from the above callback.
If you open the app with Urldemo://hehehe, the callback URL is urldemo://hehehe.
As for the argument, since this is not like HTTP can get the post or get parameters, so we have to manually parse it.
Here urldemo://hehehe We can take hehehe as the parameter body, and then do what we do ...
Ps:ios, Safari can also open this app by opening this URL.
PS2: Other applications use this method to open the application
[[uiapplication sharedapplication]openURL: [nsurl urlwithstring:@ " Urldemo://hehehe "];
PS3: No.
Open the specified app via the link address in iOS and pass the reference by Xuwenchang chess