Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RTM 1.1.1 Compatibility #87

Merged
merged 5 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/workflows/build.yml

This file was deleted.

9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
### 1.0.0
## 1.0.1

- Add Error param to delegate methods to pass through the error
- Show correct versions of RTC and RTM
- Show RTM classes
- Update RTM to v1.1.1

## 1.0.0

- Updated RTC to v5.2.0
- JSON serialization for all the host controls
Expand Down
9 changes: 9 additions & 0 deletions lib/agora_uikit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ export 'package:agora_rtc_engine/rtc_engine.dart'
SuperResolutionStateReason,
UploadErrorReason,
VideoRenderMode;
export 'package:agora_rtm/agora_rtm.dart'
show
AgoraRtmMessage,
AgoraRtmMember,
AgoraRtmChannelAttribute,
AgoraRtmChannelException,
AgoraRtmClientException,
AgoraRtmLocalInvitation,
AgoraRtmRemoteInvitation;
export 'package:permission_handler/permission_handler.dart';

export 'models/agora_channel_data.dart' show AgoraChannelData;
Expand Down
6 changes: 3 additions & 3 deletions lib/controllers/rtm_client_event_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Future<void> rtmClientEventHandler({
}
};

agoraRtmClient.onError = () {
agoraRtmClientEventHandler.onError?.call();
agoraRtmClient.onError = (error) {
agoraRtmClientEventHandler.onError?.call(error);

log(
'Error Occurred while initializing the RTM client',
'Error Occurred while initializing the RTM client: ${error.hashCode}',
level: Level.error.value,
name: 'AgoraUIKit',
);
Expand Down
7 changes: 7 additions & 0 deletions lib/controllers/session_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:agora_uikit/models/agora_connection_data.dart';
import 'package:agora_uikit/models/agora_rtc_event_handlers.dart';
import 'package:agora_uikit/models/agora_rtm_channel_event_handler.dart';
import 'package:agora_uikit/models/agora_rtm_client_event_handler.dart';
import 'package:agora_uikit/models/agora_rtm_mute_request.dart';
import 'package:agora_uikit/models/agora_settings.dart';
import 'package:agora_uikit/models/agora_user.dart';
import 'package:agora_uikit/src/enums.dart';
Expand Down Expand Up @@ -77,6 +78,12 @@ class SessionController extends ValueNotifier<AgoraSettings> {
),
connectionData: agoraConnectionData,
);
// Getting SDK versions and assigning them
String? rtcVersion = await value.engine?.getSdkVersion();
AgoraVersions.staticRTM = await AgoraRtmClient.getSdkVersion();
if (rtcVersion != null) {
AgoraVersions.staticRTC = rtcVersion;
}
}

Future<void> askForUserCameraAndMicPermission() async {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/agora_rtm_client_event_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AgoraRtmClientEventHandler {
final Function()? onTokenExpired;

/// Occurs when you receive error events.
final Function()? onError;
final Function(dynamic error)? onError;

/// Callback to the caller: occurs when the caller receives the call invitation.
final Function(AgoraRtmLocalInvitation)? onLocalInvitationReceivedByPeer;
Expand Down
8 changes: 5 additions & 3 deletions lib/models/agora_rtm_mute_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class AgoraUIKit {
String platform = platformStr();

String framework = "flutter";
String version = "1.0.0";
String version = "1.0.1";

AgoraUIKit.fromJson(Map<String, dynamic> json)
: platform = json['platform'],
Expand All @@ -116,8 +116,10 @@ class AgoraUIKit {
/// Class to store and share the Agora version for RTC and RTM
class AgoraVersions {
AgoraVersions();
String rtm = '1.1.0';
String rtc = '5.1.0';
static String staticRTM = '1.1.1';
static String staticRTC = '5.2.0';
String rtm = AgoraVersions.staticRTM;
String rtc = AgoraVersions.staticRTC;

AgoraVersions.fromJson(Map<String, dynamic> json)
: rtm = json['rtm'],
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: agora_uikit
description: Flutter plugin to simply integrate Agora Video Calling or Live
Video Streaming to your app with just a few lines of code.
version: 1.0.0
version: 1.0.1
homepage: https://www.agora.io/en/
repository: https://github.com/AgoraIO-Community/Flutter-UIKit

Expand All @@ -11,7 +11,7 @@ environment:

dependencies:
agora_rtc_engine: ^5.2.0
agora_rtm: ^1.1.0
agora_rtm: ^1.1.1
flutter:
sdk: flutter
http: ^0.13.4
Expand Down