Cocoa Touch Framework - Parent App communication - ios

I am building a cocoa touch framework to provide users with services like Login with my app. This framework will be used by all third party apps and use service like Login (Yes indeed like Facebook Framework)
Project overview:
An application (Let's call 'Parent App') written using swift, offers service like Login.
A cocoa touch framework written using swift, invokes parent app to use Login service.
Only requirement is when my parent app logout all the third party app (integrated framework) using login service should logout.
Options:
Option 1: How can I trigger notification from parent app to all third party apps that integrated the framework?
Option 2: How can I share data (Login Status) between my parent app to framework, so when the third party app is launched, I can read the data stored in it?
PS: As I cannot specify the Entitlements to framework and third party apps(which will be developed by some other developer), I believe I cannot share keychain / user defaults. And URL schema cannot be used to share the data as it launches the third party apps.
Do you think I have any other options to handle this?

As per iOS 8.3 we dont have any thing to handle this. Unless user experience is compromised by URL Schema method.
May be in future... iOS 9?

Related

Opening IOS application via link in browser

For my web application i use: location.href = "market://launch?id=" + incoming_obj; to open an android app or go to android store.
Is there also kind of an action like this for IOS?
If i use the following: location.href = "https://apps.apple.com/nl/app/ns/id" + incoming_obj; than it just opens the Apple store where you can click open on the app.
In order to pass the incoming object to the app in a way that the passed data would be accessible to your code upon fresh install, you should implement Universal Deep Linking.
Some developers prefer to use 3rd party services such as Branch.io in order to manage this, because Universal Deep Linking requires some configuration on the server side, and it sometimes easier to delegate this to a 3rd party.
See https://developer.apple.com/ios/universal-links/

swift - how call app's code from another app and return data

I need to implement next scheme:
1) App1 has some UI like signin/signup, and user's profile. But main functionality is creating specific http request to get/update token.
2)when tapping button at App2 - App2 calls App1, then App1 execute only http request, and return token to App2, like callback. And this actions should be invisible for user, maybe like empty screen with spinner
What is the best way to make it real? Is it possible for iOS?
To share data between apps I suppose use App Group and shared UserDefaults, but how to call some class/function?
iOS is extremely strict as far as inter-app communication. While this is for the safety of their users, it can be extremely annoying for developers.
I'd recommend using x-callback-url for this, if you own both of the apps you're trying to communicate with.
x-callback-url website: http://x-callback-url.com/
Apple Developer website: https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app
Unfortunately for your uses, this will throw your user into the other app, which will be visible to the user for a short amount of time.
That's the only way to directly interface with other apps on the system.
some addition to #hobbsome answer
here is some useful info
and here is sample project with two apps, that communicate in-two-direction using x-callback-url protocol
you can parse your link at AppDelegate class, then redirect to ViewController and update its UI - check this answer

Integrating Password Manager Into iPhone App

I've noticed a few iPhone apps have started to allow you to use your password manager to sign in. Slack is an example of this:
It looks like there's a link that's triggering a partial version of the share toolbar in Safari which lets you access your favourite password manager's widget. That's all I've been able to figure out so far though.
My question is, how have they got this functionality into their app? I'm primarily developing things using React Native, but if it needs a custom component then that's not a problem.
This is now supported natively by iOS 12+ (and by react-native 0.60+) without the need for an extension.
Documentation for enabling it on iOS is located here on Apple's site.
TLDR is to set the UITextContentType values of .username and .password for your inputs and, optionally, add an associated domain entitlement so your app can share passwords with your website.
The prop for enabling it in React Native is documented here. TLDR there is to provide an autoCompleteType on your TextInput component. The two OSes should handle that properly, though again you will have to add an associated domain if you want to share passwords between your website and app.
You can take a look at generic-password-app-extension which gives you access to password managers. It's provided by the creators of Last Password and 1Password.
You'll obviously need to wrap it with a native component so you can trigger it from your JS code.

Inter-App Communication to annotate documents in iOS

I have a customer with an Android app which he wants to be built in iOS. The android app has a feature in which the user can annotate documents. To achieve this the Parent app passes control to a third party Document annotation app, say Adobe reader for example where user annotates the documents and once he is done the control as well as the document is passed back to the Parent app. Is there any way i can achieve the same in iOS i.e pass control to a third party app to annotate documents from within my iOS App.
I have read about URL schemes but that requires the third party app to make changes in their code which i dnt think anybody will agree to. So is there any other way?
I researched all sorts of stuff. So finally the answer is NO.This can't be done in iOS without the third party app making changes in their Appdelegate file to handle the passed URL through URL schemes.

How to share a link from the app using other applications

I want to share a link from my app using other applications installed on my iPhone such as Gmail, Facebook, DropBox, WhatsApp etc. In android there is a straight way to do so, just fire an intent and it automatically shows the installed apps through which we can share whatever we want. Is there any such way in iPhone ?
Thanks!
On iOS , app is more separated from each other. The only way to pass data from one app to other is using the URL mechanism. As one example, an app register url scheme "open-me://",you invoked openURL with "open-me://my-link" then that app will launched. That app will define the detail of the URL so it could understand the content.Continue with the example we are using, the text you passed could be either "open-me://A?data=my-link" or "open-me://A?message=my-link". So there are no general solution for all apps.Typically third party app will provide a SDK to make these things easy.
If you don't mind using a kind of large third party library, ShareKit is a good choice. It supports quite some apps.
If you want to know more about this topic,for example sharing files between app. You could start from reading the class reference of UIDocumentInteractionController.This UI component will show a list of app installed on your device which support the URL scheme.

Resources