aws-samples / amazon-chime-react-native-demo

A React Native demo application for Android and iOS using the Amazon Chime SDK.
MIT No Attribution
102 stars 24 forks source link

Add data message api #120

Closed hokyungh closed 2 years ago

hokyungh commented 2 years ago

Description of changes: Add data message API.

This is demonstrated by echo If you send message from other it will reply with

const str = `Received Data message (topic: ${dataMessage.topic}) ${dataMessage.data} from ${dataMessage.senderAttendeeId}:${dataMessage.senderExternalUserId} at ${dataMessage.timestampMs} throttled: ${dataMessage.throttled}`;

Note that we subscribe to chat topic. If you wish you subscribe to other topics, Android

it.audioVideo.addRealtimeDataMessageObserver(<different-topic>, meetingObservers)

iOS

[meetingSession.audioVideo addRealtimeDataMessageObserverWithTopic:@"<different-topic>" observer:observer];

Tested with iPhone 6S Plus (12.4) and Samsung S9 (Android 10) with latest sdks

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.