The relationship between two applications

Is it possible to establish a connection between two different applications: one running in the background, and the other in the foreground? If so, can anyone suggest how?

+6
source share
2 answers

Yes A connection can be made between two applications on an iPhone, but is limited to several scenarios.

  • There may be applications that need to be sent to the background image in accordance with some events, such as phonecall, etc. In such cases, you will have to set up your audio session (Voip-based application) and send a notification accordingly.

  • The previous example is just interaction between applications with less flexibility (sending an application to a background image for some important embedded event). Another way to do this is through URL schemes, the apple has built-in functions and support for some applications, such as mail.tel, etc. But one of the applications will come to the fore.

How can you call the phone number that is built into the application using: -

NSString *phURL= [NSString stringWithFormat:@"tel:%@", [NSString StringWithString:@"1-800-555-1212"]]; NSURL *phoneURL = [NSURL URLWithString:phURL]; [[UIApplication sharedApplication] openURL:phoneURL]]; 

By the way, tell me if you need to implement Custom URL schemes .. with pleasure.

  1. Another way is the UIDocumentInteractionController , which provides in-app support for interacting between specific files (Sandbox prevents full access or even access that can modify the data of another application). How can it be used to preview files in an email application or to download attachments. But you cannot change them for another application, of course, you can copy it and change it for your application.
+5
source

I do not think that this is exactly what you want, but it will definitely allow you to interact between applications.

https://developer.apple.com/library/IOs/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW18

It is simply used by URL schemes to activate a command and open in another application. Just try to avoid using Apple's default settings for your own application.

+1
source

Source: https://habr.com/ru/post/915843/


All Articles