@42techpacks/expo-spotify-sdk
Version:
Expo Module for native Spotify SDK
28 lines (27 loc) • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withSpotifySdkConfig = void 0;
const withSpotifyAndroidAppBuildGradle_1 = require("./android/withSpotifyAndroidAppBuildGradle");
const withSpotifyConfigValues_1 = require("./ios/withSpotifyConfigValues");
const withSpotifyQueryScheme_1 = require("./ios/withSpotifyQueryScheme");
const withSpotifyURLScheme_1 = require("./ios/withSpotifyURLScheme");
const withSpotifySdkConfig = (config, spotifyConfig) => {
if (!spotifyConfig.host) {
throw new Error("Missing required Spotify config value: host");
}
if (!spotifyConfig.scheme) {
throw new Error("Missing required Spotify config value: scheme");
}
if (!spotifyConfig.clientID) {
throw new Error("Missing required Spotify config value: clientID");
}
// Android specific
config = (0, withSpotifyAndroidAppBuildGradle_1.withSpotifyAndroidAppBuildGradle)(config, spotifyConfig);
// iOS specific
config = (0, withSpotifyConfigValues_1.withSpotifyConfigValues)(config, spotifyConfig);
config = (0, withSpotifyQueryScheme_1.withSpotifyQueryScheme)(config, spotifyConfig);
config = (0, withSpotifyURLScheme_1.withSpotifyURLScheme)(config, spotifyConfig);
return config;
};
exports.withSpotifySdkConfig = withSpotifySdkConfig;
exports.default = exports.withSpotifySdkConfig;