Skip to content

修复android平台 registerExtensionApi 方法data为空问题,并升级sdk 为 2.48.7 #57

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:"+REACT_NATIVE_VERSION // From node_modules
implementation 'com.finogeeks.lib:finapplet:2.47.11'
implementation 'com.finogeeks.mop:plugins:2.47.11'
implementation 'com.finogeeks.lib:finapplet:2.48.7'
implementation 'com.finogeeks.mop:plugins:2.48.7'
}

def configureReactNativePom(def pom) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ private void sendEvent(String apiName, Map<String, Object> params, FinCallback f

@ReactMethod
public void eventReminderCallback(String apiName, Dynamic result, String callbackId) {
ReadableMap map = result.asMap();
Log.d(TAG, "eventReminderCallback," + apiName + "," + result);
FinCallback callback = callbacks.get(callbackId);
if (callback != null) {
callback.onSuccess(result);
callback.onSuccess(map);
callbacks.remove(callbackId);
}
}
Expand Down Expand Up @@ -1007,12 +1008,13 @@ public void invoke(String s, JSONObject jsonObject, com.finogeeks.lib.applet.int
Log.d("MopPlugin", "invoke extensionApi:" + s + ",params:" + jsonObject);
Map params = new Gson().fromJson(jsonObject.toString(), HashMap.class);
handler.post(() -> {
sendEvent("extensionApi:" + name, params, new FinCallback<Dynamic>() {
sendEvent("extensionApi:" + name, params, new FinCallback<ReadableMap>() {
@Override
public void onSuccess(Dynamic o) {
public void onSuccess(ReadableMap o) {
Log.d(TAG, "o.asMap():" + o);
String json = null;
if (o != null && o.asMap() != null) {
json = new Gson().toJson(o.asMap().toHashMap());
if (o != null && o != null) {
json = new Gson().toJson(o.toHashMap());
}
Log.d(TAG, "channel invokeMethod:" + name
+ " success, result=" + o + ", json=" + json);
Expand Down
Loading