2

I did a Google search for opening spotify URLs/URIs on native app, and found the following URI scheme to open the links in the native app.

spotify://spotify:artist:12Chz98pHFMPJEknJQMWvI

This above link seems to be working fine on ios devices, but i am not able to open this on android device(HTC One). Any suggestions ?

user1524625
  • 271
  • 1
  • 7
  • 19

3 Answers3

1

Have you tried entering just the spotify:artist:12Chz98pHFMPJEknJQMWvI in android. I believe the spotify:// may be directing it towards the app, but i think android directs its apps with a different command. Also, just in case it is the same for android, you need to have the app installed on your phone if you dont already have it for the directing command to work properly.

Kevin
  • 16,696
  • 7
  • 51
  • 68
Landon783
  • 11
  • 1
1

android refer this link

ios refer this link

some reference from above link

have run into a similar need in an app. My solution was to create a client that hits the Spotify API to return either XML or JSON of the search. For instance, if you want Muse, you would hit the API with the following URL:

http://ws.spotify.com/search/1/artist?q=muse

From the XML or JSON, you'll be able to extract the link to the particular artist within their URL scheme:

spotify:artist:12Chz98pHFMPJEknJQMWvI

Chop off the spotify:artist: portion and append that onto a Spotify artist link:

http://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI

Then, using the Spotify URL scheme and UIApplication, you can open the Spotify app to that particular artist's page:

[[UIApplication sharedApplication] openURL:
   [NSURL URLWithString:
       @"spotify://http://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI"]];

Note, using URL schemes to access features of another app is generally undocumented and can be a fragile endeavor. If Spotify in the future decides to change anything about this, it will break this functionality without warning.

Community
  • 1
  • 1
Yogesh Rathi
  • 6,331
  • 4
  • 51
  • 81
0

The quick fix I made was to directly call the uri with any modification on the original uri.

which is 'spotify:artist:4gzpq5DPGxSnKTe4SA8HAU' or 'spotify:track:1dNIEtp7AY3oDAKCGg2XkH'

eNeF
  • 3,241
  • 2
  • 18
  • 41