@wwdrew/expo-spotify-sdk
Version:
Expo module wrapping the native Spotify iOS (v5) and Android (v4) SDKs for OAuth authentication and App Remote playback control
33 lines (32 loc) • 1.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withSpotifyIosPod = exports.PODFILE_SPOTIFY_IOS_POD = exports.PODFILE_SPOTIFY_IOS_TAG = void 0;
exports.applySpotifyIosPod = applySpotifyIosPod;
const config_plugins_1 = require("@expo/config-plugins");
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
exports.PODFILE_SPOTIFY_IOS_TAG = "expo-spotify-sdk-spotify-ios-pod";
/**
* Standard CocoaPods binary pod — SpotifyiOS.podspec uses `source: { http: ... }`
* so CocoaPods downloads and runs `prepare_command` (unlike `:path` pods).
*/
exports.PODFILE_SPOTIFY_IOS_POD = ` pod 'SpotifyiOS', :podspec => File.join(__dir__, '../node_modules/@wwdrew/expo-spotify-sdk/spotify-ios/SpotifyiOS.podspec')`;
function applySpotifyIosPod(podfileContents) {
const merged = (0, generateCode_1.mergeContents)({
tag: exports.PODFILE_SPOTIFY_IOS_TAG,
src: podfileContents,
newSrc: exports.PODFILE_SPOTIFY_IOS_POD,
anchor: /use_expo_modules!/,
offset: 1,
comment: "#",
});
return merged.didMerge || merged.didClear
? merged.contents
: podfileContents;
}
const withSpotifyIosPod = (config) => {
return (0, config_plugins_1.withPodfile)(config, (config) => {
config.modResults.contents = applySpotifyIosPod(config.modResults.contents);
return config;
});
};
exports.withSpotifyIosPod = withSpotifyIosPod;