Closed Kyome22 closed 3 years ago
Hi there, thanks for the PR. I just quickly looked at it and there seems like quite a bit of code duplication and I wonder if there's a cleaner way to support these authentication methods across different platforms.
@meteochu Thank you for looking at my request. I think so too. There is much code duplication. However, because of the complexity of the conditional branching by platform and their OS versions, it is difficult for me to determine the extent to be solved at once.
By the way, do you think we should support ASWebAuthenticationSession to iOS with this pull request? I think we should do it as soon as possible according to apple's references.
I've actually not looked at ASWebAuthenticationSession in the past. I just gave it a quick glance and it does seem quite promising. That said, I think this could be part of a big clean-up in the project that potentially supports Twitter API v2, as well as making this the default authentication to remove friction with the callbacks and to better support SwiftUI.
I don't really have the time just yet to look at all of it but am happy to explore at some point.
@meteochu I've improved it to support iOS. I checked its operation used the keys of my Twitter client app. The program seems to work properly on both iOS and macOS. I tried to reduce code duplication. How about that? I want you to merge if you like this.
@meteochu Thank you for reviewing. How about my updates?
Sorry about the delay, got a bit busy wrapping up my academics. The rest of the changes look good to me, once you apply the last change (revert the version change), I'll be happy to merge it :)
I implemented to solve this issue https://github.com/mattdonnelly/Swifter/issues/334 I also updated the SwifterDemoMac.