Skip to content

Commit

Permalink
[example] Integrate with agora_rtc_engine (#180)
Browse files Browse the repository at this point in the history
Some customers encountered issues when integrating with
`agora_rtc_engine`. To address this, additional configurations are
required during the integration process.
  • Loading branch information
littleGnAl authored Oct 29, 2024
1 parent 250314c commit 086736c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ android {
signingConfig signingConfigs.debug
}
}

packagingOptions {
pickFirst 'lib/**/libaosl.so'
}
}

flutter {
Expand Down
12 changes: 12 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,15 @@ post_install do |installer|
flutter_additional_ios_build_settings(target)
end
end

pre_install do |installer|
rtm_pod_path = File.join(installer.sandbox.root, 'AgoraRtm')
aosl_xcframework_path = File.join(rtm_pod_path, 'aosl.xcframework')

if File.exist?(aosl_xcframework_path)
puts "Deleting aosl.xcframework from #{aosl_xcframework_path}"
FileUtils.rm_rf(aosl_xcframework_path)
else
puts "aosl.xcframework not found, skipping deletion."
end
end
28 changes: 28 additions & 0 deletions example/lib/src/rtm_api_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:collection';
import 'dart:convert';
import 'dart:typed_data';

import 'package:agora_rtc_engine/agora_rtc_engine.dart';
import 'package:agora_rtm/agora_rtm.dart';
import 'package:flutter/material.dart';

Expand Down Expand Up @@ -44,6 +45,7 @@ class _RtmApiDemoState extends State<RtmApiDemo> {
RtmChannelType _rtmChannelType = RtmChannelType.message;

late RtmClient _rtmClient;
late RtcEngine _rtcEngine;

@override
void initState() {
Expand Down Expand Up @@ -423,6 +425,32 @@ class _RtmApiDemoState extends State<RtmApiDemo> {
}),
],
),
_card(
[
const Text('Work with Agora Rtc Engine'),
_button('Init RtcEngine', () async {
_rtcEngine = createAgoraRtcEngine();
await _rtcEngine
.initialize(RtcEngineContext(appId: config.appId));

logSink.log('RtcEngine.initialize success');
}),
_button('Join Channel', () async {
await _rtcEngine.joinChannel(
token: '',
channelId: config.channelId,
uid: 0,
options: const ChannelMediaOptions());

logSink.log('RtcEngine.joinChannel success');
}),
_button('Release', () async {
await _rtcEngine.release();

logSink.log('RtcEngine.release success');
}),
],
),
],
),
),
Expand Down
7 changes: 7 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ dependencies:
# the parent directory to use the current plugin's version.
path: ../

agora_rtc_engine: ^6.3.2

flutter_riverpod: ^1.0.0

dependency_overrides:
# When using agora_rtm 2.2.2 with agora_rtc_engine 6.3.2, we need to override the iris_method_channel to 2.2.2,
# the issue will be fixed with the next release of agora_rtc_engine
iris_method_channel: ^2.2.2

dev_dependencies:
integration_test:
sdk: flutter
Expand Down

0 comments on commit 086736c

Please sign in to comment.