Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Two observations:

One

It appears that for your app to use Share Sheets (aka UIActivityViewController), you now have to provide either:

  1. An NSURL as one of the ActivityItems, or
  2. 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?

like image 725
st.derrick Avatar asked Apr 29 '15 00:04

st.derrick


1 Answers

(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.

like image 99
Didier Nizard Avatar answered Sep 16 '22 11:09

Didier Nizard