Browse Source

fix. android & ios native wrapper

matrixbirds 5 years ago
parent
commit
f702520621

+ 0
- 8
android/src/main/java/com/syan/agora/AgoraManager.java View File

@@ -172,14 +172,6 @@ public class AgoraManager {
172 172
         return mRtcEngine.joinChannel(token, channelName, optionalInfo, uid);
173 173
     }
174 174
 
175
-//    public int joinChannelWithToken(ReadableMap options) {
176
-//        String token = options.getString("token");
177
-//        String channel = options.getString("channel");
178
-//        String optionalInfo = options.getString("optionalInfo");
179
-//        int uid = options.getInt("uid");
180
-//        return mRtcEngine.joinChannel(token, channel, optionalInfo, uid);
181
-//    }
182
-
183 175
     public int enableLastmileTest() {
184 176
         return mRtcEngine.enableLastmileTest();
185 177
     }

+ 174
- 109
android/src/main/java/com/syan/agora/AgoraModule.java View File

@@ -257,6 +257,69 @@ public class AgoraModule extends ReactContextBaseJavaModule {
257 257
         return constants;
258 258
     }
259 259
 
260
+    private final static String AGWarning = "warning";
261
+    private final static String AGError = "error";
262
+    private final static String AGApiCallExecute = "apiCallExecute";
263
+    private final static String AGJoinChannelSuccess = "joinChannelSuccess";
264
+    private final static String AGRejoinChannelSuccess = "rejoinChannelSuccess";
265
+    private final static String AGLeaveChannel = "leaveChannel";
266
+    private final static String AGClientRoleChanged = "clientRoleChanged";
267
+    private final static String AGUserJoined = "userJoined";
268
+    private final static String AGUserOffline = "userOffline";
269
+    private final static String AGConnectionStateChanged = "connectionStateChanged";
270
+    private final static String AGConnectionLost = "connectionLost";
271
+    private final static String AGTokenPrivilegeWillExpire = "tokenPrivilegeWillExpire";
272
+    private final static String AGRequestToken = "requestToken";
273
+
274
+    private final static String AGMicrophoneEnabled = "microphoneEnabled";
275
+    private final static String AGAudioVolumeIndication = "audioVolumeIndication";
276
+    private final static String AGActiveSpeaker = "activeSpeaker";
277
+    private final static String AGFirstLocalAudioFrame = "firstLocalAudioFrame";
278
+    private final static String AGFirstRemoteAudioFrame = "firstRemoteAudioFrame";
279
+    private final static String AGVideoStopped = "videoStopped";
280
+    private final static String AGFirstLocalVideoFrame = "firstLocalVideoFrame";
281
+    private final static String AGFirstRemoteVideoDecoded = "firstRemoteVideoDecoded";
282
+    private final static String AGFirstRemoteVideoFrame = "firstRemoteVideoFrame";
283
+    private final static String AGUserMuteAudio = "userMuteAudio";
284
+    private final static String AGUserMuteVideo = "userMuteVideo";
285
+    private final static String AGUserEnableVideo = "userEnableVideo";
286
+    private final static String AGUserEnableLocalVideo = "userEnableLocalVideo";
287
+    private final static String AGVideoSizeChanged = "videoSizeChanged";
288
+    private final static String AGRemoteVideoStateChanged = "remoteVideoStateChanged";
289
+    private final static String AGLocalPublishFallbackToAudioOnly = "localPublishFallbackToAudioOnly";
290
+    private final static String AGRemoteSubscribeFallbackToAudioOnly = "remoteSubscribeFallbackToAudioOnly";
291
+
292
+    private final static String AGAudioRouteChanged = "audioRouteChanged";
293
+    private final static String AGCameraReady = "cameraReady";
294
+    private final static String AGCameraFocusAreaChanged = "cameraFocusAreaChanged";
295
+    private final static String AGCameraExposureAreaChanged = "cameraExposureAreaChanged";
296
+
297
+    private final static String AGRtcStats = "rtcStats";
298
+    private final static String AGLastmileQuality = "lastmileQuality";
299
+    private final static String AGNetworkQuality = "networkQuality";
300
+    private final static String AGLocalVideoStats = "localVideoStats";
301
+    private final static String AGRemoteVideoStats = "remoteVideoStats";
302
+    private final static String AGRemoteAudioStats = "remoteAudioStats";
303
+    private final static String AGAudioTransportStatsOfUid = "audioTransportStatsOfUid";
304
+    private final static String AGVideoTransportStatsOfUid = "videoTransportStatsOfUid";
305
+
306
+    private final static String AGLocalAudioMixingFinish = "localAudioMixingFinish";
307
+    private final static String AGRemoteAudioMixingStart = "remoteAudioMixingStart";
308
+    private final static String AGRemoteAudioMixingFinish = "remoteAudioMixingFinish";
309
+    private final static String AGAudioEffectFinish = "audioEffectFinish";
310
+
311
+    private final static String AGStreamPublished = "streamPublished";
312
+    private final static String AGStreamUnpublish = "streamUnpublish";
313
+    private final static String AGTranscodingUpdate = "transcodingUpdate";
314
+
315
+    private final static String AGStreamInjectedStatus = "streamInjectedStatus";
316
+
317
+    private final static String AGReceiveStreamMessage = "receiveStreamMessage";
318
+    private final static String AGOccurStreamMessageError = "occurStreamMessageError";
319
+
320
+    private final static String AGMediaEngineLoaded = "mediaEngineLoaded";
321
+    private final static String AGMediaEngineStartCall = "mediaEngineStartCall";
322
+
260 323
     private IRtcEngineEventHandler mRtcEventHandler = new IRtcEngineEventHandler() {
261 324
 
262 325
         @Override
@@ -267,6 +330,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
267 330
                     WritableMap map = Arguments.createMap();
268 331
                     map.putString("message", "AgoraWarning");
269 332
                     map.putInt("code", code);
333
+                    sendEvent(getReactApplicationContext(), AGWarning, map);
270 334
                 }
271 335
             });
272 336
         }
@@ -279,7 +343,25 @@ public class AgoraModule extends ReactContextBaseJavaModule {
279 343
                     WritableMap map = Arguments.createMap();
280 344
                     map.putString("message", "AgoraError");
281 345
                     map.putInt("code", code);
282
-                    sendEvent(getReactApplicationContext(), "error", map);
346
+                    sendEvent(getReactApplicationContext(), AGError, map);
347
+                }
348
+            });
349
+        }
350
+
351
+        @Override
352
+        public void onApiCallExecuted(final int code, final String api, final String result) {
353
+            runOnUiThread(new Runnable() {
354
+                @Override
355
+                public void run() {
356
+                    WritableMap map = Arguments.createMap();
357
+                    map.putInt("error", code);
358
+                    map.putString("api", api);
359
+                    map.putString("result", result);
360
+                    if (code != 0) {
361
+                        sendEvent(getReactApplicationContext(), AGError, map);
362
+                    } else {
363
+                        sendEvent(getReactApplicationContext(), AGApiCallExecute, map);
364
+                    }
283 365
                 }
284 366
             });
285 367
         }
@@ -293,7 +375,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
293 375
                     map.putString("channel", channel);
294 376
                     map.putInt("uid", uid);
295 377
                     map.putInt("elapsed", elapsed);
296
-                    sendEvent(getReactApplicationContext(), "joinChannelSuccess", map);
378
+                    sendEvent(getReactApplicationContext(), AGJoinChannelSuccess, map);
297 379
                 }
298 380
             });
299 381
         }
@@ -307,7 +389,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
307 389
                     map.putString("channel", channel);
308 390
                     map.putInt("uid", uid);
309 391
                     map.putInt("elapsed", elapsed);
310
-                    sendEvent(getReactApplicationContext(), "reJoinChannelSuccess", map);
392
+                    sendEvent(getReactApplicationContext(), AGRejoinChannelSuccess, map);
311 393
                 }
312 394
             });
313 395
         }
@@ -318,23 +400,23 @@ public class AgoraModule extends ReactContextBaseJavaModule {
318 400
                 @Override
319 401
                 public void run() {
320 402
                     WritableMap statsMap = Arguments.createMap();
321
-                    statsMap.putInt("totalDuration", stats.totalDuration);
403
+                    statsMap.putInt("duration", stats.totalDuration);
322 404
                     statsMap.putInt("txBytes", stats.txBytes);
323 405
                     statsMap.putInt("rxBytes", stats.rxBytes);
324
-                    statsMap.putInt("txKBitRate", stats.txKBitRate);
325
-                    statsMap.putInt("rxKBitRate", stats.rxKBitRate);
406
+                    // statsMap.putInt("txKBitRate", stats.txKBitRate);
407
+                    // statsMap.putInt("rxKBitRate", stats.rxKBitRate);
326 408
                     statsMap.putInt("txAudioKBitRate", stats.txAudioKBitRate);
327 409
                     statsMap.putInt("rxAudioKBitRate", stats.rxAudioKBitRate);
328 410
                     statsMap.putInt("txVideoKBitRate", stats.txVideoKBitRate);
329 411
                     statsMap.putInt("rxVideoKBitRate", stats.rxVideoKBitRate);
330
-                    statsMap.putInt("users", stats.users);
331 412
                     statsMap.putInt("lastmileDelay", stats.lastmileDelay);
332
-                    statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
413
+                    statsMap.putInt("userCount", stats.users);
333 414
                     statsMap.putDouble("cpuAppUsage", stats.cpuAppUsage);
415
+                    statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
334 416
 
335 417
                     WritableMap map = Arguments.createMap();
336 418
                     map.putMap("stats", statsMap);
337
-                    sendEvent(getReactApplicationContext(), "leaveChannel", map);
419
+                    sendEvent(getReactApplicationContext(), AGLeaveChannel, map);
338 420
                 }
339 421
             });
340 422
         }
@@ -347,7 +429,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
347 429
                     WritableMap map = Arguments.createMap();
348 430
                     map.putInt("oldRole", oldRole);
349 431
                     map.putInt("newRole", newRole);
350
-                    sendEvent(getReactApplicationContext(), "clientRoleChanged", map);
432
+                    sendEvent(getReactApplicationContext(), AGClientRoleChanged, map);
351 433
                 }
352 434
             });
353 435
         }
@@ -360,7 +442,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
360 442
                     WritableMap map = Arguments.createMap();
361 443
                     map.putInt("uid", uid);
362 444
                     map.putInt("elapsed", elapsed);
363
-                    sendEvent(getReactApplicationContext(), "userJoined", map);
445
+                    sendEvent(getReactApplicationContext(), AGUserJoined, map);
364 446
                 }
365 447
             });
366 448
         }
@@ -373,7 +455,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
373 455
                     WritableMap map = Arguments.createMap();
374 456
                     map.putInt("uid", uid);
375 457
                     map.putInt("reason", reason);
376
-                    sendEvent(getReactApplicationContext(), "userOffline", map);
458
+                    sendEvent(getReactApplicationContext(), AGUserOffline, map);
377 459
                 }
378 460
             });
379 461
         }
@@ -386,7 +468,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
386 468
                     WritableMap map = Arguments.createMap();
387 469
                     map.putInt("state", state);
388 470
                     map.putInt("reason", reason);
389
-                    sendEvent(getReactApplicationContext(), "connectionStateChanged", map);
471
+                    sendEvent(getReactApplicationContext(), AGConnectionStateChanged, map);
390 472
                 }
391 473
             });
392 474
         }
@@ -399,23 +481,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
399 481
                 public void run() {
400 482
                     WritableMap map = Arguments.createMap();
401 483
                     map.putString("message", "connectionLost");
402
-                    sendEvent(getReactApplicationContext(), "connectionLost", map);
403
-                }
404
-            });
405
-        }
406
-
407
-        @Override
408
-        public void onApiCallExecuted(final int code, final String api, final String result) {
409
-            runOnUiThread(new Runnable() {
410
-                @Override
411
-                public void run() {
412
-                    if (code != 0) {
413
-                        WritableMap map = Arguments.createMap();
414
-                        map.putInt("error", code);
415
-                        map.putString("api", api);
416
-                        map.putString("result", result);
417
-                        sendEvent(getReactApplicationContext(), "apiCallExecuted", map);
418
-                    }
484
+                    sendEvent(getReactApplicationContext(), AGConnectionLost, map);
419 485
                 }
420 486
             });
421 487
         }
@@ -427,7 +493,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
427 493
                 public void run() {
428 494
                     WritableMap map = Arguments.createMap();
429 495
                     map.putString("token", token);
430
-                    sendEvent(getReactApplicationContext(), "tokenPrivilegeWillExpire", map);
496
+                    sendEvent(getReactApplicationContext(), AGTokenPrivilegeWillExpire, map);
431 497
                 }
432 498
             });
433 499
         }
@@ -439,7 +505,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
439 505
                 public void run() {
440 506
                     WritableMap map = Arguments.createMap();
441 507
                     map.putString("message", "RequestToken");
442
-                    sendEvent(getReactApplicationContext(), "requestToken", map);
508
+                    sendEvent(getReactApplicationContext(), AGRequestToken, map);
443 509
                 }
444 510
             });
445 511
         }
@@ -451,7 +517,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
451 517
                 public void run() {
452 518
                     WritableMap map = Arguments.createMap();
453 519
                     map.putBoolean("enabled", enabled);
454
-                    sendEvent(getReactApplicationContext(), "microphoneEnabled", map);
520
+                    sendEvent(getReactApplicationContext(), AGMicrophoneEnabled, map);
455 521
                 }
456 522
 
457 523
             });
@@ -474,7 +540,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
474 540
                     WritableMap map = Arguments.createMap();
475 541
                     map.putArray("speakers", arr);
476 542
                     map.putInt("totalVolume", totalVolume);
477
-                    sendEvent(getReactApplicationContext(), "audioVolumeIndication", map);
543
+                    sendEvent(getReactApplicationContext(), AGAudioVolumeIndication, map);
478 544
                 }
479 545
             });
480 546
         }
@@ -486,7 +552,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
486 552
                 public void run() {
487 553
                     WritableMap map = Arguments.createMap();
488 554
                     map.putInt("uid", uid);
489
-                    sendEvent(getReactApplicationContext(), "activeSpeaker", map);
555
+                    sendEvent(getReactApplicationContext(), AGActiveSpeaker, map);
490 556
                 }
491 557
             });
492 558
         }
@@ -498,7 +564,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
498 564
                 public void run() {
499 565
                     WritableMap map = Arguments.createMap();
500 566
                     map.putInt("elapsed", elapsed);
501
-                    sendEvent(getReactApplicationContext(), "firstLocalAudioFrame", map);
567
+                    sendEvent(getReactApplicationContext(), AGFirstLocalAudioFrame, map);
502 568
                 }
503 569
             });
504 570
         }
@@ -511,7 +577,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
511 577
                     WritableMap map = Arguments.createMap();
512 578
                     map.putInt("uid", uid);
513 579
                     map.putInt("elapsed", elapsed);
514
-                    sendEvent(getReactApplicationContext(), "firstRemoteAudioFrame", map);
580
+                    sendEvent(getReactApplicationContext(), AGFirstRemoteAudioFrame, map);
515 581
                 }
516 582
             });
517 583
         }
@@ -523,7 +589,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
523 589
                 public void run() {
524 590
                     WritableMap map = Arguments.createMap();
525 591
                     map.putString("message", "VideoStopped");
526
-                    sendEvent(getReactApplicationContext(), "videoStopped", map);
592
+                    sendEvent(getReactApplicationContext(), AGVideoStopped, map);
527 593
                 }
528 594
             });
529 595
         }
@@ -537,7 +603,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
537 603
                     map.putInt("width", width);
538 604
                     map.putInt("height", height);
539 605
                     map.putInt("elapsed", elapsed);
540
-                    sendEvent(getReactApplicationContext(), "firstLocalVideoFrame", map);
606
+                    sendEvent(getReactApplicationContext(), AGFirstLocalVideoFrame, map);
541 607
                 }
542 608
             });
543 609
         }
@@ -555,7 +621,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
555 621
                     map.putInt("width", width);
556 622
                     map.putInt("height", height);
557 623
                     map.putInt("elapsed", elapsed);
558
-                    sendEvent(getReactApplicationContext(), "firstRemoteVideoDecoded", map);
624
+                    sendEvent(getReactApplicationContext(), AGFirstRemoteVideoDecoded, map);
559 625
                 }
560 626
             });
561 627
         }
@@ -570,7 +636,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
570 636
                     map.putInt("width", width);
571 637
                     map.putInt("height", height);
572 638
                     map.putInt("elapsed", elapsed);
573
-                    sendEvent(getReactApplicationContext(), "firstRemoteVideoFrame", map);
639
+                    sendEvent(getReactApplicationContext(), AGFirstRemoteVideoFrame, map);
574 640
                 }
575 641
             });
576 642
         }
@@ -581,9 +647,9 @@ public class AgoraModule extends ReactContextBaseJavaModule {
581 647
                 @Override
582 648
                 public void run() {
583 649
                     WritableMap map = Arguments.createMap();
584
-                    map.putInt("uid", uid);
585 650
                     map.putBoolean("muted", muted);
586
-                    sendEvent(getReactApplicationContext(), "userMuteAudio", map);
651
+                    map.putInt("uid", uid);
652
+                    sendEvent(getReactApplicationContext(), AGUserMuteAudio, map);
587 653
                 }
588 654
             });
589 655
         }
@@ -594,35 +660,35 @@ public class AgoraModule extends ReactContextBaseJavaModule {
594 660
                 @Override
595 661
                 public void run() {
596 662
                     WritableMap map = Arguments.createMap();
597
-                    map.putInt("uid", uid);
598 663
                     map.putBoolean("muted", muted);
599
-                    sendEvent(getReactApplicationContext(), "userMuteVideo", map);
664
+                    map.putInt("uid", uid);
665
+                    sendEvent(getReactApplicationContext(), AGUserMuteVideo, map);
600 666
                 }
601 667
             });
602 668
         }
603 669
 
604 670
         @Override
605
-        public void onUserEnableVideo(final int uid, final boolean muted) {
671
+        public void onUserEnableVideo(final int uid, final boolean enabled) {
606 672
             runOnUiThread(new Runnable() {
607 673
                 @Override
608 674
                 public void run() {
609 675
                     WritableMap map = Arguments.createMap();
676
+                    map.putBoolean("enabled", enabled);
610 677
                     map.putInt("uid", uid);
611
-                    map.putBoolean("muted", muted);
612
-                    sendEvent(getReactApplicationContext(), "userEnableVideo", map);
678
+                    sendEvent(getReactApplicationContext(), AGUserEnableVideo, map);
613 679
                 }
614 680
             });
615 681
         }
616 682
 
617 683
         @Override
618
-        public void onUserEnableLocalVideo(final int uid, final boolean muted) {
684
+        public void onUserEnableLocalVideo(final int uid, final boolean enabled) {
619 685
             runOnUiThread(new Runnable() {
620 686
                 @Override
621 687
                 public void run() {
622 688
                     WritableMap map = Arguments.createMap();
689
+                    map.putBoolean("enabled", enabled);
623 690
                     map.putInt("uid", uid);
624
-                    map.putBoolean("muted", muted);
625
-                    sendEvent(getReactApplicationContext(), "userEnableLocalVideo", map);
691
+                    sendEvent(getReactApplicationContext(), AGUserEnableLocalVideo, map);
626 692
                 }
627 693
             });
628 694
         }
@@ -637,7 +703,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
637 703
                     map.putInt("width", width);
638 704
                     map.putInt("height", height);
639 705
                     map.putInt("rotation", rotation);
640
-                    sendEvent(getReactApplicationContext(), "videoSizeChanged", map);
706
+                    sendEvent(getReactApplicationContext(), AGVideoSizeChanged, map);
641 707
                 }
642 708
             });
643 709
         }
@@ -650,7 +716,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
650 716
                     WritableMap map = Arguments.createMap();
651 717
                     map.putInt("uid", uid);
652 718
                     map.putInt("state", state);
653
-                    sendEvent(getReactApplicationContext(), "remoteVideoStateChanged", map);
719
+                    sendEvent(getReactApplicationContext(), AGRemoteVideoStateChanged, map);
654 720
                 }
655 721
             });
656 722
         }
@@ -662,7 +728,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
662 728
                 public void run() {
663 729
                     WritableMap map = Arguments.createMap();
664 730
                     map.putBoolean("isFallbackOrRecover", isFallbackOrRecover);
665
-                    sendEvent(getReactApplicationContext(), "localPublishFallbackToAudioOnly", map);
731
+                    sendEvent(getReactApplicationContext(), AGLocalPublishFallbackToAudioOnly, map);
666 732
                 }
667 733
             });
668 734
         }
@@ -673,9 +739,9 @@ public class AgoraModule extends ReactContextBaseJavaModule {
673 739
                 @Override
674 740
                 public void run() {
675 741
                     WritableMap map = Arguments.createMap();
676
-                    map.putInt("uid", uid);
677 742
                     map.putBoolean("isFallbackOrRecover", isFallbackOrRecover);
678
-                    sendEvent(getReactApplicationContext(), "remoteSubscribeFallbackToAudioOnly", map);
743
+                    map.putInt("uid", uid);
744
+                    sendEvent(getReactApplicationContext(), AGRemoteSubscribeFallbackToAudioOnly, map);
679 745
                 }
680 746
             });
681 747
         }
@@ -687,7 +753,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
687 753
                 public void run() {
688 754
                     WritableMap map = Arguments.createMap();
689 755
                     map.putInt("routing", routing);
690
-                    sendEvent(getReactApplicationContext(), "audioRouteChanged", map);
756
+                    sendEvent(getReactApplicationContext(), AGAudioRouteChanged, map);
691 757
                 }
692 758
             });
693 759
         }
@@ -699,7 +765,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
699 765
                 public void run() {
700 766
                     WritableMap map = Arguments.createMap();
701 767
                     map.putString("message", "CameraDidReady");
702
-                    sendEvent(getReactApplicationContext(), "cameraReady", map);
768
+                    sendEvent(getReactApplicationContext(), AGCameraReady, map);
703 769
                 }
704 770
             });
705 771
         }
@@ -716,7 +782,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
716 782
                     rectMap.putInt("left", rect.left);
717 783
                     WritableMap map = Arguments.createMap();
718 784
                     map.putMap("rect", rectMap);
719
-                    sendEvent(getReactApplicationContext(), "cameraFocusAreaChanged", map);
785
+                    sendEvent(getReactApplicationContext(), AGCameraFocusAreaChanged, map);
720 786
                 }
721 787
             });
722 788
         }
@@ -733,7 +799,25 @@ public class AgoraModule extends ReactContextBaseJavaModule {
733 799
                     rectMap.putInt("left", rect.left);
734 800
                     WritableMap map = Arguments.createMap();
735 801
                     map.putMap("rect", rectMap);
736
-                    sendEvent(getReactApplicationContext(), "cameraExposureAreaChanged", map);
802
+                    sendEvent(getReactApplicationContext(), AGCameraExposureAreaChanged, map);
803
+                }
804
+            });
805
+        }
806
+
807
+        @Override
808
+        public void onRemoteAudioStats(final RemoteAudioStats stats) {
809
+            runOnUiThread(new Runnable() {
810
+                @Override
811
+                public void run() {
812
+                    WritableMap statsMap = Arguments.createMap();
813
+                    statsMap.putInt("uid", stats.uid);
814
+                    statsMap.putInt("quality", stats.quality);
815
+                    statsMap.putInt("networkTransportDelay", stats.networkTransportDelay);
816
+                    statsMap.putInt("jitterBufferDelay", stats.jitterBufferDelay);
817
+                    statsMap.putInt("audioLossRate", stats.audioLossRate);
818
+                    WritableMap map = Arguments.createMap();
819
+                    map.putMap("stats", statsMap);
820
+                    sendEvent(getReactApplicationContext(), AGRemoteAudioStats, map);
737 821
                 }
738 822
             });
739 823
         }
@@ -744,23 +828,21 @@ public class AgoraModule extends ReactContextBaseJavaModule {
744 828
                 @Override
745 829
                 public void run() {
746 830
                     WritableMap statsMap = Arguments.createMap();
747
-                    statsMap.putInt("totalDuration", stats.totalDuration);
831
+                    statsMap.putInt("duration", stats.totalDuration);
748 832
                     statsMap.putInt("txBytes", stats.txBytes);
749 833
                     statsMap.putInt("rxBytes", stats.rxBytes);
750
-                    statsMap.putInt("txKBitRate", stats.txKBitRate);
751
-                    statsMap.putInt("rxKBitRate", stats.rxKBitRate);
752 834
                     statsMap.putInt("txAudioKBitRate", stats.txAudioKBitRate);
753 835
                     statsMap.putInt("rxAudioKBitRate", stats.rxAudioKBitRate);
754 836
                     statsMap.putInt("txVideoKBitRate", stats.txVideoKBitRate);
755 837
                     statsMap.putInt("rxVideoKBitRate", stats.rxVideoKBitRate);
756
-                    statsMap.putInt("users", stats.users);
757 838
                     statsMap.putInt("lastmileDelay", stats.lastmileDelay);
758
-                    statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
839
+                    statsMap.putInt("userCount", stats.users);
759 840
                     statsMap.putDouble("cpuAppUsage", stats.cpuAppUsage);
841
+                    statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
760 842
 
761 843
                     WritableMap map = Arguments.createMap();
762 844
                     map.putMap("stats", statsMap);
763
-                    sendEvent(getReactApplicationContext(), "rtcStats", map);
845
+                    sendEvent(getReactApplicationContext(), AGRtcStats, map);
764 846
                 }
765 847
             });
766 848
         }
@@ -772,7 +854,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
772 854
                 public void run() {
773 855
                     WritableMap map = Arguments.createMap();
774 856
                     map.putInt("quality", quality);
775
-                    sendEvent(getReactApplicationContext(), "lastmileQuality", map);
857
+                    sendEvent(getReactApplicationContext(), AGLastmileQuality, map);
776 858
                 }
777 859
             });
778 860
         }
@@ -786,7 +868,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
786 868
                     map.putInt("uid", uid);
787 869
                     map.putInt("txQuality", txQuality);
788 870
                     map.putInt("rxQuality", rxQuality);
789
-                    sendEvent(getReactApplicationContext(), "networkQuality", map);
871
+                    sendEvent(getReactApplicationContext(), AGNetworkQuality, map);
790 872
                 }
791 873
             });
792 874
         }
@@ -803,7 +885,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
803 885
 
804 886
                     WritableMap map = Arguments.createMap();
805 887
                     map.putMap("stats", statsMap);
806
-                    sendEvent(getReactApplicationContext(), "localVideoStats", map);
888
+                    sendEvent(getReactApplicationContext(), AGLocalVideoStats, map);
807 889
                 }
808 890
             });
809 891
         }
@@ -815,30 +897,14 @@ public class AgoraModule extends ReactContextBaseJavaModule {
815 897
                 public void run() {
816 898
                     WritableMap statsMap = Arguments.createMap();
817 899
                     statsMap.putInt("uid", stats.uid);
900
+                    statsMap.putInt("width", stats.width);
901
+                    statsMap.putInt("height", stats.height);
818 902
                     statsMap.putInt("receivedBitrate", stats.receivedBitrate);
819 903
                     statsMap.putInt("receivedFrameRate", stats.receivedFrameRate);
820 904
                     statsMap.putInt("rxStreamType", stats.rxStreamType);
821 905
                     WritableMap map = Arguments.createMap();
822 906
                     map.putMap("stats", statsMap);
823
-                    sendEvent(getReactApplicationContext(), "remoteVideoStats", map);
824
-                }
825
-            });
826
-        }
827
-
828
-        @Override
829
-        public void onRemoteAudioStats(final RemoteAudioStats stats) {
830
-            runOnUiThread(new Runnable() {
831
-                @Override
832
-                public void run() {
833
-                    WritableMap statsMap = Arguments.createMap();
834
-                    statsMap.putInt("uid", stats.uid);
835
-                    statsMap.putInt("quality", stats.quality);
836
-                    statsMap.putInt("networkTransportDelay", stats.networkTransportDelay);
837
-                    statsMap.putInt("jitterBufferDelay", stats.jitterBufferDelay);
838
-                    statsMap.putInt("audioLossRate", stats.audioLossRate);
839
-                    WritableMap map = Arguments.createMap();
840
-                    map.putMap("stats", statsMap);
841
-                    sendEvent(getReactApplicationContext(), "remoteAudioStats", map);
907
+                    sendEvent(getReactApplicationContext(), AGRemoteVideoStats, map);
842 908
                 }
843 909
             });
844 910
         }
@@ -858,7 +924,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
858 924
                     statsMap.putInt("rxKBitRate", rxKBitRate);
859 925
                     WritableMap map = Arguments.createMap();
860 926
                     map.putMap("stats", statsMap);
861
-                    sendEvent(getReactApplicationContext(), "remoteAudioTransportStats", map);
927
+                    sendEvent(getReactApplicationContext(), AGAudioTransportStatsOfUid, map);
862 928
                 }
863 929
             });
864 930
         }
@@ -878,7 +944,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
878 944
                     statsMap.putInt("rxKBitRate", rxKBitRate);
879 945
                     WritableMap map = Arguments.createMap();
880 946
                     map.putMap("stats", statsMap);
881
-                    sendEvent(getReactApplicationContext(), "remoteVideoTransportStats", map);
947
+                    sendEvent(getReactApplicationContext(), AGVideoTransportStatsOfUid, map);
882 948
                 }
883 949
             });
884 950
         }
@@ -890,7 +956,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
890 956
                 public void run() {
891 957
                     WritableMap map = Arguments.createMap();
892 958
                     map.putString("message", "LocalAudioMixingSucceedFinish");
893
-                    sendEvent(getReactApplicationContext(), "audioMixingFinish", map);
959
+                    sendEvent(getReactApplicationContext(), AGLocalAudioMixingFinish, map);
894 960
                 }
895 961
             });
896 962
         }
@@ -902,20 +968,20 @@ public class AgoraModule extends ReactContextBaseJavaModule {
902 968
                 public void run() {
903 969
                     WritableMap map = Arguments.createMap();
904 970
                     map.putInt("soundId", soundId);
905
-                    sendEvent(getReactApplicationContext(), "audioEffectFinished", map);
971
+                    sendEvent(getReactApplicationContext(), AGAudioEffectFinish, map);
906 972
                 }
907 973
             });
908 974
         }
909 975
 
910 976
         @Override
911
-        public void onStreamPublished(final String url, final int error) {
977
+        public void onStreamPublished(final String url, final int errorCode) {
912 978
             runOnUiThread(new Runnable() {
913 979
                 @Override
914 980
                 public void run() {
915 981
                     WritableMap map = Arguments.createMap();
916 982
                     map.putString("url", url);
917
-                    map.putInt("error", error);
918
-                    sendEvent(getReactApplicationContext(), "streamPublished", map);
983
+                    map.putInt("code", errorCode);
984
+                    sendEvent(getReactApplicationContext(), AGStreamPublished, map);
919 985
                 }
920 986
             });
921 987
         }
@@ -927,7 +993,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
927 993
                 public void run() {
928 994
                     WritableMap map = Arguments.createMap();
929 995
                     map.putString("url", url);
930
-                    sendEvent(getReactApplicationContext(), "streamUnpublished", map);
996
+                    sendEvent(getReactApplicationContext(), AGStreamUnpublish, map);
931 997
                 }
932 998
             });
933 999
         }
@@ -938,8 +1004,8 @@ public class AgoraModule extends ReactContextBaseJavaModule {
938 1004
                 @Override
939 1005
                 public void run() {
940 1006
                     WritableMap map = Arguments.createMap();
941
-                    map.putString("message", "TranscodingUpdated");
942
-                    sendEvent(getReactApplicationContext(), "transcodingUpdated", map);
1007
+                    map.putString("message", "AGTranscodingUpdate");
1008
+                    sendEvent(getReactApplicationContext(), AGTranscodingUpdate, map);
943 1009
                 }
944 1010
             });
945 1011
         }
@@ -950,10 +1016,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
950 1016
                 @Override
951 1017
                 public void run() {
952 1018
                     WritableMap map = Arguments.createMap();
953
-                    map.putString("url", url);
954 1019
                     map.putInt("uid", uid);
1020
+                    map.putString("url", url);
955 1021
                     map.putInt("status", status);
956
-                    sendEvent(getReactApplicationContext(), "streamInjectedStatus", map);
1022
+                    sendEvent(getReactApplicationContext(), AGStreamInjectedStatus, map);
957 1023
                 }
958 1024
             });
959 1025
         }
@@ -971,24 +1037,23 @@ public class AgoraModule extends ReactContextBaseJavaModule {
971 1037
                     map.putInt("uid", uid);
972 1038
                     map.putInt("streamId", streamId);
973 1039
                     map.putString("data", msg);
974
-                    sendEvent(getReactApplicationContext(), "streamMessage", map);
1040
+                    sendEvent(getReactApplicationContext(), AGReceiveStreamMessage, map);
975 1041
                 }
976 1042
             });
977 1043
         }
978 1044
 
979 1045
         @Override
980
-        public void onStreamMessageError(final int uid, final int streamId, final int code, final int missed, final int cached) {
1046
+        public void onStreamMessageError(final int uid, final int streamId, final int error, final int missed, final int cached) {
981 1047
             runOnUiThread(new Runnable() {
982 1048
                 @Override
983 1049
                 public void run() {
984 1050
                     WritableMap map = Arguments.createMap();
985
-                    map.putString("type", "streamMessageError");
986 1051
                     map.putInt("uid", uid);
987 1052
                     map.putInt("streamId", streamId);
988
-                    map.putInt("error", code);
1053
+                    map.putInt("error", error);
989 1054
                     map.putInt("missed", missed);
990 1055
                     map.putInt("cached", cached);
991
-                    sendEvent(getReactApplicationContext(), "streamMessageError", map);
1056
+                    sendEvent(getReactApplicationContext(), AGOccurStreamMessageError, map);
992 1057
                 }
993 1058
             });
994 1059
         }
@@ -999,8 +1064,8 @@ public class AgoraModule extends ReactContextBaseJavaModule {
999 1064
                 @Override
1000 1065
                 public void run() {
1001 1066
                     WritableMap map = Arguments.createMap();
1002
-                    map.putString("message", "mediaEngineLoadSuccess");
1003
-                    sendEvent(getReactApplicationContext(), "mediaEngineLoadSuccess", map);
1067
+                    map.putString("message", "MediaEngineLoaded");
1068
+                    sendEvent(getReactApplicationContext(), AGMediaEngineLoaded, map);
1004 1069
                 }
1005 1070
             });
1006 1071
         }
@@ -1011,8 +1076,8 @@ public class AgoraModule extends ReactContextBaseJavaModule {
1011 1076
                 @Override
1012 1077
                 public void run() {
1013 1078
                     WritableMap map = Arguments.createMap();
1014
-                    map.putString("message", "mediaEngineStartCallSuccess");
1015
-                    sendEvent(getReactApplicationContext(), "mediaEngineStartCallSuccess", map);
1079
+                    map.putString("message", "AGMediaEngineStartCall");
1080
+                    sendEvent(getReactApplicationContext(), AGMediaEngineStartCall, map);
1016 1081
                 }
1017 1082
             });
1018 1083
         }

+ 62
- 66
ios/RCTAgora/AgoraConst.h View File

@@ -10,72 +10,68 @@
10 10
 
11 11
 static NSString *RCTAgoraErrorDomain = @"RCTAgoraErrorDomain";
12 12
 
13
-static NSString *DidOccurWarning = @"warning";
14
-static NSString *DidOccurError = @"error";
15
-static NSString *DidApiCallExecute = @"apiCallExecute";
16
-static NSString *DidJoinChannel = @"joinChannelSuccess";
17
-static NSString *DidRejoinChannel = @"rejoinChannelSuccess";
18
-static NSString *DidLeaveChannel = @"leaveChannel";
19
-static NSString *DidClientRoleChanged = @"clientRoleChanged";
20
-static NSString *DidJoinedOfUid = @"userJoined";
21
-static NSString *DidOfflineOfUid = @"userOffline";
22
-static NSString *ConnectionChangedToState = @"connectionStateChanged";
23
-static NSString *ConnectionDidLost = @"connectionLost";
24
-static NSString *TokenPrivilegeWillExpire = @"tokenPrivilegeWillExpire";
25
-static NSString *RequestToken = @"requestToken";
26
-
27
-static NSString *DidMicrophoneEnabled = @"microphoneEnabled";
28
-static NSString *ReportAudioVolumeIndicationOfSpeakers = @"audioVolumeIndication";
29
-static NSString *ActiveSpeaker = @"activeSpeaker";
30
-static NSString *FirstLocalAudioFrame = @"firstLocalAudioFrame";
31
-static NSString *FirstRemoteAudioFrameOfUid = @"firstRemoteAudioFrame";
32
-static NSString *VideoDidStop = @"videoStopped";
33
-static NSString *FirstLocalVideoFrameWithSize = @"firstLocalVideoFrame";
34
-static NSString *FirstRemoteVideoDecodedOfUid = @"firstRemoteVideoDecoded";
35
-static NSString *FirstRemoteVideoFrameOfUid = @"firstRemoteVideoFrame";
36
-static NSString *DidAudioMuted = @"userMuteAudio";
37
-static NSString *DidVideoMuted = @"userMuteVideo";
38
-static NSString *DidVideoEnabled = @"userEnableVideo";
39
-static NSString *DidLocalVideoEnabled = @"userEnableLocalVideo";
40
-static NSString *VideoSizeChangedOfUid = @"videoSizeChanged";
41
-static NSString *RemoteVideoStateChangedOfUid = @"remoteVideoStateChanged";
42
-static NSString *DidLocalPublishFallbackToAudioOnly = @"localPublishFallbackToAudioOnly";
43
-static NSString *DidRemoteSubscribeFallbackToAudioOnly = @"remoteSubscribeFallbackToAudioOnly";
44
-
45
-static NSString *DidAudioRouteChanged = @"audioRouteChanged";
46
-static NSString *CameraDidReady = @"cameraReady";
47
-static NSString *CameraFocusDidChangedToRect = @"cameraFocusAreaChanged";
48
-static NSString *CameraExposureDidChangedToRect = @"cameraExposureAreaChanged";
49
-
50
-static NSString *ReportRtcStats = @"rtcStats";
51
-static NSString *LastmileQuality = @"lastmileQuality";
52
-static NSString *NetworkQuality = @"networkQuality";
53
-static NSString *LocalVideoStats = @"localVideoStats";
54
-static NSString *RemoteVideoStats = @"remoteVideoStats";
55
-static NSString *RemoteAudioStats = @"remoteAudioStats";
56
-static NSString *AudioTransportStatsOfUid = @"audioTransportStatsOfUid";
57
-static NSString *VideoTransportStatsOfUid = @"videoTransportStatsOfUid";
58
-
59
-static NSString *LocalAudioMixingDidFinish = @"localAudioMixingFinish";
60
-static NSString *RemoteAudioMixingDidStart = @"remoteAudioMixingStart";
61
-static NSString *RemoteAudioMixingDidFinish = @"remoteAudioMixingFinish";
62
-static NSString *DidAudioEffectFinish = @"audioEffectFinish";
63
-
64
-static NSString *StreamPublished = @"streamPublished";
65
-static NSString *StreamUnpublish = @"streamUnpublish";
66
-static NSString *TranscodingUpdated = @"transcodingUpdate";
67
-
68
-static NSString *StreamInjectedStatus = @"streamInjectedStatus";
69
-
70
-static NSString *ReceiveStreamMessage = @"receiveStreamMessage";
71
-static NSString *DidOccurStreamMessageError = @"occurStreamMessageError";
72
-
73
-static NSString *MediaEngineDidLoaded = @"mediaEngineLoaded";
74
-static NSString *MediaEngineDidStartCall = @"mediaEngineStartCall";
75
-
76
-static NSString *ConnectionDidInterrupted = @"connectionInterrupted";
77
-static NSString *ConnectionDidBanned = @"connectionBanned";
78
-static NSString *AudioQualityOfUid = @"audioQuality";
13
+static NSString *AGWarning = @"warning";
14
+static NSString *AGError = @"error";
15
+static NSString *AGApiCallExecute = @"apiCallExecute";
16
+static NSString *AGJoinChannelSuccess = @"joinChannelSuccess";
17
+static NSString *AGRejoinChannelSuccess = @"rejoinChannelSuccess";
18
+static NSString *AGLeaveChannel = @"leaveChannel";
19
+static NSString *AGClientRoleChanged = @"clientRoleChanged";
20
+static NSString *AGUserJoined = @"userJoined";
21
+static NSString *AGUserOffline = @"userOffline";
22
+static NSString *AGConnectionStateChanged = @"connectionStateChanged";
23
+static NSString *AGConnectionLost = @"connectionLost";
24
+static NSString *AGTokenPrivilegeWillExpire = @"tokenPrivilegeWillExpire";
25
+static NSString *AGRequestToken = @"requestToken";
26
+
27
+static NSString *AGMicrophoneEnabled = @"microphoneEnabled";
28
+static NSString *AGAudioVolumeIndication = @"audioVolumeIndication";
29
+static NSString *AGActiveSpeaker = @"activeSpeaker";
30
+static NSString *AGFirstLocalAudioFrame = @"firstLocalAudioFrame";
31
+static NSString *AGFirstRemoteAudioFrame = @"firstRemoteAudioFrame";
32
+static NSString *AGVideoStopped = @"videoStopped";
33
+static NSString *AGFirstLocalVideoFrame = @"firstLocalVideoFrame";
34
+static NSString *AGFirstRemoteVideoDecoded = @"firstRemoteVideoDecoded";
35
+static NSString *AGFirstRemoteVideoFrame = @"firstRemoteVideoFrame";
36
+static NSString *AGUserMuteAudio = @"userMuteAudio";
37
+static NSString *AGUserMuteVideo = @"userMuteVideo";
38
+static NSString *AGUserEnableVideo = @"userEnableVideo";
39
+static NSString *AGUserEnableLocalVideo = @"userEnableLocalVideo";
40
+static NSString *AGVideoSizeChanged = @"videoSizeChanged";
41
+static NSString *AGRemoteVideoStateChanged = @"remoteVideoStateChanged";
42
+static NSString *AGLocalPublishFallbackToAudioOnly = @"localPublishFallbackToAudioOnly";
43
+static NSString *AGRemoteSubscribeFallbackToAudioOnly = @"remoteSubscribeFallbackToAudioOnly";
44
+
45
+static NSString *AGAudioRouteChanged = @"audioRouteChanged";
46
+static NSString *AGCameraReady = @"cameraReady";
47
+static NSString *AGCameraFocusAreaChanged = @"cameraFocusAreaChanged";
48
+static NSString *AGCameraExposureAreaChanged = @"cameraExposureAreaChanged";
49
+
50
+static NSString *AGRtcStats = @"rtcStats";
51
+static NSString *AGLastmileQuality = @"lastmileQuality";
52
+static NSString *AGNetworkQuality = @"networkQuality";
53
+static NSString *AGLocalVideoStats = @"localVideoStats";
54
+static NSString *AGRemoteVideoStats = @"remoteVideoStats";
55
+static NSString *AGRemoteAudioStats = @"remoteAudioStats";
56
+static NSString *AGAudioTransportStatsOfUid = @"audioTransportStatsOfUid";
57
+static NSString *AGVideoTransportStatsOfUid = @"videoTransportStatsOfUid";
58
+
59
+static NSString *AGLocalAudioMixingFinish = @"localAudioMixingFinish";
60
+static NSString *AGRemoteAudioMixingStart = @"remoteAudioMixingStart";
61
+static NSString *AGRemoteAudioMixingFinish = @"remoteAudioMixingFinish";
62
+static NSString *AGAudioEffectFinish = @"audioEffectFinish";
63
+
64
+static NSString *AGStreamPublished = @"streamPublished";
65
+static NSString *AGStreamUnpublish = @"streamUnpublish";
66
+static NSString *AGTranscodingUpdate = @"transcodingUpdate";
67
+
68
+static NSString *AGStreamInjectedStatus = @"streamInjectedStatus";
69
+
70
+static NSString *AGReceiveStreamMessage = @"receiveStreamMessage";
71
+static NSString *AGOccurStreamMessageError = @"occurStreamMessageError";
72
+
73
+static NSString *AGMediaEngineLoaded = @"mediaEngineLoaded";
74
+static NSString *AGMediaEngineStartCall = @"mediaEngineStartCall";
79 75
 
80 76
 @interface AgoraConst : NSObject
81 77
 

+ 126
- 123
ios/RCTAgora/RCTAgora.m View File

@@ -234,7 +234,7 @@ RCT_EXPORT_METHOD(leaveChannel
234 234
                   :(RCTPromiseResolveBlock) resolve
235 235
                   reject:(RCTPromiseRejectBlock) reject) {
236 236
   int res = [self.rtcEngine leaveChannel:^(AgoraChannelStats * _Nonnull stat) {
237
-    [self sendEvent:DidLeaveChannel params:@{
237
+    [self sendEvent:AGLeaveChannel params:@{
238 238
                                              @"message": @"leaveChannel",
239 239
                                              @"duration": @(stat.duration),
240 240
                                              @"txBytes": @(stat.txBytes),
@@ -1660,72 +1660,68 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1660 1660
 
1661 1661
 - (NSArray<NSString *> *)supportedEvents {
1662 1662
   return @[
1663
-           DidOccurWarning,
1664
-           DidOccurError,
1665
-           DidApiCallExecute,
1666
-           DidJoinChannel,
1667
-           DidRejoinChannel,
1668
-           DidLeaveChannel,
1669
-           DidClientRoleChanged,
1670
-           DidJoinedOfUid,
1671
-           DidOfflineOfUid,
1672
-           ConnectionChangedToState,
1673
-           ConnectionDidLost,
1674
-           TokenPrivilegeWillExpire,
1675
-           RequestToken,
1663
+           AGWarning,
1664
+           AGError,
1665
+           AGApiCallExecute,
1666
+           AGJoinChannelSuccess,
1667
+           AGRejoinChannelSuccess,
1668
+           AGLeaveChannel,
1669
+           AGClientRoleChanged,
1670
+           AGUserJoined,
1671
+           AGUserOffline,
1672
+           AGConnectionStateChanged,
1673
+           AGConnectionLost,
1674
+           AGTokenPrivilegeWillExpire,
1675
+           AGRequestToken,
1676 1676
            
1677 1677
            DidMicrophoneEnabled,
1678
-           ReportAudioVolumeIndicationOfSpeakers,
1679
-           ActiveSpeaker,
1680
-           FirstLocalAudioFrame,
1681
-           FirstRemoteAudioFrameOfUid,
1682
-           VideoDidStop,
1683
-           FirstLocalVideoFrameWithSize,
1684
-           FirstRemoteVideoDecodedOfUid,
1685
-           FirstRemoteVideoFrameOfUid,
1686
-           DidAudioMuted,
1687
-           DidVideoMuted,
1688
-           DidVideoEnabled,
1689
-           DidLocalVideoEnabled,
1690
-           VideoSizeChangedOfUid,
1691
-           RemoteVideoStateChangedOfUid,
1692
-           DidLocalPublishFallbackToAudioOnly,
1693
-           DidRemoteSubscribeFallbackToAudioOnly,
1678
+           AGAudioVolumeIndication,
1679
+           AGActiveSpeaker,
1680
+           AGFirstLocalAudioFrame,
1681
+           AGFirstRemoteAudioFrame,
1682
+           AGVideoStopped,
1683
+           AGFirstLocalVideoFrame,
1684
+           AGFirstRemoteVideoDecoded,
1685
+           AGFirstRemoteVideoFrame,
1686
+           AGUserMuteAudio,
1687
+           AGUserMuteVideo,
1688
+           AGUserEnableVideo,
1689
+           AGUserEnableLocalVideo,
1690
+           AGVideoSizeChanged,
1691
+           AGRemoteVideoStateChanged,
1692
+           AGLocalPublishFallbackToAudioOnly,
1693
+           AGRemoteSubscribeFallbackToAudioOnly,
1694 1694
            
1695
-           DidAudioRouteChanged,
1696
-           CameraDidReady,
1697
-           CameraFocusDidChangedToRect,
1698
-           CameraExposureDidChangedToRect,
1695
+           AGAudioRouteChanged,
1696
+           AGCameraReady,
1697
+           AGCameraFocusAreaChanged,
1698
+           AGCameraExposureAreaChanged,
1699 1699
            
1700
-           ReportRtcStats,
1701
-           LastmileQuality,
1702
-           NetworkQuality,
1703
-           LocalVideoStats,
1704
-           RemoteVideoStats,
1705
-           RemoteAudioStats,
1706
-           AudioTransportStatsOfUid,
1707
-           VideoTransportStatsOfUid,
1700
+           AGRtcStats,
1701
+           AGLastmileQuality,
1702
+           AGNetworkQuality,
1703
+           AGLocalVideoStats,
1704
+           AGRemoteVideoStats,
1705
+           AGRemoteAudioStats,
1706
+           AGAudioTransportStatsOfUid,
1707
+           AGVideoTransportStatsOfUid,
1708 1708
            
1709
-           LocalAudioMixingDidFinish,
1710
-           RemoteAudioMixingDidStart,
1711
-           RemoteAudioMixingDidFinish,
1712
-           DidAudioEffectFinish,
1709
+           AGLocalAudioMixingFinish,
1710
+           AGRemoteAudioMixingStart,
1711
+           AGRemoteAudioMixingFinish,
1712
+           AGAudioEffectFinish,
1713 1713
            
1714
-           StreamPublished,
1715
-           StreamUnpublish,
1716
-           TranscodingUpdated,
1714
+           AGStreamPublished,
1715
+           AGStreamUnpublish,
1716
+           AGTranscodingUpdate,
1717 1717
            
1718
-           StreamInjectedStatus,
1718
+           AGStreamInjectedStatus,
1719 1719
            
1720
-           ReceiveStreamMessage,
1721
-           DidOccurStreamMessageError,
1720
+           AGReceiveStreamMessage,
1721
+           AGOccurStreamMessageError,
1722 1722
            
1723
-           MediaEngineDidLoaded,
1724
-           MediaEngineDidStartCall,
1725
-           
1726
-           ConnectionDidInterrupted,
1727
-           ConnectionDidBanned,
1728
-           AudioQualityOfUid
1723
+           AGMediaEngineLoaded,
1724
+           AGMediaEngineStartCall,
1729 1725
            ];
1730 1726
 }
1731 1727
 
@@ -1746,16 +1742,22 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1746 1742
 #pragma mark - <AgoraRtcEngineDelegate>
1747 1743
 // EVENT CALLBACKS
1748 1744
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurWarning:(AgoraWarningCode)warningCode {
1749
-  [self sendEvent:DidOccurWarning params:@{@"message": @"AgoraWarning", @"code": @(warningCode)}];
1745
+  [self sendEvent:AGWarning params:@{@"message": @"AgoraWarning", @"code": @(warningCode)}];
1750 1746
 }
1751 1747
 
1752 1748
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurError:(AgoraErrorCode)errorCode {
1753
-  [self sendEvent:DidOccurError params:@{@"message": @"AgoraError", @"code": @(errorCode)}];
1749
+  [self sendEvent:AGError params:@{@"message": @"AgoraError", @"code": @(errorCode)}];
1754 1750
 }
1755 1751
 
1756 1752
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didApiCallExecute:(NSInteger)error api:(NSString *_Nonnull)api result:(NSString *_Nonnull)result {
1757 1753
   if (error != 0) {
1758
-    [self sendEvent:DidOccurError  params:@{
1754
+    [self sendEvent:AGError  params:@{
1755
+                                            @"api": api,
1756
+                                            @"result": result,
1757
+                                            @"error": @(error)
1758
+                                            }];
1759
+  } else {
1760
+    [self sendEvent:AGApiCallExecute  params:@{
1759 1761
                                             @"api": api,
1760 1762
                                             @"result": result,
1761 1763
                                             @"error": @(error)
@@ -1764,7 +1766,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1764 1766
 }
1765 1767
 
1766 1768
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didJoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1767
-  [self sendEvent:DidJoinChannel params:@{
1769
+  [self sendEvent:AGJoinChannelSuccess params:@{
1768 1770
                                           @"channel": channel,
1769 1771
                                           @"uid": @(uid),
1770 1772
                                           @"elapsed": @(elapsed)
@@ -1772,7 +1774,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1772 1774
 }
1773 1775
 
1774 1776
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didRejoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1775
-  [self sendEvent:DidRejoinChannel params:@{
1777
+  [self sendEvent:AGRejoinChannelSuccess params:@{
1776 1778
                                             @"channel": channel,
1777 1779
                                             @"uid": @(uid),
1778 1780
                                             @"elapsed": @(elapsed)
@@ -1780,7 +1782,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1780 1782
 }
1781 1783
 
1782 1784
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLeaveChannelWithStats:(AgoraChannelStats *_Nonnull)stats {
1783
-  [self sendEvent:DidLeaveChannel params:@{
1785
+  [self sendEvent:AGLeaveChannel params:@{
1784 1786
                                            @"stats": @{
1785 1787
                                                @"duration": @(stats.duration),
1786 1788
                                                @"txBytes": @(stats.txBytes),
@@ -1798,53 +1800,53 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1798 1800
 }
1799 1801
 
1800 1802
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didClientRoleChanged:(AgoraClientRole)oldRole newRole:(AgoraClientRole)newRole {
1801
-  [self sendEvent:DidClientRoleChanged params:@{
1803
+  [self sendEvent:AGClientRoleChanged params:@{
1802 1804
                                                 @"oldRole": @(oldRole),
1803 1805
                                                 @"newRole": @(newRole)
1804 1806
                                                 }];
1805 1807
 }
1806 1808
 
1807 1809
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1808
-  [self sendEvent:DidJoinedOfUid params:@{
1810
+  [self sendEvent:AGUserJoined params:@{
1809 1811
                                           @"uid": @(uid),
1810 1812
                                           @"elapsed": @(elapsed)
1811 1813
                                           }];
1812 1814
 }
1813 1815
 
1814 1816
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason {
1815
-  [self sendEvent:DidOfflineOfUid params:@{
1817
+  [self sendEvent:AGUserOffline params:@{
1816 1818
                                            @"uid": @(uid),
1817 1819
                                            @"reason": @(reason)
1818 1820
                                            }];
1819 1821
 }
1820 1822
 
1821 1823
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine connectionChangedToState:(AgoraConnectionStateType)state reason:(AgoraConnectionChangedReason)reason {
1822
-  [self sendEvent:ConnectionChangedToState params:@{
1824
+  [self sendEvent:AGConnectionStateChanged params:@{
1823 1825
                                                     @"state": @(state),
1824 1826
                                                     @"reason": @(reason)
1825 1827
                                                     }];
1826 1828
 }
1827 1829
 
1828 1830
 - (void)rtcEngineConnectionDidLost:(AgoraRtcEngineKit *_Nonnull)engine {
1829
-  [self sendEvent:ConnectionDidLost params:@{
1830
-                                             @"message": @"ConnectionDidLost"
1831
+  [self sendEvent:AGConnectionLost params:@{
1832
+                                             @"message": @"connectionLost"
1831 1833
                                              }];
1832 1834
 }
1833 1835
 
1834 1836
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine tokenPrivilegeWillExpire:(NSString *_Nonnull)token {
1835
-  [self sendEvent:TokenPrivilegeWillExpire params:@{
1837
+  [self sendEvent:AGTokenPrivilegeWillExpire params:@{
1836 1838
                                                     @"token": token
1837 1839
                                                     }];
1838 1840
 }
1839 1841
 
1840 1842
 - (void)rtcEngineRequestToken:(AgoraRtcEngineKit *_Nonnull)engine {
1841
-  [self sendEvent:RequestToken params:@{
1843
+  [self sendEvent:AGRequestToken params:@{
1842 1844
                                         @"message": @"RequestToken"
1843 1845
                                         }];
1844 1846
 }
1845 1847
 
1846 1848
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didMicrophoneEnabled:(BOOL)enabled {
1847
-  [self sendEvent:DidMicrophoneEnabled params:@{
1849
+  [self sendEvent:AGMicrophoneEnabled params:@{
1848 1850
                                                 @"enabled": @(enabled)
1849 1851
                                                 }];
1850 1852
 }
@@ -1857,144 +1859,145 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1857 1859
                         @"volume": @(speaker.volume)
1858 1860
                         }];
1859 1861
   }
1860
-  [self sendEvent:ReportAudioVolumeIndicationOfSpeakers params:@{
1862
+  [self sendEvent:AGAudioVolumeIndication params:@{
1861 1863
                                                                  @"speakers": result,
1862 1864
                                                                  @"totalVolume": @(totalVolume)
1863 1865
                                                                  }];
1864 1866
 }
1865 1867
 
1866 1868
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine activeSpeaker:(NSUInteger)speakerUid {
1867
-  [self sendEvent:ActiveSpeaker params:@{
1868
-                                         @"speakerUid": @(speakerUid)
1869
+  [self sendEvent:AGActiveSpeaker params:@{
1870
+                                         @"uid": @(speakerUid)
1869 1871
                                          }];
1870 1872
 }
1871 1873
 
1872 1874
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstLocalAudioFrame:(NSInteger)elapsed {
1873
-  [self sendEvent:FirstLocalAudioFrame params:@{
1875
+  [self sendEvent:AGFirstLocalAudioFrame params:@{
1874 1876
                                                 @"elapsed": @(elapsed)
1875 1877
                                                 }];
1876 1878
 }
1877 1879
 
1878 1880
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteAudioFrameOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1879
-  [self sendEvent:FirstRemoteAudioFrameOfUid params:@{
1881
+  [self sendEvent:AGFirstRemoteAudioFrame params:@{
1880 1882
                                                       @"uid": @(uid),
1881 1883
                                                       @"elapsed": @(elapsed)
1882 1884
                                                       }];
1883 1885
 }
1884 1886
 
1885 1887
 - (void)rtcEngineVideoDidStop:(AgoraRtcEngineKit *_Nonnull)engine {
1886
-  [self sendEvent:VideoDidStop params:@{
1888
+  [self sendEvent:AGVideoStopped params:@{
1887 1889
                                         @"message": @"VideoStopped"
1888 1890
                                         }];
1889 1891
 }
1890 1892
 
1891 1893
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstLocalVideoFrameWithSize:(CGSize)size elapsed:(NSInteger)elapsed {
1892
-  [self sendEvent:FirstLocalVideoFrameWithSize params:@{
1893
-                                                        @"size": @(size),
1894
+  [self sendEvent:AGFirstLocalVideoFrame params:@{
1895
+                                                        @"width": @(size.width),
1896
+                                                        @"height": @(size.height),
1894 1897
                                                         @"elapsed": @(elapsed)
1895 1898
                                                         }];
1896 1899
 }
1897 1900
 
1898 1901
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteVideoDecodedOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed {
1899
-  [self sendEvent:FirstRemoteVideoDecodedOfUid params:@{
1902
+  [self sendEvent:AGFirstRemoteVideoDecoded params:@{
1900 1903
                                                         @"uid": @(uid),
1901
-                                                        @"size": @(size),
1904
+                                                        @"width": @(size.width),
1905
+                                                        @"height": @(size.height),
1902 1906
                                                         @"elapsed": @(elapsed)
1903 1907
                                                         }];
1904 1908
 }
1905 1909
 
1906 1910
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteVideoFrameOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed {
1907
-  [self sendEvent:FirstRemoteVideoFrameOfUid params:@{
1911
+  [self sendEvent:AGFirstRemoteVideoFrame params:@{
1908 1912
                                                       @"uid": @(uid),
1909
-                                                      @"size": @(size),
1913
+                                                      @"width": @(size.width),
1914
+                                                      @"height": @(size.height),
1910 1915
                                                       @"elapsed": @(elapsed)}];
1911 1916
 }
1912 1917
 
1913 1918
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didAudioMuted:(BOOL)muted byUid:(NSUInteger)uid {
1914
-  [self sendEvent:DidAudioMuted params:@{
1919
+  [self sendEvent:AGUserMuteAudio params:@{
1915 1920
                                          @"muted": @(muted),
1916 1921
                                          @"uid": @(uid)
1917 1922
                                          }];
1918 1923
 }
1919 1924
 
1920 1925
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didVideoMuted:(BOOL)muted byUid:(NSUInteger)uid {
1921
-  [self sendEvent:DidVideoMuted params:@{
1926
+  [self sendEvent:AGUserMuteVideo params:@{
1922 1927
                                          @"muted": @(muted),
1923 1928
                                          @"uid": @(uid)
1924 1929
                                          }];
1925 1930
 }
1926 1931
 
1927 1932
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid {
1928
-  [self sendEvent:DidVideoEnabled params:@{
1933
+  [self sendEvent:AGUserEnableVideo params:@{
1929 1934
                                            @"enabled": @(enabled),
1930 1935
                                            @"uid": @(uid)
1931 1936
                                            }];
1932 1937
 }
1933 1938
 
1934 1939
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLocalVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid {
1935
-  [self sendEvent:DidLocalVideoEnabled params:@{
1940
+  [self sendEvent:AGUserEnableLocalVideo params:@{
1936 1941
                                                 @"enabled": @(enabled),
1937 1942
                                                 @"uid": @(uid)
1938 1943
                                                 }];
1939 1944
 }
1940 1945
 
1941 1946
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine videoSizeChangedOfUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation {
1942
-  [self sendEvent:VideoSizeChangedOfUid params:@{
1947
+  [self sendEvent:AGVideoSizeChanged params:@{
1943 1948
                                                  @"uid": @(uid),
1944
-                                                 @"size": @{
1945
-                                                     @"width": @(size.width),
1946
-                                                     @"height": @(size.height)
1947
-                                                     },
1949
+                                                 @"width": @(size.width),
1950
+                                                 @"height": @(size.height)
1948 1951
                                                  @"roration": @(rotation)
1949 1952
                                                  }];
1950 1953
 }
1951 1954
 
1952 1955
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state {
1953
-  [self sendEvent:RemoteVideoStateChangedOfUid params:@{
1956
+  [self sendEvent:AGRemoteVideoStateChanged params:@{
1954 1957
                                                         @"uid": @(uid),
1955 1958
                                                         @"state": @(state)
1956 1959
                                                         }];
1957 1960
 }
1958 1961
 
1959 1962
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLocalPublishFallbackToAudioOnly:(BOOL)isFallbackOrRecover {
1960
-  [self sendEvent:DidLocalPublishFallbackToAudioOnly params:@{
1963
+  [self sendEvent:AGLocalPublishFallbackToAudioOnly params:@{
1961 1964
                                                               @"isFallbackOrRecover": @(isFallbackOrRecover)
1962 1965
                                                               }];
1963 1966
 }
1964 1967
 
1965 1968
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didRemoteSubscribeFallbackToAudioOnly:(BOOL)isFallbackOrRecover byUid:(NSUInteger)uid {
1966
-  [self sendEvent:DidRemoteSubscribeFallbackToAudioOnly params:@{
1969
+  [self sendEvent:AGRemoteSubscribeFallbackToAudioOnly params:@{
1967 1970
                                                                  @"isFallbackOrRecover": @(isFallbackOrRecover),
1968 1971
                                                                  @"uid": @(uid)
1969 1972
                                                                  }];
1970 1973
 }
1971 1974
 
1972 1975
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didAudioRouteChanged:(AgoraAudioOutputRouting)routing {
1973
-  [self sendEvent:DidAudioRouteChanged params:@{
1976
+  [self sendEvent:AGAudioRouteChanged params:@{
1974 1977
                                                 @"routing": @(routing)
1975 1978
                                                 }];
1976 1979
 }
1977 1980
 
1978 1981
 - (void)rtcEngineCameraDidReady:(AgoraRtcEngineKit *_Nonnull)engine {
1979
-  [self sendEvent:CameraDidReady params:@{
1982
+  [self sendEvent:AGCameraReady params:@{
1980 1983
                                           @"message": @"CameraDidReady"
1981 1984
                                           }];
1982 1985
 }
1983 1986
 
1984 1987
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine cameraFocusDidChangedToRect:(CGRect)rect {
1985
-  [self sendEvent:CameraFocusDidChangedToRect params:@{
1988
+  [self sendEvent:AGCameraFocusAreaChanged params:@{
1986 1989
                                                        @"rect": @(rect)
1987 1990
                                                        }];
1988 1991
 }
1989 1992
 
1990 1993
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine cameraExposureDidChangedToRect:(CGRect)rect {
1991
-  [self sendEvent:CameraExposureDidChangedToRect params:@{
1994
+  [self sendEvent:AGCameraExposureAreaChanged params:@{
1992 1995
                                                           @"rect": @(rect)
1993 1996
                                                           }];
1994 1997
 }
1995 1998
 
1996 1999
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteAudioStats:(AgoraRtcRemoteAudioStats *_Nonnull)stats {
1997
-  [self sendEvent:RemoteAudioStats params:@{
2000
+  [self sendEvent:AGRemoteAudioStats params:@{
1998 2001
                                             @"stats": @{
1999 2002
                                                 @"uid": @(stats.uid),
2000 2003
                                                 @"quality": @(stats.quality),
@@ -2006,7 +2009,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2006 2009
 }
2007 2010
 
2008 2011
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine reportRtcStats:(AgoraChannelStats *_Nonnull)stats {
2009
-  [self sendEvent:ReportRtcStats params:@{
2012
+  [self sendEvent:AGRtcStats params:@{
2010 2013
                                           @"stats": @{
2011 2014
                                               @"duration": @(stats.duration),
2012 2015
                                               @"txBytes": @(stats.txBytes),
@@ -2024,13 +2027,13 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2024 2027
 }
2025 2028
 
2026 2029
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine lastmileQuality:(AgoraNetworkQuality)quality {
2027
-  [self sendEvent:LastmileQuality params:@{
2030
+  [self sendEvent:AGLastmileQuality params:@{
2028 2031
                                            @"quality": @(quality)
2029 2032
                                            }];
2030 2033
 }
2031 2034
 
2032 2035
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine networkQuality:(NSUInteger)uid txQuality:(AgoraNetworkQuality)txQuality rxQuality:(AgoraNetworkQuality)rxQuality {
2033
-  [self sendEvent:NetworkQuality params:@{
2036
+  [self sendEvent:AGNetworkQuality params:@{
2034 2037
                                           @"uid": @(uid),
2035 2038
                                           @"txQuality": @(txQuality),
2036 2039
                                           @"rxQuality": @(rxQuality)
@@ -2038,7 +2041,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2038 2041
 }
2039 2042
 
2040 2043
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine localVideoStats:(AgoraRtcLocalVideoStats *_Nonnull)stats {
2041
-  [self sendEvent:LocalVideoStats params:@{
2044
+  [self sendEvent:AGLocalVideoStats params:@{
2042 2045
                                            @"stats": @{
2043 2046
                                                @"sentBitrate": @(stats.sentBitrate),
2044 2047
                                                @"sentFrameRate": @(stats.sentFrameRate)
@@ -2047,7 +2050,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2047 2050
 }
2048 2051
 
2049 2052
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteVideoStats:(AgoraRtcRemoteVideoStats *_Nonnull)stats {
2050
-  [self sendEvent:RemoteVideoStats params:@{
2053
+  [self sendEvent:AGRemoteVideoStats params:@{
2051 2054
                                             @"stats": @{
2052 2055
                                                 @"uid": @(stats.uid),
2053 2056
                                                 @"width": @(stats.width),
@@ -2060,7 +2063,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2060 2063
 }
2061 2064
 
2062 2065
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine audioTransportStatsOfUid:(NSUInteger)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate {
2063
-  [self sendEvent:AudioTransportStatsOfUid params:@{
2066
+  [self sendEvent:AGAudioTransportStatsOfUid params:@{
2064 2067
                                                     @"uid": @(uid),
2065 2068
                                                     @"delay": @(delay),
2066 2069
                                                     @"lost": @(lost),
@@ -2069,7 +2072,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2069 2072
 }
2070 2073
 
2071 2074
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine videoTransportStatsOfUid:(NSUInteger)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate {
2072
-  [self sendEvent:VideoTransportStatsOfUid params:@{
2075
+  [self sendEvent:AGVideoTransportStatsOfUid params:@{
2073 2076
                                                     @"uid": @(uid),
2074 2077
                                                     @"delay": @(delay),
2075 2078
                                                     @"lost": @(lost),
@@ -2078,50 +2081,50 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2078 2081
 }
2079 2082
 
2080 2083
 - (void)rtcEngineLocalAudioMixingDidFinish:(AgoraRtcEngineKit *_Nonnull)engine {
2081
-  [self sendEvent:LocalAudioMixingDidFinish params:@{
2084
+  [self sendEvent:AGLocalAudioMixingFinish params:@{
2082 2085
                                                      @"message": @"LocalAudioMixingSucceedFinish"
2083 2086
                                                      }];
2084 2087
 }
2085 2088
 
2086 2089
 - (void)rtcEngineRemoteAudioMixingDidStart:(AgoraRtcEngineKit *_Nonnull)engine {
2087
-  [self sendEvent:RemoteAudioMixingDidStart params:@{
2090
+  [self sendEvent:AGRemoteAudioMixingStart params:@{
2088 2091
                                                      @"message": @"RemoteAudioMixingStarted"
2089 2092
                                                      }];
2090 2093
 }
2091 2094
 
2092 2095
 - (void)rtcEngineRemoteAudioMixingDidFinish:(AgoraRtcEngineKit *_Nonnull)engine {
2093
-  [self sendEvent:RemoteAudioMixingDidFinish params:@{
2096
+  [self sendEvent:AGRemoteAudioMixingFinish params:@{
2094 2097
                                                       @"message": @"RemoteAudioMixingFinish"
2095 2098
                                                       }];
2096 2099
 }
2097 2100
 
2098 2101
 - (void)rtcEngineDidAudioEffectFinish:(AgoraRtcEngineKit *_Nonnull)engine soundId:(NSInteger)soundId {
2099
-  [self sendEvent:DidAudioEffectFinish params:@{
2102
+  [self sendEvent:AGAudioEffectFinish params:@{
2100 2103
                                                 @"soundId": @(soundId)
2101 2104
                                                 }];
2102 2105
 }
2103 2106
 
2104 2107
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamPublishedWithUrl:(NSString *_Nonnull)url errorCode:(AgoraErrorCode)errorCode {
2105
-  [self sendEvent:StreamPublished params:@{
2108
+  [self sendEvent:AGStreamPublished params:@{
2106 2109
                                            @"url": url,
2107 2110
                                            @"code": @(errorCode)
2108 2111
                                            }];
2109 2112
 }
2110 2113
 
2111 2114
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamUnpublishedWithUrl:(NSString *_Nonnull)url {
2112
-  [self sendEvent:StreamUnpublish params:@{
2115
+  [self sendEvent:AGStreamUnpublish params:@{
2113 2116
                                            @"url": url,
2114 2117
                                            }];
2115 2118
 }
2116 2119
 
2117 2120
 - (void)rtcEngineTranscodingUpdated:(AgoraRtcEngineKit *_Nonnull)engine {
2118
-  [self sendEvent:TranscodingUpdated params:@{
2119
-                                              @"message": @"TranscodingUpdated"
2121
+  [self sendEvent:AGTranscodingUpdate params:@{
2122
+                                              @"message": @"AGTranscodingUpdate"
2120 2123
                                               }];
2121 2124
 }
2122 2125
 
2123 2126
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamInjectedStatusOfUrl:(NSString *_Nonnull)url uid:(NSUInteger)uid status:(AgoraInjectStreamStatus)status {
2124
-  [self sendEvent:StreamInjectedStatus params:@{
2127
+  [self sendEvent:AGStreamInjectedStatus params:@{
2125 2128
                                                 @"uid": @(uid),
2126 2129
                                                 @"url": url,
2127 2130
                                                 @"status": @(status)
@@ -2129,7 +2132,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2129 2132
 }
2130 2133
 
2131 2134
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine receiveStreamMessageFromUid:(NSUInteger)uid streamId:(NSInteger)streamId data:(NSData *_Nonnull)data {
2132
-  [self sendEvent:ReceiveStreamMessage params:@{
2135
+  [self sendEvent:AGReceiveStreamMessage params:@{
2133 2136
                                                 @"uid": @(uid),
2134 2137
                                                 @"streamId": @(streamId),
2135 2138
                                                 @"data": data
@@ -2137,7 +2140,7 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2137 2140
 }
2138 2141
 
2139 2142
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached {
2140
-  [self sendEvent:DidOccurStreamMessageError params:@{
2143
+  [self sendEvent:AGOccurStreamMessageError params:@{
2141 2144
                                                       @"uid": @(uid),
2142 2145
                                                       @"streamId": @(streamId),
2143 2146
                                                       @"error": @(error),
@@ -2147,14 +2150,14 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2147 2150
 }
2148 2151
 
2149 2152
 - (void)rtcEngineMediaEngineDidLoaded:(AgoraRtcEngineKit *_Nonnull)engine {
2150
-  [self sendEvent:MediaEngineDidLoaded params:@{
2153
+  [self sendEvent:AGMediaEngineLoaded params:@{
2151 2154
                                                 @"message": @"MediaEngineLoaded"
2152 2155
                                                 }];
2153 2156
 }
2154 2157
 
2155 2158
 - (void)rtcEngineMediaEngineDidStartCall:(AgoraRtcEngineKit *_Nonnull)engine {
2156
-  [self sendEvent:MediaEngineDidStartCall params:@{
2157
-                                                   @"message": @"MediaEngineDidStartCall"
2159
+  [self sendEvent:AGMediaEngineStartCall params:@{
2160
+                                                   @"message": @"AGMediaEngineStartCall"
2158 2161
                                                    }];
2159 2162
 }
2160 2163