-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wanghualei
committed
Jul 5, 2023
1 parent
06fba0f
commit 48f357d
Showing
6 changed files
with
98 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
android/src/main/java/com/finogeeks/mop/impls/MyUserProfileHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.finogeeks.mop.impls; | ||
|
||
import android.content.Context; | ||
import android.os.Handler; | ||
import android.os.Looper; | ||
import android.util.Log; | ||
|
||
import com.finogeeks.lib.applet.client.FinAppInfo; | ||
import com.finogeeks.lib.applet.modules.userprofile.IUserProfileHandler; | ||
import com.finogeeks.mop.service.MopPluginService; | ||
|
||
import java.util.Map; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.json.JSONObject; | ||
|
||
import io.flutter.plugin.common.MethodChannel; | ||
|
||
public class MyUserProfileHandler implements IUserProfileHandler { | ||
private static final String TAG = "MyUserProfileHandler"; | ||
|
||
private Handler handler = new Handler(Looper.getMainLooper()); | ||
|
||
@Override | ||
public void getUserProfileWithAppletInfo(@NotNull Context context, @NotNull FinAppInfo finAppInfo, @NotNull UserProfileCallback callback) { | ||
MethodChannel channel = MopPluginService.getInstance().getMethodChannel(); | ||
Log.d(TAG, "getUserProfileWithAppletInfo:"); | ||
channel.invokeMethod("extensionApi:getUserProfile", null, new MethodChannel.Result() { | ||
@Override | ||
public void success(Object mapResult) { | ||
JSONObject result = null; | ||
try { | ||
result = new JSONObject(mapResult); | ||
} catch (Exception e) { | ||
|
||
} | ||
|
||
if (result == null) { | ||
callback.onError(null); | ||
} else { | ||
callback.onSuccess(result); | ||
} | ||
} | ||
|
||
@Override | ||
public void error(String errorCode, String errorMessage, Object errorDetails) { | ||
callback.onError(null); | ||
} | ||
|
||
@Override | ||
public void notImplemented() { | ||
callback.onError(null); | ||
} | ||
}); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters