In iOS, if application a wants to open application B, add the URL identifier and URL schemes fields under the URL types field to the info. plist file of Project B;
For exampleURL identifier: COM. mycompany. testapp;URL
Set schemes to launch;
In Project A, you can:
Uiapplication * APP = [uiapplicationsharedapplication];
Nsurl * url = [nsurlurlwithstring: @ "MyApp: // com. adsage"];
[App
Openurl: url];
Start application B.
In the same way, use the-(bool) canopenurl (nsurl *) of the uiapplication class *)URL
The member method can be used to determine whether application B can be started;
Uiapplication * APP = [uiapplicationsharedapplication];
Nsurl * url = [nsurlurlwithstring: @ "MyApp: // com. adsage"];
If ([App
Canopenurl: url]) {
Nslog (@ "can launch B app! ");
} Else {
Nslog (@ "can not launch B app! ");
}
If application B can be started, application B has been installed, and vice versa.
However, this method must know the URL types attribute of application B (started application.