Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Error Domain=com.spotify.sdk.login Code=1 "(null)"

Open
#445 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
ios, objective-c, swift

Research direction

Start by tracing sessionManager.initiateSession(with:options:campaign:) through the Spotify iOS SDK to the ASWebAuthenticationSession call. Check how the presentation context is supplied and how the underlying AuthenticationServices error is handled. Done should mean the reported login failure is diagnosable and the authentication session has the required presentation context.

Written by the indexing model from the issue text.

Description

Took a bit of Swizzling, but I was finally able to transform Error Domain=com.spotify.sdk.login Code=1 "(null)" which occurs when trying to run the following:

let requestedScopes: SPTScope = [.userReadCurrentlyPlaying, .appRemoteControl]
sessionManager.initiateSession(with: requestedScopes, options: .default, campaign: nil)

Into the underlying error message that is being thrown by ASWebAuthenticationSession but then eaten by the Spotify SDK in this stack trace:

Screenshot 2024-11-10 at 8 15 47 PM
Error Domain=com.apple.AuthenticationServices.WebAuthenticationSession Code=2 "Cannot start ASWebAuthenticationSession without providing presentation context. Set presentationContextProvider before calling -start." UserInfo={NSDebugDescription=Cannot start ASWebAuthenticationSession without providing presentation context. Set presentationContextProvider before calling -start.}

I suspect that earlier on in the logic there's somewhere that's failing to determine that Spotify is installed and falling back to AuthenticationServices as a result. I'm currently looking to see if there's any way to hotfix the SDK to allow injection of an ASPresentationAnchor into the ASWebAuthenticationSession's instance.

Dominant language
Objective-C
Stars
749
Forks
206
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spotify/ios-sdk

All issues in spotify/ios-sdk

Similar issues

More Objective-C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.