Configure Android linking and Auth Callback
masterIf autolinking fails on Android, follow these manual steps:
1. Manual Linking
- MainApplication.java: Add
import com.reactlibrary.RNSpotifyRemotePackage;and addpackages.add(new RNSpotifyRemotePackage());to thegetPackages()method. - settings.gradle: Append:
include ':react-native-spotify-remote' project(':react-native-spotify-remote').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spotify-remote/android') - app/build.gradle: Add
implementation project(':react-native-spotify-remote')to thedependenciesblock.
2. Auth Callback Configuration
In android/app/src/main/AndroidManifest.xml, add the following activities inside the <application> tag:
<activity
android:exported="true"
android:name="com.spotify.sdk.android.authentication.AuthCallbackActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="<YOUR_APPLICATION_SCHEME>"
android:host="<YOUR_APPLICATION_CALLBACK>"/>
</intent-filter>
</activity>
<activity
android:name="com.spotify.sdk.android.authentication.LoginActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
</activity>Note: Replace <YOUR_APPLICATION_SCHEME> and <YOUR_APPLICATION_CALLBACK> with your actual Spotify app credentials.