Festify / cordova-spotify-oauth

🔐 Easy Spotify authentication for Cordova / PhoneGap apps
MIT License
16 stars 18 forks source link

iOS: Removed dependency on legacy Spotify SDK #32

Closed manuelsc closed 3 years ago

manuelsc commented 3 years ago

Plugin wasn't able to compile for iOS since the Spotify SDK it relies on isn't available anymore. The new sdk appears to have changed its API but I figured there's not need to even pull in that whole sdk dependency since we only need it for the OAuth URL.

I rewrote the code to work without this dependency, it should compile and work with iOS now.

This fixes Issue #28

tobika commented 3 years ago

I'm only using the android auth part of this plugin but there is one advantage of using the sdk for authentication. If you have the Spotify app installed you don't need to enter your credentials and just click on a button to receive your token.

If I'm not mistaken with the web authentication you always have to enter your email/password.

manuelsc commented 3 years ago

I'm only using the android auth part of this plugin but there is one advantage of using the sdk for authentication. If you have the Spotify app installed you don't need to enter your credentials and just click on a button to receive your token.

If I'm not mistaken with the web authentication you always have to enter your email/password.

You are right I was thinking about that as well. But the current implementation only opens the webview on iOS as well. There appears to be a counterpart to spotifyWebAuthenticationURL namely spotifyAppAuthenticationURL that can be passed to UIApplication to open an installed Spotify app. But I don't know how this URL is constructed, maybe someone with the old spotify sdk installed can give us insight on that?

@NeoLegends I mostly work on Android which is why I'm not that fit with Swift. I'm sure there's a more idiomatic and cleaner approach. I'll try and look into the changes you suggested.

NeoLegends commented 3 years ago

@manuelsc Thank you for keeping up! Here is the link to the Documentation for the URL builder https://developer.apple.com/documentation/foundation/urlcomponents

duffdean commented 3 years ago

Is it possible to point my cordova plugins to this pull request? Or do we have to wait until the pull request is merged into the master?