Did Facebook break UIActivityViewController on iOS with its latest app update? - ios

Two observations:
One
It appears that for your app to use Share Sheets (aka UIActivityViewController), you now have to provide either:
An NSURL as one of the ActivityItems, or
A UIActivityItemProvider where the call to super initWithPlaceholderItem: must take an NSURL as an argument
You used to be able to share with plain ole NSStrings
Two
There appears to be no way to share text to Facebook via the UIActivityViewController as of the latest update. Text is stripped away.
--
Are others running into this or is it just me? You used to be able to share text to Facebook... this literally just changed.
How can I share text to Facebook from a UIActivityViewController?

(First of all sorry for the bad english !)
I encountered the exact same problem and my researches had lead me to that explanation :
The last Facebook app version must come with an implementation of an app extension.
Therefore, when the app is installed, the extension takeover the Apple "native" facebook share, refusing all kind of share but url share.
That's why you can share text when fb app is not installed (fb icon is visible), but you can't when fb app is present (fb icon is not even visible).
You can see it if you try to track the activity type :
When fb app is not installed, activity type is UIActivityTypePostToFacebook (which Apple SDK native tool)
When fb app is installed, activity type become com.facebook.share (or something like that)
I don't know if Facebook planned to "correct" that but they had always made clear that automatic text should not be added to user's post (that's what they do on Android).
I think we will have to live with it.

Related

Safari share extension - App only appears in share menu after second attempt onwards since iOS 14

Our app relies on the use of Safari share extension. Like many others have reported before me, since upgrading to iOS 14 the app no longer appears in the share menu on first attempt. Only on second attempt onwards does it appear in the share extension. It was not an issue before iOS14.
We're noticing that some apps always appear on first share, eg AirDrop, Messages, Mail, WhatsApp, Messenger, Facebook, Gmail, Slack, Pinterest. While others (including ours) only show up after second attempt onwards, eg Zoom, Skype, LinkedIn, Notes, Reminders.
We have heard rumours that it might be possible to overcome due to some weirdness, such as a combination of content types supported: like Text, WebURL and WebPage during page load (https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/AppExtensionKeys.html#//apple_ref/doc/uid/TP40014212-SW2).
So far we have been experimenting with the NSExtensionActivationRules trying to find any combination of extension keys that will cause the app to appear in the share sheet on first attempt, but without luck.
Does anyone have any ideas what else might be worth trying? Any input is appreciated.
Thanks in advance!

Is it possible to get info on other installed iOS apps?

Is it possible to read the contents of another application installed on an iPhone? What about from an extension or keyboard?
I'm trying to come up with something that 'checks' other apps to see if they have any deep links (like Twitter's Twitter://timeline that takes users straight to the timeline in the Twitter app).
Is there any smart way to check a given app for deep links?
Is it even possible to peek at another app's contents from within my app? I suspect no.
If no, what about making a keyboard or extension of some sort that I can access from an app like Twitter and see its contents, such as a URL deep link?
You don't have much options, you may use -canOpenURL:, but, since iOS9, must include special credentails listing all the custom schemes you want to check.
You can't read other app's contents on a non-rooted device unless this app is sharing a keychain (so it can exchange data via the shared keychain). The same thing goes with extensions.
iOS has some high bars on security, so, don't expect much or even, anything.
Something you may want is IntentKit. Also there are ideas around the web about standard url query format like MobileDeepLinking.

Facebook Messenger App Link [iOS]

I'm creating an iOS application where I'd like to integrate Facebook Messenger for users to message each other. I've tried deeplinking via fb-messenger://user-thread/{user-id}, which works as intended. When I open the URL via my app, it switches over to Facebook Messenger. However, as this type of link seems undocumented by Facebook, I'd rather not risk using it as they might change it at any given time.
I've then looked into Facebook App Links, but as they're very few examples of how to actually use it, I'm not completely sure how to use it for a simple case of switching from my own app to messenger with a user-id as a parameter.
Any comments on this matter will be much appreciated.

Display all the apps that support sending messages (Chatting)

I want display all the apps in my app that support chatting. Actually I need to send the selected text via message applications (i.e., WhatsApp, WeChat, etc..) those are installed in my iOS device.
I have gone through UIDocumentInteractionController but it allow to share files only. But here in my case I want to share just text.
Is this possible. Please help me out, thanks.
iOS does not have a single option for sharing text, the UIActivityViewController can be used and will show the iOS integrated social networks.
You will be able to add you own service to this dialog, as long a the app has a URL scheme to support its.
A example of a Whatsapp UIActivity: https://github.com/jberlana/JBWhatsAppActivity
If you know the URL schemes (if the chatting app provides one) of the app, you can check if a app exists or not using -canOpenURL: of UIApplication class. If they support url schemes, you can send text in the format that those app supports.

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