Merge commit '0a175bb8b1eb8d4a40c66107ca77a2ff33212bf9' into pre_merge
# Conflicts: # .idea/libraries/Dart_SDK.xml # android/build.gradle # android/gradle/wrapper/gradle-wrapper.properties # android/src/main/AndroidManifest.xml # example/android/app/build.gradle # example/android/build.gradle # example/android/settings.gradle # example/lib/main.dart # example/pubspec.lock # ios/flutter_openim_sdk.podspec # lib/src/manager/im_conversation_manager.dart # lib/src/manager/im_friendship_manager.dart # lib/src/models/notification_info.dart
This commit is contained in:
1
android/.gitignore
vendored
1
android/.gitignore
vendored
@@ -6,3 +6,4 @@
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.cxx
|
||||
|
||||
@@ -1,32 +1,16 @@
|
||||
group 'io.openim.flutter_openim_sdk'
|
||||
version '1.0'
|
||||
|
||||
def dir = getCurrentProjectDir()
|
||||
|
||||
def getCurrentProjectDir() {
|
||||
String result = ""
|
||||
rootProject.allprojects { project ->
|
||||
if (project.properties.get("name").toString() == "flutter_openim_sdk") {
|
||||
result = project.properties.get("projectDir").toString()
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
group = "io.openim.flutter_openim_sdk"
|
||||
version = "1.0"
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '2.0.20'
|
||||
|
||||
repositories {
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.3.1'
|
||||
classpath 'com.android.tools.build:gradle:8.7.3'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
@@ -58,9 +42,21 @@ android {
|
||||
abiFilters "arm64-v8a","x86" // 根据需要添加其他 ABI
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
|
||||
dependencies {
|
||||
implementation 'io.openim:core-sdk:3.8.3-patch10@aar'
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
testImplementation("org.mockito:mockito-core:5.0.0")
|
||||
}
|
||||
|
||||
testOptions {
|
||||
unitTests.all {
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed", "standardOut", "standardError"
|
||||
outputs.upToDateWhen {false}
|
||||
showStandardStreams = true
|
||||
}
|
||||
}
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
@@ -69,5 +65,5 @@ android {
|
||||
|
||||
dependencies {
|
||||
//implementation 'com.openim:sdkcore:1.0.15-local'
|
||||
implementation 'com.openim:sdkcore:1.0.18'
|
||||
}
|
||||
implementation 'com.openim:sdkcore:1.0.19'
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.enableDexingArtifactTransform=false
|
||||
@@ -1,9 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>io.openim</groupId>
|
||||
<artifactId>core-sdk</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</project>
|
||||
@@ -2,4 +2,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
||||
@@ -35,14 +35,16 @@ public class FriendshipManager extends BaseManager {
|
||||
public void getFriendApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationListAsRecipient(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationListAsApplicant(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -135,4 +137,12 @@ public class FriendshipManager extends BaseManager {
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendApplicationUnhandledCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationUnhandledCount(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,14 +126,16 @@ public class GroupManager extends BaseManager {
|
||||
public void getGroupApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationListAsRecipient(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationListAsApplicant(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -240,4 +242,11 @@ public class GroupManager extends BaseManager {
|
||||
jsonValue(methodCall, "userIDs")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupApplicationUnhandledCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationUnhandledCount(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package io.openim.flutter_openim_sdk;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* This demonstrates a simple unit test of the Java portion of this plugin's
|
||||
* implementation.
|
||||
*
|
||||
* Once you have built the plugin's example app, you can run these tests from
|
||||
* the command
|
||||
* line by running `./gradlew testDebugUnitTest` in the `example/android/`
|
||||
* directory, or
|
||||
* you can run them directly from IDEs that support JUnit such as Android
|
||||
* Studio.
|
||||
*/
|
||||
|
||||
public class FlutterOpenimSdkPluginTest {
|
||||
@Test
|
||||
public void onMethodCall_getPlatformVersion_returnsExpectedValue() {
|
||||
FlutterOpenimSdkPlugin plugin = new FlutterOpenimSdkPlugin();
|
||||
|
||||
final MethodCall call = new MethodCall("getPlatformVersion", null);
|
||||
MethodChannel.Result mockResult = mock(MethodChannel.Result.class);
|
||||
plugin.onMethodCall(call, mockResult);
|
||||
|
||||
verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user