2016-12-29 3 views
0

In iOS 10 kann ich Spotify App nicht von meiner App aus öffnen. Das funktionierte in iOS 9:iOS 10 kann spotify App nicht öffnen

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"spotify:"]]) { 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"spotify:"]]; 
} 
else { 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/spotify"]]; 
} 

Für iOS 10 I hinzugefügt:

<key>LSApplicationQueriesSchemes</key> 
    <array> 
    <string>spotify</string> 
    </array> 

Aber nichts passiert. Jeder hatte dasselbe Problem?

Antwort

1

Hinzufügen von spotify zu Ihrem LSApplicationQueriesSchemes ist in iOS 10 erforderlich, und seit Sie das getan haben, sollten Sie in der Lage sein, spotify:// Links zu öffnen. Das funktioniert für mich.

Auf meinem Gerät, spotify: und spotify:// öffnen beide die Spotify iOS App ordnungsgemäß nach dem Start (mit genau dem gleichen Code wie Sie in Ihrem ersten Block dort geteilt).

Ich würde empfehlen, den Build-Ordner Ihres Projekts (Befehl-Umschalt-Option-K) zu bereinigen und dann die App neu zu erstellen. Es sollte einen sauberen Build sicherstellen, falls etwas schief gehen sollte, falls es zwischen den Plist-Dateien zu Verwechslungen kommen sollte oder was Sie haben.

+0

noch nicht öffnen können Spotify auf iOS 10 – Faruk

0

Ich habe das gleiche Problem, und ich versuche andere Schlüsselwort, und es ist in Ordnung.

Spotify -> spoitfyltd, https://itunes.com/apps/spotifyltd

#define SPOTIFY_URL @"https://itunes.com/apps/spotifyltd" 

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:SPOTIFY_URL]]) { 
      [[UIApplication sharedApplication]openURL:[NSURL URLWithString:SPOTIFY_URL] options:@{} 
            completionHandler:^(BOOL success) { 
            }]; 
     }