twitter-archive / twitter-kit-ios

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

Deeplink issue on tap #92

Open tonylin75 opened 6 years ago

tonylin75 commented 6 years ago

I am showing twitter view in a cell, when I tap the twitter view, if I have the native twitter app installed on the phone, it will then show a apple native popup "'XXX App Name' wants to open 'Twitter'" with two buttons "Cancel" and "Open". The problem is, no matter which button I press, it will redirect to "Twitter" native app. Is this an issue from the SDK or my implementation? I have not implemented the delegate method: tweetView:(TWTRTweetView *)tweetView didTapTweet:(TWTRTweet *)tweet;. If I do, then the apple native pop up won't be showing.

tonylin75 commented 6 years ago

Ok, I have downloaded their source code and looking into it. And I drew a flow diagram to illustrate the issue.

image from ios 2 copy

As the diagram shows, the twitter SDK will try to call the deep link on tap first, if user taps "cancel" on the apple's default pop up, then the SDK will try the second attempt by calling universal link. This will cause the issue as I described in the question, which is even user taps on "cancel", my app still redirects to twitter app.