I just wrote some things here, if you want to see more detailed, please click the original link.
original link: http://blog.csdn.net/likendsl/article/details/7553605 In principle, the sandbox principle of iOS is to block an app from accessing other apps ' resources or even the underlying resources of the system, but we can do this in a disguised way: through the corresponding URL pattern and other programs to communicate.steps to call between iOS apps: one, invoke your own development of the application1) in the plist file, register the external interface in Xcode group&files, expand Resources Select Info.plist Right-click the Information property list and select the URL from the list Types Right-click the Add row to append an object (item), right-click the item add row, select URL from the list schemes and then right-click Add an Object (ITEM1) to set the Item1 value to: MyApp this myapp is the external interface, other applications can pass it, Call the app plist as shown in: 2). Process URL Request application delegate inapplication:handleOpenURL:method to process URL requests that are passed to the application. If you have registered a custom URL pattern for your application, be sure to implement this method in the delegate. The following code implements this delegate method;-(BOOL) Application: (UIApplication *) application Handleopenurl: (Nsurl *) url{if ([[URL scheme] isequaltostring:@ "MyApp"]) {[Application Setapplicationiconbadgenumber:10];return YES;} return NO;} 3). Test external calls1. Go back to the home screen and launch Safari (on the iphone emulator, select the Hardware->home command on the menu to go back to the home screen). 2. In the address bar of Safari, type Url:myapp using custom mode:3. Verify that your application is started and that the application delegate received Application:handleopenurl: Message。 4) Call method in the application that you need to call above to register the external interface, add the following code can nsurl *url = [Nsurl urlwithstring:@ "MyApp:"]; [[UIApplication sharedapplication] openurl:url]; With these two steps, you can allow users to open your other apps in your app
Second, call the app that comes with iOS
This is the application that calls itself, explains how to invoke the problem between your own applications, and today introduces how to call an app that comes with iOS
First, call the App Store interface method
In the actual development, often to recommend their own other applications and recommend their own fee software, then we need to connect directly to the App store's corresponding page in the program.
The practical approach is simple, using the OpenURL method of the UIApplication class:
[[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:@ "The corresponding connection of the program]];
Ii. methods for invoking other applications
1) call to bring your own mail?
[[Uiapplicationsharedapplication] openurl:[nsurlurlwithstring:@ "Mailto://[email protected]"];
2) Call telephone phone?
[[UIApplication sharedapplication] openurl:[nsurlurlwithstring:@ "tel://8008808888"];?
3) Call SMS
? [[Uiapplicationsharedapplication] Openurl:[nsurl urlwithstring:@ "sms://800888"];?
4) Call your own browser safari
? [[Uiapplicationsharedapplication] openurl:[nsurlurlwithstring:@ "http://www.hzlzh.com"];
5) Call Remote
? [[Uiapplicationsharedapplication] Openurl:[nsurl urlwithstring:@ "REMOTE://FFF"];
The above is the most basic statement, there is no processing process.
such as: Call phone can pass the number, call SMS can only set the number, cannot initialize the SMS content.
jump between IOS appsthe recently developed program needs to be integrated into the company's SSO unified identity platform, which needs to be redirected from the app from the certification platform to the app we've developed.
Where to configure in the program below
In the plist file of the target program, modify:
Open xxxx-info.plist, add a URL types
Open the URL types and modify the item0 URL identifier to URL Schems
Expand URL schemes, modify the contents of Item0 to Xxxapp (this is the key to jump)
As shown in the following:
Where you need to jump in the program, add code
Nsurl *myurl = [Nsurl urlwithstring:@ "XXXAPP://ABCDE"]; Xxxapp key for Target app jump
if ([[[UIApplication sharedapplication] Canopenurl:myurl]) {
[[Uiappliactioin sharedapplication] openurl:myurl];
}
This allows the jump to be achieved.
iOS Jump to another program