Mobile API Integration Template

This template guides you through integrating mobile applications with backend APIs, focusing on performance, offline capabilities, and mobile-specific considerations.

Sample Prompt

Implement mobile API integration for a social media app:
- User authentication with token refresh and biometric support
- Feed API with pagination and offline caching strategies
- Image upload with compression and progress tracking
- Real-time notifications using push notifications and WebSockets
- Offline-first data synchronization for user-generated content
- Error handling and retry logic for unreliable network conditions

What This Template Covers

  • API client architecture optimized for mobile performance and reliability
  • Authentication strategies including token management and biometric integration
  • Offline capabilities with local data storage and synchronization
  • Performance optimization including caching, compression, and lazy loading
  • Network handling for varying connection quality and bandwidth
  • Security considerations specific to mobile environments and data protection

Best Practices

  1. Implement offline-first design for better user experience
  2. Use efficient data formats like Protocol Buffers or MessagePack
  3. Cache aggressively with appropriate cache invalidation strategies
  4. Handle network errors gracefully with user-friendly messaging
  5. Optimize for battery life by minimizing background network activity
  6. Implement proper authentication with secure token storage
  7. Use pagination for large data sets to improve performance
  8. Test on real devices with varying network conditions

When to Use This Template

  • Building mobile applications that consume REST or GraphQL APIs
  • Implementing offline-capable mobile apps with data synchronization
  • Optimizing mobile app performance for slow or unreliable networks
  • Adding real-time features to mobile applications
  • Securing mobile API communication and user data

The Script

peep mobile-api-integration