Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITMS-90809: Deprecated API Usage UIWebView #32

Open
niypoo opened this issue May 1, 2020 · 20 comments · May be fixed by #34
Open

ITMS-90809: Deprecated API Usage UIWebView #32

niypoo opened this issue May 1, 2020 · 20 comments · May be fixed by #34

Comments

@niypoo
Copy link

niypoo commented May 1, 2020

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.

@jferas
Copy link

jferas commented May 4, 2020

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.

@Kiruel
Copy link

Kiruel commented May 5, 2020

We need to use this on this package. twitter-archive/twitter-kit-ios#120

I will make a PR soon.

@Kiruel Kiruel linked a pull request May 5, 2020 that will close this issue
@Kiruel
Copy link

Kiruel commented May 5, 2020

@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

@jferas
Copy link

jferas commented May 5, 2020

@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!

@niypoo
Copy link
Author

niypoo commented May 5, 2020

@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
Copy link

jferas commented May 5, 2020

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

@Kiruel
Copy link

Kiruel commented May 6, 2020

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.

@niypoo
Copy link
Author

niypoo commented May 6, 2020

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

@sallypeters
Copy link

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

@Kiruel
Copy link

Kiruel commented May 26, 2020

@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>

@sallypeters
Copy link

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

@Kiruel
Copy link

Kiruel commented May 26, 2020

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.

@bpaul7101
Copy link

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

@niypoo
Copy link
Author

niypoo commented Jun 13, 2020

@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

@ssbaval
Copy link

ssbaval commented Jun 14, 2020

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 ?

@himanshu5057
Copy link

@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?

@madilsharief
Copy link

Any updated? App is not being uploaded to iOS store using this anymore and it still shows UIWebview

@mohadel92
Copy link

same problem

@mohadel92
Copy link

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 "/".'

@nihp
Copy link

nihp commented Feb 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants