简介

基于闪验sdk开发的手机验证插件,能完全取代短信验证。

一、插件短链:

http://yyfr.net/q1A

二、源码地址:

https://github.com/apkplug/plugspace/tree/master/CiaPlugUser

三、宿主配置

1 权限配置:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

2 组件配置:无

3 其他配置:无

四、插件使用

1、验证

url : apkplug://cia/verify

传入参数:

AppId:String:你在闪验申请的appid

AuthKey:String:你在闪验申请的AuthKey

phone : String :电话号码

返回参数:object[0]:boolean:是否验证成功,如果是false:则object[1]为错误原因

五、调用代码

DispatchAgent dispatchAgent = new DispatchAgent(FrameworkFactory.getInstance().getFrame().getSystemBundleContext());

HashMap<String,Object> params = new HashMap<String, Object>();
params.put("phone",mPhoneEt.getText().toString());
dispatchAgent.call("apkplug://cia/verify", params, new WorkerCallback() {
@Override
public void reply(URI uri, Object... objects) throws Exception {
    Log.e("reply",objects[0].toString()+" "+objects[1]);
}

@Override
public void timeout(URI uri) throws Exception {

}

@Override
public void Exception(URI uri, Throwable throwable) {
    Log.e("exception",throwable.getMessage());
}
});