From b32997577f54a5619e3db31e34d01787289c2972 Mon Sep 17 00:00:00 2001 From: yangbingqiao Date: Mon, 10 Oct 2022 16:16:15 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8DgetPhoneNumber?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../finogeeks/mop/api/mop/AppletHandlerModule.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java index e58f2b0..d2b2c55 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java @@ -1,8 +1,6 @@ package com.finogeeks.mop.api.mop; -import android.app.PendingIntent; import android.content.Context; -import android.content.Intent; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Handler; @@ -29,7 +27,6 @@ import com.google.gson.reflect.TypeToken; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.json.JSONException; import org.json.JSONObject; import java.io.ByteArrayOutputStream; @@ -352,13 +349,13 @@ public class AppletHandlerModule extends BaseApi { FinAppTrace.d("AppletHandlerModule", "getPhoneNumberResult,param:" + param.toString()); callback.onSuccess(null); if (phoneNumberCallback != null) { - JSONObject jsonObject = new JSONObject(); try { - jsonObject.put("phone", param.get("phone")); - } catch (JSONException e) { + JSONObject jsonObject = new JSONObject(param.get("phone").toString()); + phoneNumberCallback.onSuccess(jsonObject); + } catch (Exception e) { e.printStackTrace(); + phoneNumberCallback.onFailure(); } - phoneNumberCallback.onSuccess(jsonObject); } }