Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load with capacitor #36

Open
rfrancesca12 opened this issue Dec 2, 2020 · 3 comments
Open

Failed to load with capacitor #36

rfrancesca12 opened this issue Dec 2, 2020 · 3 comments

Comments

@rfrancesca12
Copy link

Has anyone tried and installed it with Ionic Capacitor? I'm trying to open it on ios, but it gives me this error
no such file or directory, stat '/Users/user/ionic/suggestion/node_modules/cordova-spotify-oauth/src/ios/spotify-sdk/SpotifyAuthentication.framework'

Any suggestions? Thanks!

@tobika
Copy link
Contributor

tobika commented Dec 4, 2020

I did but only for android.Did you add the SpotifyAuthentication.framework by hand in xcode? I guess you can download it directly at spotify

@ConnorsApps
Copy link

ConnorsApps commented Jan 5, 2021

A rough work around I've found is to use a in app browser instead of this framework for capacitor. Use the old "InAppBrowser".

    const authUrl = `https://accounts.spotify.com/authorize?response_type=code&client_id=${SPOTIFY_CLIENT_ID}${
        USER_SCOPES ? '&scope=' + encodeURIComponent(USER_SCOPES) : ''
      }&redirect_uri=${encodeURIComponent(SET_TOKEN_URL)}`;

      const browser = this.iab.create(authUrl, '_blank'); // _system has issues
      browser.show();
      browser.on('loadstart').subscribe((loadstart) => {
        const code = this.getUserAndCodeFromHref(loadstart.url);
        if (code) {
          console.log('code', code);
          this.setUserAuthCode(code);
          browser.close();
        } else if (loadstart.url.includes('?error=access_denied')) {
          browser.close();
          throw new Error('Access Denied');
        }
      });

@jcesarmobile
Copy link

They fixed this issue, but they have not released the fix in npm

try installing the plugin like this npm install github:Festify/cordova-spotify-oauth or npm install https://github.com/Festify/cordova-spotify-oauth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants