GitHub - andreapianidev/WalkieTalkie: Walkie Talkie app for iOS and macOS

10 min read Original article โ†—

// Created by Andrea Piani - Immaginet Srl - 15/01/25 - https://www.andreapiani.com - README.md

Talky - Professional Walkie-Talkie & FM Radio App

Talky App

iOS Swift Xcode License

๐Ÿ“ฑ Overview

Talky is now Open Source! ๐ŸŽ‰

Talky is a professional iOS app that combines Push-to-Talk walkie-talkie functionality with integrated FM radio streaming. Built with SwiftUI and modern technologies, it offers peer-to-peer communication through Multipeer Connectivity and real-time radio streaming without requiring internet connectivity.

โœจ Features

  • ๐ŸŽ™๏ธ Push-to-Talk Communication: Professional walkie-talkie system with crystal-clear audio
  • ๐Ÿ“ป FM Radio Integration: Built-in radio streaming with advanced playback controls
  • ๐Ÿ”— Multipeer Connectivity: Peer-to-peer communication without internet connection
  • ๐Ÿ”” Smart Notifications: Intelligent notification system with cooldown protection
  • ๐ŸŒ Multi-language Support: Italian, English, Spanish localization
  • โšก Power Management: Optimized battery usage and power monitoring
  • ๐ŸŽต Audio Management: Advanced audio session control and management
  • ๐Ÿ“ณ Haptic Feedback: Tactile feedback for enhanced user experience
  • ๐Ÿ”ฅ Firebase Integration: Analytics and crash reporting for better app insights
  • ๐ŸŽฏ Modern Architecture: Clean MVVM pattern with SwiftUI and Combine

๐Ÿ—๏ธ Architecture

Design Patterns

  • MVVM (Model-View-ViewModel): Primary architecture pattern for clean separation of concerns
  • Singleton Pattern: Shared managers for system-wide functionality
  • Observer Pattern: Reactive programming using @Published and ObservableObject
  • Dependency Injection: SwiftUI's @StateObject and @ObservedObject for loose coupling

Core Components

๐Ÿ”ง Managers (Business Logic Layer)

  • AudioManager: Audio session management, recording, playback, and real-time audio processing
  • MultipeerManager: Peer-to-peer communication, device discovery, and connection management
  • RadioManager: FM radio streaming, playback controls, and audio routing
  • NotificationManager: Smart notification system with anti-spam protection and user engagement
  • SettingsManager: User preferences persistence and app configuration
  • PowerManager: Battery monitoring and power optimization strategies
  • HapticManager: Tactile feedback coordination for enhanced UX
  • FirebaseManager: Analytics tracking, crash reporting, and app insights
  • Logger: Centralized logging system with categorized output

๐ŸŽจ Views (Presentation Layer)

  • ContentView: Main interface with Radio/Walkie-Talkie mode toggle and primary controls
  • ConnectionsView: Active peer-to-peer connection management and status monitoring
  • ExploreView: Device discovery interface for finding and connecting to nearby devices
  • SettingsView: App configuration, user preferences, and system settings

๐Ÿ“ Project Structure

WalkieTalkie/
โ”œโ”€โ”€ WalkieTalkie.xcodeproj/          # Xcode Project Configuration
โ”‚   โ”œโ”€โ”€ project.pbxproj              # Project settings and build configuration
โ”‚   โ””โ”€โ”€ project.xcworkspace/         # Workspace for dependencies
โ”œโ”€โ”€ WalkieTalkie/                    # Main Source Code
โ”‚   โ”œโ”€โ”€ ๐Ÿ”ง Managers (Business Logic)
โ”‚   โ”‚   โ”œโ”€โ”€ AudioManager.swift       # Audio session, recording, playback management
โ”‚   โ”‚   โ”œโ”€โ”€ MultipeerManager.swift   # P2P communication and device discovery
โ”‚   โ”‚   โ”œโ”€โ”€ RadioManager.swift       # FM radio streaming and controls
โ”‚   โ”‚   โ”œโ”€โ”€ NotificationManager.swift # Smart notifications with anti-spam
โ”‚   โ”‚   โ”œโ”€โ”€ SettingsManager.swift    # User preferences and app configuration
โ”‚   โ”‚   โ”œโ”€โ”€ PowerManager.swift       # Battery monitoring and optimization
โ”‚   โ”‚   โ”œโ”€โ”€ HapticManager.swift      # Tactile feedback coordination
โ”‚   โ”‚   โ””โ”€โ”€ FirebaseManager.swift    # Analytics and crash reporting
โ”‚   โ”œโ”€โ”€ ๐ŸŽจ Views (SwiftUI Interface)
โ”‚   โ”‚   โ”œโ”€โ”€ ContentView.swift        # Main app interface with mode toggle
โ”‚   โ”‚   โ”œโ”€โ”€ ConnectionsView.swift    # P2P connection management
โ”‚   โ”‚   โ”œโ”€โ”€ ExploreView.swift        # Device discovery and pairing
โ”‚   โ”‚   โ””โ”€โ”€ SettingsView.swift       # App configuration and preferences
โ”‚   โ”œโ”€โ”€ ๐Ÿ› ๏ธ Utilities
โ”‚   โ”‚   โ”œโ”€โ”€ Logger.swift             # Centralized logging system
โ”‚   โ”‚   โ””โ”€โ”€ String+Localization.swift # Localization extensions
โ”‚   โ”œโ”€โ”€ ๐ŸŽต Audio Resources
โ”‚   โ”‚   โ”œโ”€โ”€ f1.mp3 - f24.mp3         # Frequency tone samples (1-24)
โ”‚   โ”‚   โ”œโ”€โ”€ radio2.mp3               # Radio background audio
โ”‚   โ”‚   โ”œโ”€โ”€ radio3.mp3               # Alternative radio samples
โ”‚   โ”‚   โ””โ”€โ”€ radio4.mp3
โ”‚   โ”œโ”€โ”€ ๐ŸŽจ Assets
โ”‚   โ”‚   โ”œโ”€โ”€ Assets.xcassets/         # App icons, images, and color sets
โ”‚   โ”‚   โ””โ”€โ”€ Contents.json            # Asset catalog configuration
โ”‚   โ”œโ”€โ”€ ๐ŸŒ Localization
โ”‚   โ”‚   โ”œโ”€โ”€ it.lproj/                # Italian translations
โ”‚   โ”‚   โ”œโ”€โ”€ en.lproj/                # English translations
โ”‚   โ”‚   โ””โ”€โ”€ es.lproj/                # Spanish translations
โ”‚   โ”œโ”€โ”€ โš™๏ธ Configuration
โ”‚   โ”‚   โ”œโ”€โ”€ Info.plist               # App metadata and permissions
โ”‚   โ”‚   โ”œโ”€โ”€ WalkieTalkie-Info.plist  # Additional app configuration
โ”‚   โ”‚   โ”œโ”€โ”€ GoogleService-Info.plist # Firebase configuration
โ”‚   โ”‚   โ””โ”€โ”€ WalkieTalkieApp.swift    # App entry point and initialization
โ”œโ”€โ”€ ๐Ÿ“š Documentation
โ”‚   โ”œโ”€โ”€ plan.md                      # Development roadmap
โ”‚   โ”œโ”€โ”€ AppStore_Description.md      # App Store listing content
โ”‚   โ””โ”€โ”€ README.md                    # This documentation file

๐Ÿ› ๏ธ Technical Requirements

System Requirements

  • iOS: 15.0+ (optimized for iOS 16+)
  • Xcode: 14.0+ (recommended: latest stable version)
  • Swift: 5.0+ (using modern Swift features)
  • Device: iPhone/iPad with Multipeer Connectivity support
  • Hardware: Microphone access required for walkie-talkie functionality

Frameworks & Dependencies

  • SwiftUI: Modern declarative UI framework for all interfaces
  • MultipeerConnectivity: Peer-to-peer communication without internet
  • AVFoundation: Audio recording, playback, and session management
  • UserNotifications: Local notification system with smart scheduling
  • Combine: Reactive programming for data flow and state management
  • Firebase: Analytics, crash reporting, and app performance monitoring
  • UIKit: Legacy components integration where needed

Required Permissions

  • Microphone (NSMicrophoneUsageDescription): Essential for audio recording and walkie-talkie communication
  • Local Network (NSLocalNetworkUsageDescription): Required for Multipeer Connectivity device discovery
  • Notifications: For incoming call alerts and system notifications

๐Ÿš€ Setup & Installation

Prerequisites

  1. macOS with Xcode 14.0+ installed
  2. Apple Developer Account (for device testing and distribution)
  3. Physical iOS Device (required for testing Multipeer Connectivity - simulator limitations)
  4. Firebase Account (optional, for analytics and crash reporting)

Installation Steps

  1. Clone the Repository

    git clone https://github.com/andreapianidev/WalkieTalkie.git
    cd WalkieTalkie
  2. Open the Project

    open WalkieTalkie.xcodeproj
  3. Configure Code Signing

    • Select your Development Team in "Signing & Capabilities"
    • Update Bundle Identifier to match your developer account
    • Ensure Automatically manage signing is enabled
  4. Firebase Setup (Optional)

    • Replace GoogleService-Info.plist with your Firebase configuration
    • Or remove Firebase integration if not needed
  5. Build & Run

    • Select your target device (physical device recommended)
    • Press Cmd+R to build and run the app
    • Grant microphone and local network permissions when prompted

๐Ÿ”ง Configuration

App Configuration

  • Bundle ID: Configurable in project.pbxproj (default: com.immaginet.talky)
  • Display Name: "Talky" (customizable in Info.plist)
  • Service Type: walkie-talkie for Multipeer Connectivity identification
  • Version: Semantic versioning (Major.Minor.Patch)

Audio Configuration

  • Audio Session Category: .playAndRecord with .defaultToSpeaker option
  • Sample Rate: 44.1 kHz (CD quality)
  • Bit Depth: 16-bit linear PCM
  • Channels: Mono for walkie-talkie communication, Stereo for radio playback
  • Buffer Size: Optimized for low-latency real-time communication

Network Configuration

  • Multipeer Service Type: _walkie-talkie._tcp (Bonjour service)
  • Auto-discovery: Enabled by default for seamless device detection
  • Maximum Peers: 8 simultaneous device connections
  • Connection Timeout: 30 seconds for initial pairing
  • Reconnection: Automatic retry with exponential backoff

๐Ÿงช Testing

Unit Testing

  • Manager Testing: Individual testing of each manager class with mocked dependencies
  • Utility Testing: Comprehensive testing of helper functions and extensions
  • Model Testing: Validation of data models and business logic
  • Audio Testing: Verify audio processing and session management

Integration Testing

  • Multipeer Communication: End-to-end testing of device discovery and connection
  • Audio Pipeline: Testing complete audio recording, transmission, and playback flow
  • Data Persistence: Verify settings and preferences are correctly saved/loaded
  • Firebase Integration: Analytics and crash reporting functionality

Device Testing

  • Physical Device Required: Multipeer Connectivity cannot be tested in simulator
  • Multi-device Testing: Test with 2+ devices for real P2P communication
  • Performance Testing: Audio latency, memory usage, and battery consumption
  • Edge Cases: Network interruptions, background/foreground transitions

๐Ÿ“Š Performance Considerations

Memory Management

  • Weak References: Proper use of weak self in closures to prevent retain cycles
  • Automatic Cleanup: Connection and session cleanup when app backgrounds
  • Audio Session Optimization: Efficient management of AVAudioSession lifecycle
  • Firebase Optimization: Batched analytics events to reduce overhead

Battery Optimization

  • PowerManager Integration: Real-time battery monitoring and adaptive behavior
  • Low Power Mode: Reduced functionality when device battery is low
  • Smart Connection Management: Automatic disconnection of idle peers
  • Background Processing: Minimal background activity to preserve battery

Network Optimization

  • Audio Compression: Efficient encoding for real-time transmission
  • Automatic Reconnection: Smart retry logic with exponential backoff
  • Connection Pooling: Efficient management of multiple peer connections
  • Timeout Management: Configurable timeouts for different network conditions

๐Ÿ› Debugging

Centralized Logging System

  • Logger.swift: Unified logging with categorized output
  • Log Categories: Audio, Network, UI, Error, Firebase, Performance
  • Debug Levels: Verbose, Info, Warning, Error for different build configurations
  • Console Output: Real-time logging visible in Xcode console

Common Issues & Solutions

  1. Multipeer Discovery Fails:

    • โœ… Verify Local Network permissions are granted
    • โœ… Ensure both devices are on same network
    • โœ… Check firewall settings on macOS
  2. Audio Recording Issues:

    • โœ… Confirm Microphone permissions are granted
    • โœ… Check if another app is using audio session
    • โœ… Verify device is not in silent mode
  3. Notifications Not Appearing:

    • โœ… Verify notification permissions are granted
    • โœ… Check Do Not Disturb settings
    • โœ… Ensure app is not backgrounded too long

๐Ÿ”’ Security & Privacy

Data Privacy

  • Local-Only Communication: No data transmitted to external servers
  • Peer-to-Peer Encryption: Multipeer Connectivity uses built-in encryption
  • No Audio Storage: Voice data is not permanently stored on device
  • Anonymous Analytics: Firebase analytics with no personally identifiable information

Security Measures

  • Input Validation: All user inputs are sanitized and validated
  • Secure Connections: TLS encryption for all network communications
  • No Hardcoded Secrets: All sensitive data stored securely in Keychain
  • Permission Validation: Runtime checks for all required permissions

๐Ÿ“ˆ Future Enhancements

Planned Features

  • Conversation Recording: Save and replay walkie-talkie conversations
  • Group Communication: Multi-user channels and group management
  • End-to-End Encryption: Enhanced security for sensitive communications
  • Apple Watch Support: Companion app for wrist-based communication
  • iOS Widgets: Quick access controls and connection status
  • Background Audio: Continue radio playback when app is backgrounded
  • Custom Frequencies: User-defined radio station presets
  • Voice Effects: Real-time audio filters and effects

Technical Roadmap

  • AudioManager Refactoring: Improve audio pipeline architecture
  • Enhanced Test Coverage: Comprehensive unit and integration tests
  • Performance Optimization: Reduce memory footprint and improve battery life
  • API Documentation: Complete code documentation with examples
  • Accessibility Improvements: VoiceOver support and accessibility features
  • SwiftUI Migration: Complete migration from UIKit components

๐Ÿ‘จโ€๐Ÿ’ป Contributing

We welcome contributions from the open source community! ๐ŸŽ‰

Code Style Guidelines

  • Follow Swift API Design Guidelines and community best practices
  • Use SwiftLint for code consistency and style enforcement
  • Document all public functions and classes with clear descriptions
  • Write comprehensive tests for new features and bug fixes
  • Use meaningful commit messages following conventional commit format

Development Workflow

  1. Fork the repository and create a feature branch
  2. Implement your changes with appropriate tests
  3. Run SwiftLint and ensure all tests pass
  4. Submit a pull request with detailed description
  5. Collaborate during code review process

Pull Request Guidelines

  • Provide clear description of changes and motivation
  • Include screenshots for UI changes
  • Ensure backward compatibility when possible
  • Update documentation for new features

๐Ÿ“„ License

Open Source - MIT License ยฉ 2025 Andrea Piani - Immaginet Srl

This project is now open source and available for community contributions. See the LICENSE file for full details.

๐Ÿ”๏ธ Peak - Complete Altimetry App

๐ŸŽ‰ Exciting News! The walkie-talkie functionality is now also available in our comprehensive altimetry app:

๐Ÿ“ฑ Peak - GPS Altimeter Barometer

Why choose Peak?

  • ๐Ÿ”๏ธ Professional Altimetry: Accurate GPS and barometric altitude measurements
  • ๐Ÿงญ Advanced Navigation: Comprehensive GPS tools and compass functionality
  • ๐ŸŒฆ๏ธ Weather Monitoring: Real-time barometric pressure and weather tracking
  • ๐Ÿ“ก Built-in Walkie-Talkie: All the communication features you love from this app
  • ๐ŸŽฏ All-in-One Solution: Complete outdoor adventure toolkit in one app

Peak combines the best of both worlds - professional altimetry tools with the reliable walkie-talkie communication system you're already familiar with.

Download Peak


๐Ÿ“ž Support & Community

  • Developer: Andrea Piani
  • Company: Immaginet Srl
  • Website: https://www.andreapiani.com
  • Issues: Report bugs and request features via GitHub Issues
  • Discussions: Join community discussions for questions and ideas

Getting Help

  • ๐Ÿ“– Check this README for setup and configuration help
  • ๐Ÿ› Search existing issues before creating new ones
  • ๐Ÿ’ฌ Use GitHub Discussions for questions and community support
  • ๐Ÿ“ง Contact developer for business inquiries

๐Ÿ‘‰ If you want say me thank you ...buy me a coffee! ๐Ÿค—โค๏ธ buymeacoffee.com/andreapianidev

Note: This project is actively maintained and developed. Check plan.md for current development status and upcoming features. Contributions and feedback are always welcome!