0

This is the relevant portion of my code (imports, etc. not included)

import Spotify from 'react-native-spotify';

let spotifyOptions = {
    "clientID": "69708bf2b35e4cc2b208fafa600ce9a9",
    "sessionUserDefaultsKey": "SpotifySession",
    "redirectURL": "MoodMixer://auth",
    "scopes": ["user-read-private", "playlist-read", "playlist-read-private", "streaming"],
};

export default class App extends React.Component {

    render() {

            Spotify.initialize(spotifyOptions, (loggedIn, error) => {
                if (error != null) {
                    Alert.alert("ERROR", error.message);
                }
            });

I keep getting this error when I run it

Error in Expo IMAGE

2
  • import Spotify from 'react-native-spotify'; (Uppercase letter 'S') Commented Jan 6, 2018 at 19:00
  • @gokcand It still doesn’t work!! Commented Jan 6, 2018 at 19:53

1 Answer 1

0

Assuming you're using this version, you're importing it wrong according to their readme. Remove your curly braces, making it a default import. You're currently trying import a named export that doesn't exist.

import spotify from 'react-native-spotify';
Sign up to request clarification or add additional context in comments.

5 Comments

Yes. I am using that version, after i fixed the import... it still doesn’t work :(
If you installed it with npm install react-native-spotify, you're not using that version, you're using this version github.com/viestat/react-native-spotify
No I used Lufinkey’s npm install (github page)
console.log what the object is
I'm not sure how to do to that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.