A Swift Package Manager compatible package for AWS Interactive Video Service (IVS) Chat Messaging SDK that provides native iOS chat functionality.
- Real-time messaging - Instant chat for live streams
- Native iOS implementation - Optimized for iOS performance
- XCFramework support - Universal binary for all iOS architectures
- Swift Package Manager - Easy integration with SPM
- AWS IVS integration - Seamless connection with IVS streams
- Universal binary - Supports all iOS device architectures
- Modular design - Clean separation of chat functionality
- Thread-safe operations - Reliable concurrent message handling
- Memory efficient - Optimized resource usage
Add this to your Package.swift file:
dependencies: [
.package(url: "https://github.com/ileonix/AmazonIVSChatMessaging-SPM.git", from: "1.0.1")
]- Open your Xcode project
- Go to File > Add Package Dependencies
- Enter the repository URL:
https://github.com/ileonix/AmazonIVSChatMessaging-SPM.git - Select version
1.0.1or later
This framework works with the AWS IVS Real-time Serverless Demo API for chat token management:
- Deploy the serverless backend:
git clone https://github.com/ileonix/custom-aws-ivs-real-time-serverless-demo.git
cd custom-aws-ivs-real-time-serverless-demo
# Follow deployment instructions in the repository- Configure API endpoints in your iOS app:
let apiBaseURL = "https://your-api-gateway-url.amazonaws.com"import AmazonIVSChatMessaging// Create chat configuration
let config = ChatConfiguration()
// Initialize chat client
let chatClient = ChatClient(configuration: config)// Connect to chat room
chatClient.connect(token: "your-chat-token") { result in
switch result {
case .success:
print("Connected to chat")
case .failure(let error):
print("Connection failed: \(error)")
}
}// Send a message
chatClient.sendMessage("Hello, world!") { result in
switch result {
case .success(let message):
print("Message sent: \(message.content)")
case .failure(let error):
print("Failed to send: \(error)")
}
}// Listen for incoming messages
chatClient.onMessageReceived = { message in
print("New message: \(message.content) from \(message.sender)")
}| Platform | Chat Messaging | XCFramework |
|---|---|---|
| iOS | ✅ | ✅ |
| macOS | ❌ | ❌ |
- iOS: iOS 12.0+
- Xcode: 12.0+
- Swift: 5.3+
custom-aws-ivs-real-time-serverless-demo- Required serverless API for chat token generation and management
| Endpoint | Method | Purpose | Request Body | Response |
|---|---|---|---|---|
/chat/token |
POST | Generate chat room token | {"userId": "string", "roomId": "string", "capabilities": []} |
{"token": "string", "sessionExpirationTime": "string"} |
/chat/room/create |
POST | Create chat room | {"name": "string", "maximumMessageRatePerSecond": 10} |
{"arn": "string", "id": "string", "name": "string"} |
/chat/room/list |
GET | List chat rooms | - | {"rooms": [{"arn": "string", "name": "string"}]} |
/chat/room/delete |
DELETE | Delete chat room | {"identifier": "string"} |
{"success": true} |
/chat/message/delete |
DELETE | Delete message | {"roomId": "string", "messageId": "string"} |
{"success": true} |
/chat/user/disconnect |
POST | Disconnect user | {"roomId": "string", "userId": "string", "reason": "string"} |
{"success": true} |
flutter_ivs- Flutter plugin for AWS IVS video streamingflutter_ivs_chat- Flutter plugin that uses this framework
This project is licensed under the MIT License - see the LICENSE file for details.