增加扫码打开小程序接口
parent
04665b3934
commit
1dce1597e0
|
@ -91,6 +91,6 @@ kapt {
|
|||
}
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.finogeeks.lib:finapplet:2.34.12'
|
||||
implementation 'com.finogeeks.lib:finapplet:2.35.0-alpha20211229v01'
|
||||
implementation 'com.finogeeks.mop:plugins:2.34.12'
|
||||
}
|
|
@ -5,6 +5,7 @@ import android.text.TextUtils;
|
|||
import android.util.Log;
|
||||
|
||||
import com.finogeeks.lib.applet.client.FinAppClient;
|
||||
import com.finogeeks.lib.applet.interfaces.FinCallback;
|
||||
import com.finogeeks.lib.applet.sdk.model.StartAppletDecryptRequest;
|
||||
import com.finogeeks.mop.api.BaseApi;
|
||||
import com.finogeeks.mop.interfaces.ICallback;
|
||||
|
@ -28,7 +29,7 @@ public class AppletModule extends BaseApi {
|
|||
|
||||
@Override
|
||||
public String[] apis() {
|
||||
return new String[]{"openApplet", "scanOpenApplet"};
|
||||
return new String[]{"openApplet", "scanOpenApplet","qrcodeOpenApplet"};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,6 +38,8 @@ public class AppletModule extends BaseApi {
|
|||
openApplet(param, callback);
|
||||
} else if ("scanOpenApplet".equals(event)) {
|
||||
scanOpenApplet(param, callback);
|
||||
} else if ("qrcodeOpenApplet".equals(event)){
|
||||
qrcodeOpenApplet(param,callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,4 +112,28 @@ public class AppletModule extends BaseApi {
|
|||
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info));
|
||||
callback.onSuccess(new HashMap());
|
||||
}
|
||||
|
||||
private void qrcodeOpenApplet(Map param, ICallback callback){
|
||||
String qrcode = String.valueOf(param.get("qrcode"));
|
||||
FinAppClient.INSTANCE.getAppletApiManager().startAppletByQrcode(mContext, qrcode, new FinCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
callback.onSuccess(new HashMap());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int i, String s) {
|
||||
callback.onFail(new HashMap(){
|
||||
{
|
||||
put("info",s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(int i, String s) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue