问题
I would like to ask for clarification about Twitter sharing in iOS 11 onwards.
The official Apple documentation states in the release notes the following:
Social accounts have been removed from Settings in iOS 11. Third-party apps no longer have access to those signed-in accounts. (31687059)
And the official Twitter documentation here states that:
iOS 11 no longer supports using Twitter through the built-in social framework. Instead, you can use Twitter Kit 3 to Tweet, log in users, and use the Twitter API.
I'm having a bit of a hard time trying to understand how this changes affects sharing from apps.
Currently, using the "Social" Framework, one could simply use SLComposeViewController to easily share through several services.
With this change it seems SLComposeViewController can STILL be used as long as the user has the corresponding app installed, since THAT app will show it's own share sheet automatically. But if the app is not installed, it will just silently fail (based on my experiments).
*Currently the twitter one is showing a "No Twitter Account" alert message, but I believe this is a bug.
If the correct behavior is the one described above, then my understanding is correct. However, the twitter documentation makes it sound as if the Social framework will just not work for twitter anymore.
Additionally, "SLServiceTypeTwitter" is now shown as deprecated, meaning it's a bad idea to keep relying on it. https://developer.apple.com/documentation/social/slservicetypetwitter
Could someone clarify this for me?
PD: I'm sure this applies to other social services as well.
回答1:
The people from twitter answered my question. It seems to be a bug right now:
https://twittercommunity.com/t/bug-in-ios-11/91490
However, it's still unconfirmed if this will be the default behavior for iOS 11.
EDIT:
The issue was fixed in version Twitter.app (7.7.2)
EDIT 2:
For clarification, this behavior should no longer occur if the user has the Twitter.app (version 7.72 and up) installed, since the sharing window is actually provided by the Twitter app. (Same as Facebook sharing)
来源:https://stackoverflow.com/questions/45450300/twitter-sharing-in-ios-11