touren / twitter-kit-ios

Twitter Kit is a native SDK to include Twitter content inside mobile apps.
Apache License 2.0
110 stars 80 forks source link

Fix - webview is shown after cancellation from the app. #13

Closed fxsalazar closed 4 years ago

fxsalazar commented 4 years ago

Problem

When trying to login with the app and just cancelling it, the library bypass the cancellation, treating the action as if the application doesn't exist.

Solution Pass the cancellation "error" to the consumer.

Describe the modifications you've done. Assume that a valid callback url (^twitterkit-.*:\/\/) is a proper response from the app.

Result Now processRedirectURL is reached with this empty url and a mobileSSOCancelError is sent to the completion handler.

xzwgithub commented 4 years ago

@fxsalazar Below IOS 13 system,opened web TW Login after authorize of naive TW Login, IOS 13 system and above will not cause this problem.Can you look at it for me ?? How to modify the source code of Twitter ?

fxsalazar commented 4 years ago

Normally, this fix the issue of opening the webview in any ios version; I only tested it under ios 13. But until it's not merged you cannot use it. You can try with my fork:

pubspec.yaml

 flutter_twitter_login:
    git:
      url: git://github.com/fxsalazar/flutter_twitter_login.git
      ref: dev_local

Setup the cocopod repo:

pod repo add twitterkit5 https://github.com/fxsalazar/twitter-kit-ios.git
cd ~/.cocoapods/repos/twitterkit5
git checkout --track origin/specs
// just to check if everything is good
pod repo lint .
pod repo update

Add on the source on the Podfile:

source 'https://github.com/fxsalazar/twitter-kit-ios.git'

Let me know if it works.

touren commented 4 years ago

Thank you guys for fixing this.

fxsalazar commented 4 years ago

@touren No pb. Have you considered creating a Changelog to follow the changes and updates when releasing new versions?