No description
Find a file
mliem2k ec057a8e74 Add initial delay before profile fetch to avoid Spotify rate limiting
- Add 3-second delay before first API call after authentication
- Prevents hitting 429 rate limit on immediate profile fetch
- Existing retry backoff logic remains for subsequent attempts

Related to Spotify API rate limiting after login flow.
2026-02-10 16:08:01 +08:00
.github rename actions readme 2025-06-13 00:32:50 +08:00
android fix most of depreceated functions 2025-06-29 08:30:44 +08:00
assets/images Fix versioning and readme 2025-06-09 17:57:42 +08:00
ios Make widget activity items clickable to open Spotify profiles 2025-06-24 14:56:25 +08:00
lib Add initial delay before profile fetch to avoid Spotify rate limiting 2026-02-10 16:08:01 +08:00
screenshots add screenshots 2025-06-09 06:47:33 +08:00
scripts Initial commit 2025-06-09 06:41:48 +08:00
.fvmrc Initial commit 2025-06-09 06:41:48 +08:00
.gitattributes Initial commit 2025-06-09 06:41:48 +08:00
.gitignore Improve Spotify WebView auth and retry backoff 2026-02-08 15:40:59 +08:00
.metadata Initial commit 2025-06-09 06:41:48 +08:00
analysis_options.yaml Initial commit 2025-06-09 06:41:48 +08:00
build-apk.js update logging to not use print 2025-06-16 04:52:59 +08:00
BUILD_README.md update fetching version from github correctly 2025-06-19 03:04:27 +08:00
devtools_options.yaml Remove all dependencies on Spotify API client/secret 2025-06-11 06:32:39 +08:00
LICENSE Initial commit 2025-06-09 06:41:48 +08:00
list-commands.js update logging to not use print 2025-06-16 04:52:59 +08:00
nightly-apk.js Refactor: revert to Provider pattern and add update system 2025-10-02 14:16:03 +08:00
nightly-github-release.js Refactor: revert to Provider pattern and add update system 2025-10-02 14:16:03 +08:00
nightly-release.js update logging to not use print 2025-06-16 04:52:59 +08:00
nightly.js Refactor: revert to Provider pattern and add update system 2025-10-02 14:16:03 +08:00
package-lock.json update fetching version from github correctly 2025-06-19 03:04:27 +08:00
package.json Refactor: revert to Provider pattern and add update system 2025-10-02 14:16:03 +08:00
pubspec.lock Improve Spotify WebView auth and retry backoff 2026-02-08 15:40:59 +08:00
pubspec.yaml Refactor: revert to Provider pattern and add update system 2025-10-02 14:16:03 +08:00
README.md Remove all dependencies on Spotify API client/secret 2025-06-11 06:32:39 +08:00
release-apk.js update logging to not use print 2025-06-16 04:52:59 +08:00
test-release-notes.js update logging to not use print 2025-06-16 04:52:59 +08:00
WIDGET_CLICKABLE_IMPROVEMENTS.md Make widget activity items clickable to open Spotify profiles 2025-06-24 14:56:25 +08:00
WIDGET_SETUP.md widget init 2025-06-12 02:01:37 +08:00

Playtivity Logo

Playtivity - Spotify Friends Activity App

A Flutter app that shows your friends' Spotify activities in real-time. Built with Flutter and the Spotify Web API.

Flutter Version Platform Support License

Features

  • 🔐 Secure Login: OAuth authentication through embedded WebView
  • 🎵 Real Friend Activities: Automatically extracts sp_dc cookie during login for friend activity access
  • 📱 Profile Dashboard: View currently playing, top tracks, and top artists
  • 🌙 Dark Mode: Toggle between light and dark themes
  • 🎨 Spotify Design: Authentic Spotify branding and colors

Screenshots

Login Screen
Login Screen
Home Screen
Home Screen
Profile Top Artists
Profile - Top Artists
Profile Top Songs
Profile - Top Songs
Settings Screen
Settings Screen

How It Works

Friend Activities

The app uses an innovative approach to show friend activities without requiring your own Spotify API credentials:

  1. Direct Web Authentication: Uses Spotify's web login flow directly without requiring API registration
  2. Automatic Cookie Extraction: During the login process, the app automatically extracts the sp_dc cookie from the WebView
  3. Internal API Access: Uses the extracted cookie to generate access tokens for Spotify's internal buddy list API
  4. Real-time Data: Accesses the same endpoints used by Spotify's web player for friend activities

Technical Implementation

  • TOTP Generation: Implements the same TOTP algorithm used by Spotify's internal systems
  • Token Generation: Automatically generates access tokens using the sp_dc cookie and TOTP
  • API Integration: Calls the same endpoints used by Spotify's web player for friend activities

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd playtivity
    
  2. Install dependencies:

    flutter pub get
    
  3. Run the app:

    flutter run
    

🛠️ Development Scripts

The scripts/ folder contains utility scripts for development:

Icon & Image Generator

Automatically generates all required app icons and images from a single source image:

# Install Python dependencies
cd scripts
pip install -r requirements.txt

# Generate icons from your image (run from project root)
python scripts/convert_icon.py your_logo.svg
python scripts/convert_icon.py your_logo.png

What it creates:

  • 📱 Android Icons: All mipmap densities (mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi)
  • 🖼️ Flutter Images: Login screen logos, button icons, display images
  • 🎨 Multiple Sizes: 24x24 to 200x200 pixels for different use cases

See scripts/README.md for detailed usage instructions.

Dependencies

  • provider - State management
  • http - API requests
  • shared_preferences - Local storage
  • webview_flutter - Embedded OAuth login
  • cached_network_image - Image caching
  • timeago - Time formatting
  • font_awesome_flutter - Spotify icons
  • crypto - HMAC-SHA1 for TOTP generation

Architecture

  • Providers: State management for authentication and Spotify data
  • Services: API integration for Spotify Web API and buddy list
  • Models: Data structures for User, Track, and Activity
  • Screens: Login, Home (activities), Profile, and Settings
  • Widgets: Reusable components for activities and tracks

Current Status

OAuth authentication with automatic cookie extraction
Real friend activities via unofficial API
Profile data (currently playing, top tracks/artists)
Dark mode toggle

🧪 Testing Status

  • Android: Fully tested on Android 15
  • iOS: Not tested - community contributions welcome!

Note

: This app has only been tested on Android 15. While it's built with Flutter and should theoretically work on iOS, no testing has been performed on iOS devices. iOS users may encounter platform-specific issues. We welcome iOS testers and contributors!

🗺️ Roadmap

Future improvements planned:

  • [] Complete API-free implementation - Remove all dependencies on Spotify API client/secret
  • iOS testing and support - Test and fix iOS-specific issues
  • Home screen widgets - Android widgets showing friend activity and currently playing

Want to contribute? Check out our Contributing Guidelines below!

🤝 Contributing

We welcome contributions from the community! Here's how you can help:

🐛 Bug Reports

  • Found a bug? Please open an issue with:
    • Clear description of the problem
    • Steps to reproduce
    • Expected vs actual behavior
    • Screenshots if applicable
    • Device/OS information

🚀 Pull Requests

  • Pull requests are welcome! Please:
    • Fork the repository
    • Create a feature branch (git checkout -b feature/amazing-feature)
    • Make your changes
    • Test thoroughly
    • Commit with clear messages
    • Push to your branch
    • Open a pull request with detailed description

🍴 Forks

  • Forks are encouraged! Feel free to:
    • Fork this project for your own use
    • Customize it for your needs
    • Share your improvements back with the community
    • Create your own variations

💡 Feature Requests

  • Have an idea? Open an issue with the enhancement label
  • Describe your use case and proposed solution

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

TL;DR: You can do whatever you want with this code - use it, modify it, distribute it, even commercially. Just keep the copyright notice.

Third-Party Notices

  • Spotify is a trademark of Spotify AB
  • This project is not affiliated with or endorsed by Spotify
  • Built for educational and personal use

Made with ❤️ for music lovers