flutter_twitter_login
flutter_twitter_login copied to clipboard
ITMS-90809: Deprecated API Usage UIWebView
ITMS-90809: Deprecated API Usage - Apple will no longer accept submissions of new apps that use UIWebView as of April 30, 2020 and app updates that use UIWebView as of December 2020. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).
Is anyone can help , I think this package doesn’t have any support any more.
Did you find a resolution to this? I don't see any alternatives out there and I need this for an app I'm working on. If there are no other choices, I'll probably take on the effort of forking this repo and seeing if I can replace the UIWebView with the recommended WKWebView.
We need to use this on this package. https://github.com/twitter-archive/twitter-kit-ios/issues/120
I will make a PR soon.
@jferas Can you test it and tell me if it's work well for you ? You just need to remplace your package like this:
flutter_twitter_login:
git:
url: https://github.com/Kiruel/flutter_twitter_login
@kiruel Works great! I had just added TwitterKit5 to the podfile in a fork that I had done as a test, and it worked... then I tried yours and it also works.. and I see you did some other nice enhancements also! I've also verified that with TwitterKit5 in the pod file, my upload to the store no longer gets the "Deprecated" error.
Nice work... thanks!
@jferas Can you test it and tell me if it's work well for you ? You just need to remplace your package like this:
flutter_twitter_login: git: url: https://github.com/Kiruel/flutter_twitter_login
thanks for your great effort , let me know what's the steps I have to change to test your package
@jferas Can you test it and tell me if it's work well for you ? You just need to remplace your package like this:
flutter_twitter_login: git: url: https://github.com/Kiruel/flutter_twitter_login
thanks for your great effort , let me know what's the steps I have to change to test your package
In your pubspec.yaml file in your flutter project... change your flutter_twiter_login reference to look like the one above....
If I have more time I will probably make a new package but in kotlin/Swift with all dependency up to date. Because this package is not maintain.
If I have more time I will probably make a new package but in kotlin/Swift with all dependency up to date. Because this package is not maintain.
I hope that I saw that all twitter packages are deprecated ,
but I still test it and I facing a issue that After authorizing with Twitter, I get stranded on the following screen: "redirecting you back to the application." happened because I guess I'm using in AppDalegate.swift
import FBSDKCoreKit // <--- flutter_facebook_auth
override func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:] )
-> Bool {
ApplicationDelegate.shared.application( app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation] )
}
that handle facebookKit auth , when I remove it's working as good
@Kiruel Thanks for bringing in TwitterKit5 and removing the deprecated UIWebView.
I have an OJB-C created project - Do we need to do anything else in AppDelegate or Info.plist to have the callback work ? I get authenticated but am stuck at the 'Redirecting you back to the application' screen.
Note - everything worked with the OLD plugin (That contained the deprecated UIWebView) , so my URLSchemes and other relevant settings in info.plist have been set correctly.
@sallypeters It's work for me, maybe you have a bad setting somewhere in Twitter Developer ?
For the Info.plist do you add this ?
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>twitterkit-YOUR_TWITTER_KEY</string>
</array>
</dict>
</array>
Why array ? because I use facebook and google too. So example:
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>twitterkit-YOUR_TWITTER_KEY</string>
<string>fbYOUR_FB_KEY</string>
<string>com.googleusercontent.apps.GOOGLE_ID-GOOGLE_KEY</string>
</array>
</dict>
</array>
Hey @Kiruel , thanks for the fast response - its weird as all this working for me for all of 2019 and only now since I tried the new plugin that resolves the deprecated UIWebView I have the issue. More interesting - when I go back to using the old plugin - I now have the same issue, i.e control doesnt go back to my app ...
In Android - no issues.
Also, in iOS , I have Facebook, Google, GitHub - all work , no issues ...
So perhaps you are right, might be an issue with a setting (or not a setting) in developer.twitter.com ...
I've checked there and have privacy policy, terms of reference, and these 3 Callbacks defined (I'm authenticating against Firebase):
https://my-app.firebaseapp.com/__/auth/handler
twittersdk://
twitterkit-MY-TWITTER-KEY://
And also have
enable sign-in with twitter enabled
And ensured my firebase console for Twitter integration has the correct API KEY & SECRET defined from developer.twitter.
I also have this in my info.plist (Not changed for 12 months) :-
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>my-google-reverse-id</string>
</array>
</dict>
<!-- Facebook-->
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb-my-facebook-app-id</string>
</array>
</dict>
<!-- Twitter-->
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>twitterkit-my-twitter-key</string>
</array>
</dict>
<!-- Github-->
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>auth</string>
<key>CFBundleURLSchemes</key>
<array>
<string>my-app-scheme</string>
</array>
</dict>
</array>
I'm gonna delete podfile lock and then install pods again ... see what happens , maybe somethings got confused ..
You should use this :
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>twitterkit-YOUR_TWITTER_KEY</string>
<string>fbYOUR_FB_KEY</string>
<string>com.googleusercontent.apps.GOOGLE_ID-GOOGLE_KEY</string>
</array>
</dict>
</array>
It's more efficient.
@Kiruel @sallypeters @niypoo Did you manage to get the Plugin working on iOS with respect to control going back to your app ? I have the same issue with my objective C project - I get authenticated by cannot get back to my app to continue the login flow . Is this an iOs (info.plist) issue or a Twitter settings issue or maybe an iOS 13.4 issue ?
Does anyone have any insight into this ? It works in Android - just not iOS which is a shame as the fix by @Kiruel fixes the UIWebView deprecation ...
@Kiruel @sallypeters @niypoo Did you manage to get the Plugin working on iOS with respect to control going back to your app ? I have the same issue with my objective C project - I get authenticated by cannot get back to my app to continue the login flow . Is this an iOs (info.plist) issue or a Twitter settings issue or maybe an iOS 13.4 issue ?
Does anyone have any insight into this ? It works in Android - just not iOS which is a shame as the fix by @Kiruel fixes the UIWebView deprecation ...
You have to tell ios to manage the callback after auth , put this code in AppDelegate.
// <--- OVERRIDE THIS METHOD WITH THIS CODE
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
if url.scheme != nil {
let facebookAppId: String? = Bundle.main.object(forInfoDictionaryKey: "FacebookAppID") as? String
if facebookAppId != nil && url.scheme!.hasPrefix("fb\(facebookAppId!)") && url.host == "authorize" {
return ApplicationDelegate.shared.application(app, open: url, options: options)
} else if url.scheme!.contains("twitter") { // for login by twitter
return TWTRTwitter.sharedInstance().application(app, open: url, options: options)
}
}
return false
}
it's read FacebookAppID from info.plist
Hi @niypoo thanks for the code fragment, I'm guessing this is for a SWIFT created project - what if the project is OBJ-C created ? Also - I dont recall we had to do this previously - do you know what has changed ?
@jferas Can you test it and tell me if it's work well for you ? You just need to remplace your package like this:
flutter_twitter_login: git: url: https://github.com/Kiruel/flutter_twitter_login
This is not working any more can you please update the package?
Any updated? App is not being uploaded to iOS store using this anymore and it still shows UIWebview
same problem
You should use this :
<array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>twitterkit-YOUR_TWITTER_KEY</string> <string>fbYOUR_FB_KEY</string> <string>com.googleusercontent.apps.GOOGLE_ID-GOOGLE_KEY</string> </array> </dict> </array>
It's more efficient.
i am getting
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'The provided scheme is not valid. A scheme should not include special characters such as ":" or "/".'
I am using twitter kit. My app rejected and failed to upload to the testflight.
How can I replace the twitter it in the objective -c app.
I am not using the pod. I am using the manual linking of frameworks