Festify / cordova-spotify-oauth

🔐 Easy Spotify authentication for Cordova / PhoneGap apps
MIT License
16 stars 18 forks source link

Use of unresolved identifier 'SPTAuth' #18

Open MandelbrotMan opened 5 years ago

MandelbrotMan commented 5 years ago

Hello, Hows it going. I recently started getting this problem in XCode with this line of code let auth = SPTAuth.defaultInstance()! //Error = Use of unresolved identifier 'SPTAuth' this is inside the SPotifyOauthPlugin.swift file

I've tried all rebuilding the project in all the version of Xcode 9 and 10. Then I installed Xcode 8 and converted the file from swift version 2 to 3 and then installed xcode 9 again and this did not fix the issue Any idea of what it could be?

kcarwilemiller commented 4 years ago

I ran into this problem also. For me, I am running a meteor app, and the bridging header for the plugin was not being imported. If you are running a meteor app, you must edit the cordova ios project and import the bridging header.

Edit the file: [app folder]/.meteor/local/cordova-build/platforms/ios/[Project Name]/Bridging-Header.h

Add line:

import "SpotifyOAuth-Bridging-Header.h"

Then rebuild the app.

MandelbrotMan commented 4 years ago

Im using ionic but the solution translates great.

For me it was root_app_folder/platforms/ios/[Project Name]Bridging-Header.h

adding #import "SpotifyOAuth-Bridging-Header.h" and rebuilding it worked like a charm.

@kcarwilemiller you came in clutch when I needed it. Thank you!