A real-time messaging application for iOS that provides reliable, WhatsApp-like messaging infrastructure with the foundation for intelligent AI features.
MessageAI is built using Swift, SwiftUI, and Firebase. The MVP focuses on proving the core messaging infrastructure works flawlessly:
- Real-time message delivery (< 1 second)
- Offline support with local persistence
- Message read receipts and typing indicators
- Group chat support
- Push notifications
- SwiftUI - Modern declarative UI
- SwiftData - Local persistence (iOS 17+)
- Combine - Reactive programming
- SDWebImage - GIF support
- Firebase Firestore - Real-time database
- Firebase Auth - User authentication
- Firebase Storage - Media storage
- Firebase Cloud Messaging - Push notifications
MessageAI/
├── App/ # Main app entry point
├── Features/ # Feature modules
│ ├── Auth/ # Authentication
│ ├── Chat/ # Messaging
│ ├── Conversations/ # Conversation list
│ └── Profile/ # User profile
├── Services/ # Core services
│ ├── FirebaseService # Firebase operations
│ ├── NetworkMonitor # Network connectivity
│ └── NotificationService # Push notifications
├── Models/ # Data models
│ ├── User
│ ├── Conversation
│ └── Message
└── Utilities/ # Helpers and extensions
- Xcode 15+
- iOS 17.0+ deployment target
- Firebase project (see Firebase Setup below)
-
Create a new Firebase project at console.firebase.google.com
-
Register your iOS app with bundle identifier (e.g.,
com.yourname.messageai) -
Download
GoogleService-Info.plistand add it to your Xcode project -
Enable these Firebase services:
- Authentication (Email/Password provider)
- Firestore Database
- Storage
- Cloud Messaging
-
Configure Firestore Security Rules (see
firestore.rules) -
Upload APNs authentication key for push notifications:
- Go to Apple Developer Portal
- Create APNs key
- Upload to Firebase Console (Project Settings → Cloud Messaging)
-
Clone this repository:
git clone <repository-url> cd MessageAI
-
Open in Xcode:
open MessageAI.xcodeproj
-
Add
GoogleService-Info.plistto the project (if not already present) -
Update bundle identifier in Xcode project settings
-
Add Firebase dependencies via Swift Package Manager:
- File → Add Package Dependencies
- Add:
https://github.com/firebase/firebase-ios-sdk - Add:
https://github.com/SDWebImage/SDWebImageSwiftUI
-
Build and run on a physical device (required for push notifications)
-
Navigate to the project directory:
cd MessageAI/MessageAI-Xcode -
Open the Xcode project:
open MessageAI-Xcode.xcodeproj
Alternatively, you can double-click
MessageAI-Xcode.xcodeprojin Finder.
-
In Xcode, locate the scheme selector in the toolbar (top-left area)
- It displays the current target device/simulator
-
Click on the device selector and choose a simulator:
- Select "iPhone 15 Pro" (or any iPhone model)
- Ensure the iOS version is 17.0 or newer
Note: The app requires iOS 17+ due to SwiftData dependencies
-
If you don't see iOS 17+ simulators:
- Go to Xcode → Settings → Platforms
- Download the iOS 17+ simulator runtime
-
Build the project (⌘B or Product → Build):
- This compiles the code and checks for errors
- Wait for the build to complete successfully
-
Run the application (⌘R or Product → Run):
- Xcode will launch the selected simulator
- The app will automatically install and launch
- First launch may take 30-60 seconds
-
Verify the build:
- The simulator should display the authentication screen
- Check the Xcode console for any startup messages
For full functionality (especially push notifications):
- Connect your iPhone via USB
- Select your iPhone from the device selector
- If prompted, trust the device and enable Developer Mode:
- On iPhone: Settings → Privacy & Security → Developer Mode → Enable
- Ensure your iPhone is running iOS 17.0 or newer
- Build and run (⌘R)
Important: Push notifications only work on physical devices, not simulators.
Build Errors:
- Clean build folder: Product → Clean Build Folder (⌘⇧K)
- Delete derived data: Xcode → Settings → Locations → Derived Data → Delete
- Verify Swift Package dependencies are resolved
Simulator Issues:
- Reset simulator: Device → Erase All Content and Settings
- Quit and restart Xcode
- Restart your Mac if simulator won't launch
Code Signing:
- Go to project settings → Signing & Capabilities
- Select your Apple ID team
- Xcode will automatically handle provisioning
- Test on at least 2 physical iPhones
- Test offline scenarios (airplane mode on/off)
- Test poor network conditions
- Test rapid message sending
- Test force-quit scenarios
- Xcode Network Link Conditioner (for throttled connections)
- Firebase Emulator Suite (optional, for local testing)
The MVP is successful when:
- ✅ Two users can send messages instantly (< 1 second)
- ✅ Messages persist across app force-quit and restart
- ✅ Offline scenario works correctly
- ✅ Group chat with 3 users works with proper attribution
- ✅ Read receipts update in real-time
- ✅ Online/offline status indicators work
- ✅ Typing indicators appear/disappear correctly
- ✅ Push notifications display in foreground
- ✅ App handles rapid-fire messaging
- ✅ Poor network doesn't break the app
- User authentication & profiles
- One-on-one messaging
- Group chat
- Read receipts
- Push notifications
- Offline support & sync
- Images
- GIFs with animation
- AI features (summarization, action items, etc.)
- Voice/video messages
- Message editing/deletion
- Voice/video calls
- End-to-end encryption
Copyright © 2025. All rights reserved.
For questions or support, please open an issue in the repository.