- Android
- iOS
- React Native
- Angular
- Flutter
- TextMessage textMessage = new TextMessage();
- textMessage.setToId(TO_JID);
- textMessage.setMessageText(TEXT);
- FlyMessenger.sendTextMessage(textMessage, (isSuccess, error, chatMessage) -> {
- if (isSuccess) {
- // you will get the message sent success response
- }
- }
- );
- var textMessage = TextMessage()
- textMessage.toId = TO_JID
- textMessage.messageText = TEXT
- FlyMessenger.sendTextMessage(messageParams: textMessage) { isSuccess, error, chatMessage in
- if isSuccess {
- // Update the UI
- } else {
- // Handle the error
- }
- }
- const userJid = SDK.getJid(USER_NAME)
- await SDK.sendTextMessage({
- toJid: "",
- messageText: ""
- });
- function messageListener(response) {
- console.log("Message Listener", response);
- }
- {
- '@react-native-community/netinfo' : '^11.4.1',
- "react-native-get-random-values": "1.11.0", //must use version >=1.7.1
- 'realm': "^20.1.0",
- 'react-native-fs': "^2.20.0",
- 'moment': "2.30.1",
- //add the below calls related dependencies
- "react-native-webrtc": "124.0.4" // must use version "124.0.4"
- "react-native-background-timer": "^2.4.1",
- 'react-native-permissions':'^5.2.1'
- }
- const initializeObj = {
- licenseKey: `LICENSE_KEY`,
- callbackListeners: {},
- };
- await SDK.initializeSDK(initializeObj);
-
- await SDK.sendTextMessage({
- toJid: "",
- messageText: ""
- });
-
- function messageListener(response) {
- console.log("Message Listener", response);
- }
- void main(){
- WidgetsFlutterBinding.ensureInitialized();
- Mirrorfly.initializeSDK(
- licenseKey: LICENSE_KEY,
- iOSContainerID: iOS_APP_GROUP_ID,
- chatHistoryEnable: ENABLE_CHAT_HISTORY,
- enableDebugLog: ENABLE_DEBUG_LOG, // to enable logs for debug
- flyCallback: (FlyResponse response) {
- runApp(const MyApp());
- }
- );
- }
-
- var textMessage = MessageParams.text(
- toJid: toJid,
- replyMessageId: replyMessageId, // Optional
- topicId: topicId, // Optional
- textMessageParams: TextMessageParams(messageText: messageText);
- Mirrorfly.sendMessage(messageParams: textMessage, flyCallback: (response){
- if(response.isSuccess){
- }
- });