IOS app jump (IOS9 white list), iosios9
Jump to the implementation of the specified app
In IOS, app redirection is implemented through URL. Therefore, we need to set the corresponding URL before implementing app redirection.
Figure 1 (search for the configuration software URL)
Figure 2 (specific configuration options)
Note:
If the IOS version is IOS 9, we need to set a whitelist for the app.
The premise for redirection is that this app is available. Therefore, we need to run the redirected app first, that is, install it in the simulator.
3 (add in info)
Thu
Code:
/// ViewController. m // X // Created by ma c on 16/4/9. // Copyright©2016 bjsxt. all rights reserved. // # import "ViewController. h "@ interface ViewController () @ property (weak, nonatomic) IBOutlet UIButton * button; @ end @ implementation ViewController-(IBAction) GoU :( id) sender {// obtain the URl NSURL * url of the jump app = [NSURL URLWithString: @ "U: //"]; // determine whether the app if ([[UIApplication sharedApplication] canOpenURL: url]) is installed on the mobile phone {// open the application [[UIApplication sharedApplication] openURL: url] ;}}-(void) viewDidLoad {[super viewDidLoad] ;}@ end
To prove that the jump between apps is implemented: two other app storyboards are attached.
X: Figure 5
U: Figure 6
Jump to the specified page
Premise: We want to jump from X to the U circle of friends.
The Code of X is as follows:
/// ViewController. m // X // Created by ma c on 16/4/9. // Copyright©2016 bjsxt. all rights reserved. // # import "ViewController. h "@ interface ViewController () @ property (weak, nonatomic) IBOutlet UIButton * button; @ end @ implementation ViewController-(IBAction) GoU :( id) sender {// obtain the URl NSURL * url of the jump app = [NSURL URLWithString: @ "U: //"]; // determine whether the app if ([[UIApplication sharedApplication] canOpenURL: url]) is installed on the mobile phone {// open the application [[UIApplication sharedApplication] openURL: url] ;}}- (IBAction) GoFriend :( id) sender {// obtain the URl NSURL * url to jump to the circle of friends = [NSURL URLWithString: @ "U: // friend"]; // determine whether the app if ([[UIApplication sharedApplication] canOpenURL: url]) is installed on the mobile phone {// open the circle of friends [[UIApplication sharedApplication] openURL: url];} -(void) viewDidLoad {[super viewDidLoad];} @ end
We can not only set X but also U.
The Code operation on U is in Appdeledate.
The Code is as follows:
-(BOOL) application :( UIApplication *) app openURL :( NSURL *) url options :( NSDictionary <NSString *, id> *) options {// convert the url into a string NSString * urlString = url. absoluteString; // determines through which redirection is passed. if ([urlString containsString: @ "friend"]) {NSLog (@ "execute page Jump here. ");} Return YES ;}
VII.