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

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

Merged
merged 3 commits into from
May 16, 2020

Conversation

fxsalazar
Copy link

@fxsalazar fxsalazar commented Mar 7, 2020

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.

@fxsalazar fxsalazar changed the title Fix/cancel from app Fix - webview is shown after cancellation from the app. Mar 7, 2020
Copy link

@HackingGate HackingGate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@touren This should be merged.

@xzwgithub
Copy link

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

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 touren merged commit baac2e3 into touren:master May 16, 2020
@touren
Copy link
Owner

touren commented May 16, 2020

Thank you guys for fixing this.

@fxsalazar
Copy link
Author

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

@fxsalazar fxsalazar deleted the fix/cancel_from_app branch May 20, 2020 11:16
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 this pull request may close these issues.

None yet

4 participants