Hi,
I’m using TwitterKit to authenticate my mobile app with Twitter. I do this to get the user’s tokens so they can send Tweets from within the app. TwitterKit works great on Android. But not on iOS, because TwitterKit users UIWebView the iOS build gets rejected by Apple.
Here is TwitterKit → Twitter Kit for Unity | Integration | Unity Asset Store
I’m not an iOS developer. I have found solutions but I believe I need to setup the Unity project to install cocoapods (and this also has to work in Unity Cloud Build)
I’ve tried this solution → GitHub - touren/twitter-kit-ios: Twitter Kit is a native SDK to include Twitter content inside mobile apps.
I had to update a link to a header on the C# side, but I’m getting a strange runtime image error in Xcode.
Twitter is no longer updating TwitterKit.
Does anyone have a fix for this UIWebView issue in TwitterKit?
OR, does anyone have a solution for authenticating with Twitter without using TwitterKit? Maybe loading up the Twitter mobile site in a WebView and capturing the tokens?
1 Like
There’s two problems. First, you can’t use UIWebView anymore. It’s been deprecated for quite a few years now.
But a more-pressing problem is this requirement to implement Apple sign-in:
https://developer.apple.com/app-store/review/guidelines/#sign-in-with-apple
I quote:
“Apps that use a third-party or social login service (such as Facebook Login, Google Sign-In, Sign in with Twitter, Sign In with LinkedIn, Login with Amazon, or WeChat Login) to set up or authenticate the user’s primary account with the app must also offer Sign in with Apple as an equivalent option.”
I’m led to believe it is just a basic OAuth2 setup. This should be easily within the reach of rolling something yourself with UnityWebRequest, but there’s probably existing code samples out there to start from.
Thank you. I’m trying to authenticate Twitter only for the purpose of sending Tweets, not to log into the app. At least right now. But that Apple requirement is useful, thank you for sharing.
Looking at the Twitter docs, I believe in order to send Tweets, I would have to do an OAuth 1.0a. And to do that I need to send a user to Twitter to login (either via the mobile app, or mobile website). Since TwitterKit is deprecated, it seems I have to do the website route. And either do that inside the Unity app, or send them to an external site that captures the tokens and updates the Unity mobile app.
I was hoping there was some asset of other solution out there…