From 2abccef9631d6c815ae288362873b38878f9a822 Mon Sep 17 00:00:00 2001 From: wanghualei Date: Tue, 11 Jul 2023 09:45:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=AE=89=E5=8D=93getUserProfile=20?= =?UTF-8?q?=E6=9C=AA=E5=AE=9E=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.settings/org.eclipse.buildship.core.prefs | 2 +- .../finogeeks/mop/impls/MyUserProfileHandler.java | 3 ++- example/android/app/build.gradle | 2 +- example/lib/main.dart | 15 +++++++++++++-- lib/mop.dart | 1 - 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs index 41f5edb..c7199bd 100644 --- a/android/.settings/org.eclipse.buildship.core.prefs +++ b/android/.settings/org.eclipse.buildship.core.prefs @@ -2,7 +2,7 @@ arguments=--init-script /var/folders/tv/dbm7kt650fvdxrtf0k7xgxcm0000gn/T/d146c97 auto.sync=false build.scans.enabled=false connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.4.2)) -connection.project.dir= +connection.project.dir=../../finosprite/android eclipse.preferences.version=1 gradle.user.home= java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home diff --git a/android/src/main/java/com/finogeeks/mop/impls/MyUserProfileHandler.java b/android/src/main/java/com/finogeeks/mop/impls/MyUserProfileHandler.java index 295866a..a5cf050 100644 --- a/android/src/main/java/com/finogeeks/mop/impls/MyUserProfileHandler.java +++ b/android/src/main/java/com/finogeeks/mop/impls/MyUserProfileHandler.java @@ -25,12 +25,13 @@ public class MyUserProfileHandler implements IUserProfileHandler { public void getUserProfileWithAppletInfo(@NotNull Context context, @NotNull FinAppInfo finAppInfo, @NotNull UserProfileCallback callback) { MethodChannel channel = MopPluginService.getInstance().getMethodChannel(); Log.d(TAG, "getUserProfileWithAppletInfo:"); + Log.d(TAG, "channel:" + channel !=null ? "存在": "不存在" ); channel.invokeMethod("extensionApi:getUserProfile", null, new MethodChannel.Result() { @Override public void success(Object mapResult) { JSONObject result = null; try { - result = new JSONObject(mapResult); + result = new JSONObject((Map)mapResult); } catch (Exception e) { } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 9a095ec..548b229 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -70,7 +70,7 @@ flutter { } dependencies { - def sdk_version = "2.40.1" + def sdk_version = "2.41.1" compileOnly "com.finogeeks.lib:finapplet:${sdk_version}" implementation "com.finogeeks.mop:plugins:${sdk_version}" } diff --git a/example/lib/main.dart b/example/lib/main.dart index 411b093..a0f6fb1 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -98,7 +98,7 @@ class _MyAppState extends State { } }; - return result; + return Future.value(result); } Widget _buildAppletItem( @@ -248,7 +248,18 @@ class MyAppletHandler extends AppletHandler { @override Future> getUserInfo() { // TODO: implement getUserInfo - throw UnimplementedError(); + Map result = { + "userInfo":{ + "nickName" : "haley", + "avatarUrl" : "https://www.finclip.com", + "gender" : 1, + "country" : "China", + "province" : "Guangdong", + "city" : "shenzhen", + } + }; + + return Future.value(result); } @override diff --git a/lib/mop.dart b/lib/mop.dart index e2a769a..a12636e 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -411,7 +411,6 @@ class UIConfig { "disableSlideCloseAppletGesture": disableSlideCloseAppletGesture, "appletText": appletText, "loadingLayoutCls": loadingLayoutCls, - "useNativeLiveComponent": useNativeLiveComponent, }; } }