Search code examples
swiftauthenticationsdkaccess-tokenspotify

iOS Swift Spotify SDK Auth unknown error occured


I really have no idea more. I read Spotify guide, I read various articles, I watched videos on YouTube, I even launched other people’s projects - authorization fails everywhere. Spotify opens, shows "X" and then in the logs I see "An unknown error has occurred"
I tried logging in like this:

appRemote.authorizeAndPlayURI("")
// I also tried this
sessionManager.initiateSession(with: scopes, options: .clientOnly)

but the result is the same everywhere
my info.plist is correct and Spotify Dashboard App is configured correctly (bundle ID and Redirect URI are correct)

info.plist

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>spotify</string>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>com.blaBlaBla.blaBlaBla</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>blaBlaBla</string>
        </array>
    </dict>
</array>

Where is my mistake and how i can fix that? Thank you for any suggest
UPDATE: I also added my Spotify account to users list for auth in development mode. But still no results


Solution

  • ok, i found a solution
    in the Spotify Dashboard when you setup ur app you should add Redirect URIs
    and all URIs should be end with / sign. For ex:

    myAppName://auth-login-callback/
    myAppName://some-action-callback/