在auth结果上关闭弹出浏览器

时间:2017-07-05 21:34:20

标签: cordova ionic-framework spotify

我正在使用Ionic,我正在尝试使用Spotify进行身份验证。当用户单击“使用Spotify登录”时,我会显示身份验证屏幕,但是当他们在登录屏幕上单击“连接”时,弹出浏览器未关闭。我设置了深层链接,我正在使用它作为我的重定向uri,控制台记录它是成功但没有任何反应。

这是我的离子信息:

global packages:

@ionic/cli-utils : 1.4.0
Ionic CLI        : 3.4.0

System:

Node       : v8.1.2
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.4

当我点击Spotify弹出屏幕上的“连接”时,控制台显示:

enter image description here

但弹出窗口永远不会关闭,我正在使用的承诺永远不会被返回。这是代码:

// This is in my Spotify service
connect(): Promise<any> {

     return this.spotify.authenticate(this.options)

}

// This is on my home page (it's what's called when you click "Login with Spotify"
spotifyConnect() {

    this._spotifyService.connect().then(

      result => console.log('hi!', result) //this is never returned
    );

}

我的重定向uri是turn://app/home,我的deeplinks配置如下所示:

this._deepLinks.routeWithNavController(this.navChild, {
    '/': HomePage,
    '/home/:results': HomePage,
    '/playlist-find': 'playlist-find'
  }).subscribe((match) => {
    console.log('Successfully routed', match);
  }, (nomatch) => {
    console.log('Unmatched Route', nomatch);
  });

我已尝试将重定向uri设置为window.location.href但只是在弹出式浏览器中打开应用程序。

谢谢!

0 个答案:

没有答案
相关问题