Skip to content

Commit

Permalink
feat: Upgrade native sdk 4.0.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
littleGnAl committed Sep 13, 2022
1 parent d169cbe commit 41115be
Show file tree
Hide file tree
Showing 188 changed files with 26,805 additions and 8,826 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
if (( $TOTAL < 110 ))
if (( $TOTAL < 120 ))
then
echo Pub Score too low.
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/no-response.yaml
Expand Up @@ -18,7 +18,7 @@ permissions:
jobs:
noResponse:
runs-on: ubuntu-latest
if: ${{ github.repository == 'AgoraIO-Community/agora_rtc_ng_flutter' }}
if: ${{ github.repository == 'AgoraIO/Agora-Flutter-SDK' }}
steps:
- uses: godofredoc/no-response@0ce2dc0e63e1c7d2b87752ceed091f6d32c9df09
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -34,3 +34,4 @@ third_party/
**/generated_plugin_registrant.h
**/generated_plugins.cmake
**/GeneratedPluginRegistrant.swift
**/.plugin_dev
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
## 6.0.0-rc.1

See release note:

https://docs.agora.io/en/video-call-4.x-beta/release_flutter_ng?platform=Flutter

## 6.0.0-beta.2

feat: Convert kotlin to java to avoid kotlin version conflict
Expand Down
27 changes: 14 additions & 13 deletions README.md
@@ -1,11 +1,11 @@
# agora_rtc_ng
# agora_rtc_engine

<p align="center">
<a href="https://pub.dev/packages/agora_rtc_ng"><img src="https://badges.bar/agora_rtc_ng/likes" alt="Pub.dev likes"/></a>
<a href="https://pub.dev/packages/agora_rtc_ng" alt="Pub.dev popularity"><img src="https://badges.bar/agora_rtc_ng/popularity"/></a>
<a href="https://pub.dev/packages/agora_rtc_ng"><img src="https://badges.bar/agora_rtc_ng/pub%20points" alt="Pub.dev points"/></a><br/>
<a href="https://pub.dev/packages/agora_rtc_ng"><img src="https://img.shields.io/pub/v/agora_rtc_ng.svg?include_prereleases" alt="latest version"/></a>
<a href="https://pub.dev/packages/agora_rtc_ng"><img src="https://img.shields.io/badge/Platform-Android%20%7C%20iOS%20%7C%20macOS%20%7C%20Web%20%7C%20Windows-blue?logo=flutter" alt="Platform"/></a>
<a href="https://pub.dev/packages/agora_rtc_engine"><img src="https://img.shields.io/pub/likes/agora_rtc_engine?logo=dart" alt="Pub.dev likes"/></a>
<a href="https://pub.dev/packages/agora_rtc_engine" alt="Pub.dev popularity"><img src="https://img.shields.io/pub/popularity/agora_rtc_engine?logo=dart"/></a>
<a href="https://pub.dev/packages/agora_rtc_engine"><img src="https://img.shields.io/pub/points/agora_rtc_engine?logo=dart" alt="Pub.dev points"/></a><br/>
<a href="https://pub.dev/packages/agora_rtc_engine"><img src="https://img.shields.io/pub/v/agora_rtc_engine.svg?include_prereleases" alt="latest version"/></a>
<a href="https://pub.dev/packages/agora_rtc_engine"><img src="https://img.shields.io/badge/Platform-Android%20%7C%20iOS%20%7C%20macOS%20%7C%20Web%20%7C%20Windows-blue?logo=flutter" alt="Platform"/></a>
<a href="./LICENSE"><img src="https://img.shields.io/github/license/agoraio-community/flutter-uikit?color=lightgray" alt="License"/></a>
<a href="https://www.agora.io/en/join-slack/">
<img src="https://img.shields.io/badge/slack-@RTE%20Dev-blue.svg?logo=slack" alt="RTE Dev Slack Link"/>
Expand All @@ -18,7 +18,7 @@ Agora.io provides building blocks for you to add real-time voice and video commu

## Usage

To use this plugin, please add `agora_rtc_ng` as a dependency to
To use this plugin, please add `agora_rtc_engine` as a dependency to
your [pubspec.yaml](https://flutter.dev/docs/development/packages-and-plugins/using-packages) file.

## Getting Started
Expand Down Expand Up @@ -63,23 +63,23 @@ Open the `Info.plist` and add:

### Multiple Platforms

The [agora_rtc_ng](https://pub.dev/packages/agora_rtc_ng) supports Android/iOS/macOS/Windows, but not support Web yet.
The [agora_rtc_engine](https://pub.dev/packages/agora_rtc_engine) supports Android/iOS/macOS/Windows, but not support Web yet.

## API Reference Resources

* [Flutter](https://docs.agora.io/en/video-call-4.x-beta/API%20Reference/flutter_ng/API/rtc_api_overview_ng.html)
* [Android](https://docs-preprod.agora.io/cn/video-call-4.x-beta/API%20Reference/java_ng/API/rtc_api_overview_ng.html)
* [iOS/macOS](https://docs-preprod.agora.io/cn/video-call-4.x-beta/API%20Reference/mac_ng/API/rtc_api_overview_ng.html)
* [Windows](https://docs-preprod.agora.io/cn/video-call-4.x-beta/API%20Reference/windows_ng/API/rtc_api_overview_ng.html)
* [Android](https://docs-preprod.agora.io/en/video-call-4.x-beta/API%20Reference/java_ng/API/rtc_api_overview_ng.html)
* [iOS/macOS](https://docs-preprod.agora.io/en/video-call-4.x-beta/API%20Reference/mac_ng/API/rtc_api_overview_ng.html)
* [Windows](https://docs-preprod.agora.io/en/video-call-4.x-beta/API%20Reference/windows_ng/API/rtc_api_overview_ng.html)
* [Web](https://docs.agora.io/en/Video/API%20Reference/web_ng/index.html)

## Feedback

If you have any problems or suggestions regarding the sample projects, feel free to file an [issue](https://github.com/AgoraIO-Community/agora_rtc_ng/issues) OR pull request.
If you have any problems or suggestions regarding the sample projects, feel free to file an [issue](https://github.com/AgoraIO-Community/agora_rtc_engine/issues) OR pull request.

## How to contribute

To help work on this sdk, please refer to [CONTRIBUTING.md](https://github.com/AgoraIO-Community/agora_rtc_ng/blob/main/CONTRIBUTING.md).
To help work on this sdk, please refer to [CONTRIBUTING.md](https://github.com/AgoraIO/agora_rtc_engine/blob/main/CONTRIBUTING.md).

## Related resources

Expand All @@ -88,6 +88,7 @@ To help work on this sdk, please refer to [CONTRIBUTING.md](https://github.com/A
- Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase) for more complicated real use case.
- Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community).
- If you encounter problems during integration, feel free to ask questions in [Stack Overflow](https://stackoverflow.com/questions/tagged/agora.io).
- [Release notes](https://docs.agora.io/en/video-call-4.x-beta/release_flutter_ng?platform=Flutter).

## License

Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Expand Up @@ -10,4 +10,4 @@ analyzer:

linter:
rules:
- public_member_api_docs
# - public_member_api_docs
3 changes: 2 additions & 1 deletion android/.gitignore
Expand Up @@ -9,4 +9,5 @@

.cxx
libs/
.plugin_dev
.plugin_dev
zip_download_path/
7 changes: 4 additions & 3 deletions android/build.gradle
Expand Up @@ -45,10 +45,11 @@ android {

dependencies {
if (isDev(project)) {
api fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation fileTree(dir: "libs", include: ["*.jar"])
} else {
api 'io.agora.rtc:iris-rtc:3.8.201'
api 'io.agora.rtc:agora-special-full:3.8.201.2.2'
api 'io.agora.rtc:iris-rtc:4.0.0-rc.1'
api 'io.agora.rtc:agora-special-full:4.0.0.5'
implementation 'io.agora.rtc:full-screen-sharing:4.0.0.5'
}
}

Expand Down
Expand Up @@ -4,6 +4,7 @@
import android.view.SurfaceView;
import android.view.TextureView;
import android.view.View;
import android.widget.FrameLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -48,12 +49,13 @@ public static class PlatformViewProviderSurfaceView implements PlatformViewProvi

@Override
public View provide(Context context) {
return new SurfaceView(context);
return new TextureView(context);
}
}

static class AgoraPlatformView implements PlatformView, MethodChannel.MethodCallHandler {
private View innerView;
private FrameLayout parentView;

private final MethodChannel methodChannel;

Expand All @@ -68,6 +70,8 @@ static class AgoraPlatformView implements PlatformView, MethodChannel.MethodCall
methodChannel = new MethodChannel(messenger, "agora_rtc_ng/" + viewType + "_" + viewId);
methodChannel.setMethodCallHandler(this);
innerView = viewProvider.provide(context);
parentView = new FrameLayout(context);
parentView.addView(innerView);

platformViewPtr = IrisApiEngine.GetJObjectAddress(innerView);
}
Expand All @@ -81,6 +85,7 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result
IrisApiEngine.FreeJObjectByAddress(platformViewPtr);
platformViewPtr = 0;
}
parentView.removeAllViews();
innerView = null;
result.success(0);
}
Expand All @@ -89,7 +94,7 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result
@Nullable
@Override
public View getView() {
return innerView;
return parentView;
}

@Override
Expand Down
13 changes: 13 additions & 0 deletions android/src/main/java/io/agora/agora_rtc_ng/AgoraRtcNgPlugin.java
@@ -1,6 +1,9 @@
package io.agora.agora_rtc_ng;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.io.IOException;
import java.lang.ref.WeakReference;
Expand All @@ -18,9 +21,12 @@ public class AgoraRtcNgPlugin implements FlutterPlugin, MethodChannel.MethodCall
private MethodChannel channel;
private WeakReference<FlutterPluginBinding> flutterPluginBindingRef;
private VideoViewController videoViewController;
@Nullable
private Context applicationContext;

@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
applicationContext = flutterPluginBinding.getApplicationContext();
channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "agora_rtc_ng");
channel.setMethodCallHandler(this);
flutterPluginBindingRef = new WeakReference<>(flutterPluginBinding);
Expand All @@ -44,6 +50,7 @@ public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBindin

@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
applicationContext = null;
channel.setMethodCallHandler(null);
videoViewController.dispose();
}
Expand All @@ -52,6 +59,12 @@ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
if ("getAssetAbsolutePath".equals(call.method)) {
getAssetAbsolutePath(call, result);
} else if ("getExternalFilesDir".equals(call.method)) {
if (applicationContext != null) {
result.success(applicationContext.getExternalFilesDir(null).getAbsolutePath());
} else {
result.error("", "Application context is null", null);
}
} else {
result.notImplemented();
}
Expand Down
Expand Up @@ -35,6 +35,8 @@ private boolean destroyTextureRender(long textureId){
public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
switch (call.method) {
case "attachVideoFrameBufferManager":
result.success(0);
break;
case "detachVideoFrameBufferManager":
result.success(true);
break;
Expand Down
6 changes: 3 additions & 3 deletions example/README.md
@@ -1,8 +1,8 @@
# agora_rtc_ng_example
# agora_rtc_engine_example

## Overview

This project is an open-source demo that will show you different scenes on how to integrate [agora_rtc_ng](https://pub.dev/packages/agora_rtc_ng) APIs into your project.
This project is an open-source demo that will show you different scenes on how to integrate [agora_rtc_engine](https://pub.dev/packages/agora_rtc_engine) APIs into your project.

Any scene of this project can run successfully alone.

Expand Down Expand Up @@ -67,4 +67,4 @@ Any scene of this project can run successfully alone.
4. Make the project and run the app in the simulator or connected physical device.

You are all set! Feel free to play with this sample project and explore features of the [agora_rtc_ng](https://pub.dev/packages/agora_rtc_ng).
You are all set! Feel free to play with this sample project and explore features of the [agora_rtc_engine](https://pub.dev/packages/agora_rtc_engine).
5 changes: 4 additions & 1 deletion example/android/app/build.gradle
Expand Up @@ -64,6 +64,9 @@ flutter {
}

dependencies {

def devFile = project.file("${rootProject.projectDir.getParentFile().parentFile}/android/.plugin_dev")
if (devFile.exists()) {
implementation fileTree(dir: "${rootProject.projectDir.getParentFile().parentFile}/android/libs", include: ["*.aar"])
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
1 change: 1 addition & 0 deletions example/android/gradle.properties
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.injected.testOnly=false
6 changes: 5 additions & 1 deletion example/example.md
Expand Up @@ -3,7 +3,7 @@
```dart
import 'dart:async';
import 'package:agora_rtc_ng/agora_rtc_ng.dart';
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
Expand Down Expand Up @@ -63,6 +63,10 @@ class _MyAppState extends State<MyApp> {
_remoteUid = null;
});
},
onTokenPrivilegeWillExpire: (RtcConnection connection, String token) {
debugPrint(
'[onTokenPrivilegeWillExpire] connection: ${connection.toJson()}, token: $token');
},
),
);
Expand Down
2 changes: 2 additions & 0 deletions example/ios/.gitignore
Expand Up @@ -32,3 +32,5 @@ Runner/GeneratedPluginRegistrant.*
!default.mode2v3
!default.pbxuser
!default.perspectivev3

Podfile.lock
34 changes: 31 additions & 3 deletions example/ios/Podfile
Expand Up @@ -10,6 +10,16 @@ project 'Runner', {
'Release' => :release,
}

def plugin_dev
generated_xcode_build_settings_path = File.join('.symlinks', 'plugins', 'agora_rtc_engine', 'ios', '.plugin_dev')

if not File.exist?(generated_xcode_build_settings_path)
return nil
end

return generated_xcode_build_settings_path
end

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
Expand All @@ -28,10 +38,28 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

# pod 'AgoraRtcWrapper', :path => File.join('.symlinks', 'plugins', 'agora_rtc_ng', 'ios')
# pod 'iris_event_handler', :path => File.join('.symlinks', 'plugins', 'iris_event', 'ios')
# pod 'iris_event_handler', :path => File.join('.symlinks', 'plugins', 'iris_event', 'ios')

if plugin_dev != nil
pod 'AgoraRtcWrapper', :path => File.join('.symlinks', 'plugins', 'agora_rtc_engine', 'ios')
# pod 'iris_event_handler', :path => File.join('.symlinks', 'plugins', 'iris_event', 'ios')
end
end

target 'ScreenSharing' do
use_frameworks!
use_modular_headers!

if plugin_dev != nil
pod 'AgoraRtcWrapper', :path => File.join('.symlinks', 'plugins', 'agora_rtc_engine', 'ios')
else
pod 'AgoraRtcEngine_Special_iOS', '4.0.0.5'
end
end

post_install do |installer|
Expand All @@ -42,7 +70,7 @@ post_install do |installer|
# https://developer.apple.com/forums/thread/656509
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "i386 arm64"
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "i386"
end
end
end
41 changes: 0 additions & 41 deletions example/ios/Podfile copy

This file was deleted.

0 comments on commit 41115be

Please sign in to comment.