ios-sdk icon indicating copy to clipboard operation
ios-sdk copied to clipboard

iOS 18 `authorizeAndPlayURI` broken

Open PhilipTrauner opened this issue 5 months ago • 0 comments

authorizeAndPlayURI internally uses UIApplication.openURL(_ url: URL) -> Bool. While this method has been soft-deprecated for a while now, that appears to have changed in iOS 18.

BUG IN CLIENT OF UIKIT: The caller of UIApplication.openURL(_:) needs to migrate to the non-deprecated UIApplication.open(_:options:completionHandler:). Force returning false (NO).

SPTSessionManager.initiateSession does not appear to be affected.

Workaround

This is the structure of the URL that authorizeAndPlayURI attempts to open:

when not playing as radio
spotify-action://authorize?response_type=token&client_id=<client-id>&redirect_uri=<redirect-uri>&play_uri=<play-uri>&bundle_id=<bundle-id>&minimum_version&analytics_id&remote_session_id=<remote-session-id>&scope=app-remote-control
when playing as radio
spotify-action://authorize?response_type=token&client_id=<client-id>&redirect_uri=<redirect-uri>&play_uri=<play-uri>&bundle_id=<bundle-id>&minimum_version&analytics_id&remote_session_id=<remote-session-id>&play_radio=true&scope=app-remote-control

remote_session_id is optional, and play_uri can be an empty string (play_uri=)

PhilipTrauner avatar Sep 23 '24 13:09 PhilipTrauner