Integrating Twitter feed in Spotify application not working

I’m working on a Spotify application that should show Twitter posts from the artist that’s currently playing. The app works fine when I test it in a regular web browser, but nothing shows up when I run it inside Spotify.

Here’s my manifest configuration:

{
    "BundleType": "Application",
    "AppIcon": {
        "18x18": "icon.png"
    },
    "AppName": {
        "en": "ArtistFeed"
    },
    "SupportedLanguages": [
        "en"
    ],
    "RequiredPermissions": [
        "http://twitter.com",
        "http://*.twitter.com",
        "http://*.twimg.com"
    ],
    "VendorIdentifier": "com.ArtistFeed",
    "RequiredInterface": "1",
    "BundleVersion": "1.0",
    "BundleIdentifier": "ArtistFeed",
    "AppDescription": "Shows Twitter posts from current artist."
}

And here’s the main JavaScript code:

$(document).ready(function() {
    $('#twitterFeed').twitter({from: 'example_user', replies: false});
    initializeApp();
});
<body>
    <div id="appInfo"></div>
    <div id="content"></div>
    <div id="twitterFeed"></div>
</body>

The Twitter posts display correctly in browser testing, but the Spotify app shows a blank screen. What could be causing this issue?

Yeah, this is a CORS issue. Spotify apps are way more locked down than regular browsers - they block external API calls by default. That jQuery Twitter plugin you’re using? It’s trying to hit Twitter’s servers directly, which Spotify won’t allow. I hit the same wall with Instagram feeds. Here’s what worked: set up a backend proxy that grabs the Twitter data and serves it through your own API. Then you call your server instead of Twitter directly. Also, double-check that the jQuery library is actually loading - sometimes external CDNs just fail in Spotify apps. Throw some console.log statements in there to see if your JS is even running.

Check your manifest first - Twitter permissions need HTTPS, not HTTP. Spotify sandboxes everything, so external scripts get blocked hard. That jQuery plugin probably uses JSONP or another workaround that won’t work in Spotify’s environment. Try Twitter’s official widget.js instead, or build a simple proxy server to fetch tweets server-side.

Your manifest’s missing the http://open.spotify.com permission - that’s why nothing works. Spotify apps can’t access any APIs without it, so you can’t even pull basic track info. Add it to your RequiredPermissions array and fix those HTTPS URLs while you’re at it. That jQuery Twitter plugin won’t work either. I spent days debugging this same issue - Spotify’s content security policy blocks the plugin’s XHR requests. You’ll need to handle Twitter API calls server-side and feed the data to your app through your own endpoint.

That blank screen means your app isn’t loading right in Spotify’s locked-down environment. Sure, fix the HTTPS permissions like everyone said, but I bet your jQuery Twitter plugin just doesn’t play nice with Spotify’s security rules. I ran into the same thing - switched to Twitter’s oEmbed API through my own server and it worked perfectly. Your plugin probably uses document.write or eval, which Spotify blocks. Ditch that plugin and just fetch from your backend to get formatted tweet HTML instead. Also check if your initializeApp() is throwing errors - Spotify apps fail silently way more than regular browsers.

Had the same issue with my Spotify app a while back. Spotify’s got stricter security than regular browsers, so your Twitter integration’s getting blocked. I see you’re using what looks like a jQuery Twitter plugin - those don’t work well in Spotify apps because of cross-origin request restrictions. Your manifest permissions are set to HTTP, but Twitter’s API requires HTTPS now. Switch those URLs to https. Also, Twitter widgets use iframes and dynamic script loading that Spotify’s sandbox blocks. I ditched the direct Twitter embed and went with server-side API calls instead - way more reliable. Check your browser console when it’s running in Spotify and you’ll see the security errors telling you exactly what’s wrong.