SDK Interface Description
- JVerificationInterface,include SDK All interfaces
Settings Debug Mode
Supported Version
Started Supported Version 1.0.0
Interface definition
- JVerificationInterface. setDebugMode(boolean enable)
- Interface description:
- Settings to open debug Mode. true will print more log information. Recommendation init Call before interface.
- Parameter description:
- enable: debug Switches
- Call Example:
JVerificationInterface. setDebugMode(true);
SDK Initialize
Support time overtime configuration, echo parameters
Supported Version
Started Supported Version 2.5.0
Interface definition
- JVerificationInterface. init(Context context,int timeOut,RequestCallback callback)
- Interface description:
- Initialization interface. Recommendation Application Yes. onCreate Medium Call
- Parameter description:
- context: android Context
- timeOut: Timeout (ms), effective range (ms)5000,30000, if less than equal 5000 Or greater 30000 Take Default 10000. Recommended settings as 5001-10000.
- callback:Return interface
- Callback:
onResult(int code, String msg) - code: Return code.8000 Representing successful initialization, others failed, details of error code description
- msg: Description of results
- Call Example:
JVerificationInterface. init(this, 5000, new RequestCallback<String>() {
@Override
public void onResult(int code, String msg) {Log. d("tag","code =" + code + "msg =" + msg);
}
});
Supporting echo parameters
Supported Version
Started Supported Version 2.3.6
Interface definition
- JVerificationInterface. init(Context context,RequestCallback callback)
- Interface description:
- Initialization interface. Recommendation Application Yes. onCreate Medium Call
- Parameter description:
- context: android Context
- callback:Return interface
- Return note:onResult(int code, String msg)
- code: Return code.8000 Representing successful initialization, others failed, details of error code description
- msg: Description of results
- Call Example:
JVerificationInterface. init(this, new RequestCallback<String>() {
@Override
public void onResult(int code, String msg) {Log. d("tag","code =" + code + "msg =" + msg);
}
});
Successful initialization
Supported Version
Started Supported Version 2.3.2
Interface definition
- JVerificationInterface. isInitSuccess()
- Interface description:
- Access SDK Identification of success in overall initialization
- Return Result
- boolean: true - Success. false - Failed.
- Call Example:
boolean isSuccess = JVerificationInterface. isInitSuccess();
Get CurrentSIMCut. carriersType
Supported Version
Started Supported Version 3.4.0
Interface definition
- JVerificationInterface. operatorType(Context context)
- Interface description:
- Fetch the current cell phoneSIMCut. carriersType.
- Parameter description:
- context: android Context
- Description
- String: carriersType:UNKNOWN-Unknown;CM-China Mobile;CU-China Unicom;CT- China Telecom;CMHK-China Mobile Hong Kong
- Call Example:
String operatorType = JVerificationInterface. operatorType(this);
Determines whether the network environment supports a one-key login
Supported Version
Started Supported Version 1.1.3
Interface definition
- JVerificationInterface. checkVerifyEnable(Context context)
- Interface description:
- The current mobile phone network environment is judged to be usable for authentication.
- Parameter description:
- context: android Context
- Description
- Back true delegates can use;return false Other means of verification were suggested.
- Call Example:
boolean verifyEnable = JVerificationInterface. checkVerifyEnable(this);
if(!verifyEnable){Log. d(TAG,"当前网络环境不支持认证");
return;
}
Judge whether the network environment supports SMS validation
Supported Version
Started Supported Version 1.1.3
Interface definition
- JVerificationInterface. checkSmsEnable(Context context)
- Interface description:
- The current mobile phone web environment is judged as being capable of using text messaging.
- Parameter description:
- context: android Context
- Description
- Back true delegates can use;return false Other means of verification were suggested.
- Call Example:
boolean verifyEnable = JVerificationInterface. checkSmsEnable(this);
if(!verifyEnable){Log. d(TAG,"当前网络环境不支持短信");
return;
}
Let's see if the precept is valid.
Supported Version
Started Supported Version 3.1.7
Interface definition
- JVerificationInterface. isValidePreloginCache(Context context)
- Interface description:
- Determines whether the current precept number is valid.
- Parameter description:
- context: android Context
- Description
- Back true delegates can use;return false Other means of verification were suggested.
- Call Example:
boolean enable = JVerificationInterface. isValidePreloginCache(this);
Access to geographic information
Supported Version
Started Supported Version 2.9.6
Interface definition
JVerificationInterface. setLocationEanable(Context context, boolean eanable)
Interface description:
Geographic access switch, default access, true For opening.
Call Example:
JVerificationInterface. setLocationEanable(this,true);
One key login.
Initialize
Call SDK Before other process methods, make sure that initialization has been called or returns uninitialized, for more information SDK Initialize API After initialization, if you call the following functional interface, you are considered to agree to open Jiguang Securely certifying business functions, we collect and report personal information necessary for business functions.
Assess whether the network environment supports
Determines whether the current mobile phone network environment can use one key login, and if the network supports, call one key login API, or call another login API, details Assess whether the network environment supports API.
Preclaim number
- **SDK Caches the pretake result, and lifts the authorized page at a speed. It is therefore proposed to pull up the authorized page, e. g. by pre-altering this interface to a pre-take number on an open or business entry page. **
- ** Requests to be successful and not to repeat calls frequently. **
- ** Do not repeat the pre-number or pull up the authorized page interface in the pre-number callback. **
Supported Version
Started Supported Version 2.2.0
Interface definition
- JVerificationInterface. preLogin(Context context, int timeOut, PreLoginListener listener)
- Interface description:
- Authenticate CurrentcarriersIs the network able to log in with a single key that allows you to access the number information and improves the efficiency of one key login? It is recommended that this method be called before a key login is initiated.
- Parameter description:
- context: android Context
- timeOut: Timeout (ms), effective range (ms)5000,30000, if less than equal 5000 Or greater 30000 Take Default 10000. Recommended settings as 5001-10000.
- listenerInterface echoes
- Callback:
onResult(int code, String content) - code: Return code.7000 Delegates get success, others fail, see error code description
- content: Call result information description
- Call Example:
JVerificationInterface. preLogin(this, 5000,new PreLoginListener() {
@Override
public void onResult(final int code, final String content) {Log. d(TAG,"[" + code + "]message=" + content );}
});
Supported Version
Started Supported Version 3.1.0
Interface definition
- JVerificationInterface. preLogin(final boolean enableSMSService,final Context context, final int timeOut, final PreLoginListener listener)
- Interface description:
- Authenticate CurrentcarriersIs the network able to log in with a single key that allows you to access the number information and improves the efficiency of one key login? It is recommended that this method be called before a key login is initiated.
- Parameter description:
- enableSMSService: Whether to switch to SMS login if the pretook failed
- context: android Context
- timeOut: Timeout (ms), effective range (ms)5000,30000, if less than equal 5000 Or greater 30000 Take Default 10000. Recommended settings as 5001-10000.
- listenerInterface echoes
- Callback:
onResult(int code, String content) - code: Return code.7000 Delegates get success, others fail, see error code description
- content: Call result information description
- a1: Extension parameters, this version does not need to be addressed
- a2: Extension parameters, which need not be addressed
- Call Example:
JVerificationInterface. preLogin(fasle,this, 5000,new PreLoginListener() {
@Override
public void onResult(final int code, final String content,String a1,String a2) {Log. d(TAG,"[" + code + "]message=" + content );}
});
Clear Pretract Cache
Supported Version
Started Supported Version 2.4.3
Interface definition
- JVerificationInterface. clearPreLoginCache()
- Interface description:
- Clear the SDK cache.
- Call Example:
JVerificationInterface. clearPreLoginCache();
Pull up authorized pages
- ** One-key login is dependent on the result of the pre-number, which automatically occurs when the one-key login does not have a pre-number. **
- ** It is proposed to pull up the authorized page, e. g., by pre-altering this interface to a pre-alignment number on the open page or the business entry page, to increase the speed of the authorized page and optimize the experience. **
- ** When a one-key login request is successful, do not repeat calls frequently. carriersThe number of requests will be limited in unit time. **
- ** Do not repeat the pre-number or pull up the authorized page interface in the one-click logback. **
Supported Version
Started Supported Version 3.1.7
Interface definition
- JVerificationInterface. loginAuth(final Context context, LoginSettings settings, final VerifyListener listener)
- Interface description:
- Turn one key on the authorized page and get it after the user has authorized loginToken, and support bugging on authorized pages
- Parameter description:
- context: android Context
- settings: Login interface settings.
- listener: Login authorization returns
- Callback:
VerifyListener
onResult(int code, String content, String carrier, JSONObject carrierReturn) - code: Return code.6000 Representative loginToken failed.6001 Representative loginToken Fetching failed. Other returns code details
- content: return code explanatory information, if successful, content information representative loginToken.
- carrier: When successfulcarriersCM for China, CU for China China Unicom, CT for China China Telecom. It's possible to fail null
- carrierReturn: carriersOutcome information
- Call Example:
LoginSettings settings = new LoginSettings();
settings. setAutoFinish(true);// 设置登录完成后是否自动关闭授权页
settings. setTimeout(15 * 1000);// 设置超时时间, 单位毫秒. 合法范围(5000, 30000], 范围以外默认设置为 10000
settings. setAuthPageEventListener(new AuthPageEventListener() {
@Override
public void onEvent(int cmd, String msg) {//do something...}
});// 设置授权页事件监听
JVerificationInterface. loginAuth(this, settings, new VerifyListener() {
@Override
public void onResult(int code, String content, String operator, JSONObject operatorReturn) {if (code == 6000){Log. d(TAG, "code=" + code + ", token=" + content+",operator="+operator);
}else{Log. d(TAG, "code=" + code + ", message=" + content);
}
}
});
Supported Version
Started Supported Version 2.5.2
Interface definition
- JVerificationInterface. loginAuth(final Context context, LoginSettings settings, final VerifyListener listener)
- Interface description:
- Turn one key on the authorized page and get it after the user has authorized loginToken, and support bugging on authorized pages
- Parameter description:
- context: android Context
- settings: Login interface settings.
- listener: Login authorization returns
- Callback:
VerifyListener
onResult(int code, String content, String carrier) - code: Return code.6000 Representative loginToken failed.6001 Representative loginToken Fetching failed. Other returns code details
- content: return code explanatory information, if successful, content information representative loginToken.
- carrier: When successfulcarriersCM for China, CU for China China Unicom, CT for China China Telecom. It's possible to fail null
- Call Example:
LoginSettings settings = new LoginSettings();
settings. setAutoFinish(true);// 设置登录完成后是否自动关闭授权页
settings. setTimeout(15 * 1000);// 设置超时时间, 单位毫秒. 合法范围(5000,30000], 范围以外默认设置为 10000
settings. setAuthPageEventListener(new AuthPageEventListener() {
@Override
public void onEvent(int cmd, String msg) {//do something...}
});// 设置授权页事件监听
JVerificationInterface. loginAuth(this, settings, new VerifyListener() {
@Override
public void onResult(int code, String content, String operator) {if (code == 6000){Log. d(TAG, "code=" + code + ", token=" + content+",operator="+operator);
}else{Log. d(TAG, "code=" + code + ", message=" + content);
}
}
});
Supported Version
Started Supported Version 2.4.0
Interface definition
- JVerificationInterface. loginAuth(final Context context, boolean autoFinish, final VerifyListener listener, final AuthPageEventListener authPageEventListener)
- Interface description:
- Turn one key on the authorized page and get it after the user has authorized loginToken, and support bugging on authorized pages
- Parameter description:
- context: android Context
- boolean: Whether to automatically close the authorized page,true - Yes. false - Yes.
- listener: Login authorization returns
- authPageEventListenerdescription
- Callback:
- VerifyListener
onResult(int code, String content, String operator) - code: Return code.6000 Representative loginToken failed.6001 Representative loginToken Fetching failed. Other returns code details
- content: return code explanatory information, if successful, content information representative loginToken.
- carrier: When successfulcarriersCM for China, CU for China China Unicom, CT for China China Telecom. It's possible to fail null
- AuthPageEventListener
onEvent(int code, String content) - cmd: returns the code, as specified in the event return chart.
- content: Content description.
- Call Example:
JVerificationInterface. loginAuth(this, false, new VerifyListener() {
@Override
public void onResult(int code, String content, String operator) {if (code == 6000){Log. d(TAG, "code=" + code + ", token=" + content+",operator="+operator);
}else{Log. d(TAG, "code=" + code + ", message=" + content);
}
}
},new AuthPageEventListener() {
@Override
public void onEvent(int cmd, String msg) {Log. d(TAG, "[onEvent]. [" + cmd + "]message=" + msg);}
});
Event Return Code
| code | message | Remarks |
|---|---|---|
| 1 | login activity closed. | Enabling Page Close Event |
| 2 | login activity started. | Enabled Page Open Event |
| 3 | carrier privacy clicked. | carriersProtocol Click Event |
| 3 | privacy 1 clicked. | Custom protocol 1 click event |
| 3 | privacy 2 clicked. | Custom protocol 2 click events |
| 6 | checkbox checked. | Protocol Bar checkbox description |
| 7 | checkbox unchecked. | Protocol Bar checkbox description |
| 8 | login button clicked. | One Key Login Button (under Available) Click Event |
Note: received one-click login loginToken then return it to the application service and call it from the service provider REST APIToget a cell phone number.
Pull up the text login page
Supported Version
Started Supported Version 3.1.0
Interface definition
- JVerificationInterface. smsLoginAuth(final Context context, boolean autoFinish, final int timeOut, final SmsListener listener)
- Interface description:
- Pulls up text messages to log on the page, so that the client can customize the page style, and some configuration styles are compatible with the one-key login style, if part of the navigation bar, protocol bar, protocol display page, protocol secondary bullet window etc.
- Parameter description:
- context: android Context
- autoFinish: Set whether to automatically close the authorization after login is completed Page
- timeOut: Timeout (ms), effective range (ms)5000,30000, if less than equal 5000 Or greater 30000 Take Default 10000. Recommended settings as 5001-10000.
- listenerInterface echoes
- Callback:
onResult(int code, String content) - code: Return code.4000 Delegates get success, others fail, see error code description
- content: Call result information description
- Call Example:
JVerificationInterface. smsLoginAuth(this, true, 5000, new SmsListener(){
@Override
public void onResult(final int code, final String content){
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast. makeText(getBaseContext(), "[" + code + "]sms message=" + content, Toast. LENGTH_SHORT).show();
dismissLoadingDialog();
}
});
}
});
Close Authorized Page
Supported Version
Started Supported Version 2.5.2
Interface definition
- dismissLoginAuthActivity(boolean needCloseAnim, RequestCallback callback)
- Interface description:
- Close the access authorization page and if the current authorization is in progress loginAuth The interface will trigger immediately. 6002 Cancel the callback.
- Parameter description:
- needCloseAnim: Do you want to show the animation of the default authorized page closing (if any)?true - Yes. false - No need.
- Callback:
RequestCallback
onResult(int code, String desc) - code: Return code 0, mark off authorization successfully Page
- desc: returns the description of the code.
- Call Example:
JVerificationInterface. dismissLoginAuthActivity(true, new RequestCallback<String>() {
@Override
public void onResult(int code, String desc) {Log. i(TAG, "[dismissLoginAuthActivity] code =" + code + "desc =" + desc);}
});
Supported Version
Started Supported Version 2.3.0
Interface definition
- JVerificationInterface. dismissLoginAuthActivity()
- Interface description:
- Close the access authorization page and if the current authorization is in progress loginAuth The interface will trigger immediately. 6002 Cancel the callback.
- Call Example:
JVerificationInterface. dismissLoginAuthActivity();
Customise authorized page UI styles
Supported Version
Started Supported Version 2.1.0
Interface definition
- JVerificationInterface. setCustomUIWithConfig(JVerifyUIConfig uiConfig)
- Interface description:
- Modify the authorized page theme by setCustomUIWithConfig Method changes to authorized page theme, need to loginAuth Call before interface
- Parameter description:
- uiConfig: Theme profiler, developer in JVerifyUIConfig.java Category calls the corresponding method to configure the corresponding elements in the authorized page, for details JVerifyUIConfig Configure Element Description.
- Call Example:
JVerifyUIConfig uiConfig = new JVerifyUIConfig. Builder().setAuthBGImgPath("main_bg").setNavColor(0xff0086d0).setNavText("登录").setNavTextColor(0xffffffff).setNavReturnImgPath("umc SDK_return_bg").setLogoWidth(70).setLogoHeight(70).setLogoHidden(false).setNumberColor(0xff333333).setLogBtnText("本机号码一键登录").setLogBtnTextColor(0xffffffff).setLogBtnImgPath("umc SDK_login_btn_bg").setPrivacyNameAndUrlBeanList(List<PrivacyBean>).setPrivacyNameAndUrlBeanList(List<PrivacyBean>).setUncheckedImgPath("umc SDK_uncheck_image").setCheckedImgPath("umc SDK_check_image").setSloganTextColor(0xff999999).setLogoOffsetY(50).setLogoImgPath("logo_cm").setNumFieldOffsetY(170).setSloganOffsetY(230).setLogBtnOffsetY(254).setNumberSize(18).setPrivacyState(false).setNavTransparent(false).addCustomView(mBtn, true, new JVerifyUIClickCallback() {
@Override
public void onClicked(Context context, View view) {Toast. makeText(context,"动态注册的其他按钮",Toast. LENGTH_SHORT).show();}
}).addCustomView(mBtn2, false, new JVerifyUIClickCallback() {
@Override
public void onClicked(Context context, View view) {Toast. makeText(context,"动态注册的其他按钮 222",Toast. LENGTH_SHORT).show();}
}).addNavControlView(navBtn, new JVerifyUIClickCallback() {
@Override
public void onClicked(Context context, View view) {Toast. makeText(context,"导航栏按钮点击",Toast. LENGTH_SHORT).show();}
}).setPrivacyOffsetY(30).build();
JVerificationInterface. setCustomUIWithConfig(uiConfig);
Enables the addition of custom controls to the authorized page
Supported Version
Started Supported Version 2.1.0
Interface definition
- addCustomView(View view, boolean finishFlag,JVerifyUIClickCallback callback)
- Interface description:
- Add custom controls to authorized pages
- Parameter description:
- view: Developer uploads a custom control and developer needs to set the layout properties of the control in advance. SDK Support only RelativeLayout Layout
- finishFlag: Whether to click on a custom control on the authorized page finish Authorized Pages
- callbackClickback for custom controls
- Return: onClicked(Context context, View view)
- context: android Context
- viewObject: Custom Control
- Call Example:
Button mBtn = new Button(this);
mBtn. setText("其他方式登录");
RelativeLayout. LayoutParams mLayoutParams1 = new RelativeLayout. LayoutParams(RelativeLayout. LayoutParams. WRAP_CONTENT,RelativeLayout. LayoutParams. WRAP_CONTENT);
mLayoutParams1.setMargins(0, LoginUIHelper. dp2Pix(this,450.0f),0,0);
mBtn. setLayoutParams(mLayoutParams1);
new JVerifyUIConfig. Builder().addCustomView(mBtn, true, new JVerifyUIClickCallback() {
@Override
public void onClicked(Context context, View view) {Toast. makeText(context,"动态注册的其他按钮",Toast. LENGTH_SHORT).show();}
});
Second bullet window to add custom control
Supported Version
Started Supported Version 2.1.0
Interface definition
- addCustomViewToCheckDialog(View view,JVerifyUIClickCallback callback)_
- Interface description:
- Add a custom control to the secondary bullet window of the privacy protocol
- Parameter description:
- view: Developer uploads a custom control and developer needs to set the layout properties of the control in advance. SDK Support only RelativeLayout Layout
- callbackClickback for custom controls
- Return: onClicked(Context context, View view)
- context: android Context
- viewObject: Custom Control
- Call Example:
//协议二次弹窗自定义按钮示例
Button mBtn3 = new Button(this);
mBtn3.setText("取消");
mBtn3.setTextSize(15);
RelativeLayout. LayoutParams layoutParams3 = new RelativeLayout. LayoutParams(dp2Pix(getApplicationContext(), 140), dp2Pix(getApplicationContext(), 40));
layoutParams3.setMargins(ScreenUtils. dp2Pix(this, 20), ScreenUtils. dp2Pix(this, 10), ScreenUtils. dp2Pix(this, 0), ScreenUtils. dp2Pix(this, 0));
// layoutParams3.addRule(RelativeLayout. LEFT_OF, ScreenUtils. ID_LAYOUT_BT_LOGIN_PRIVACY_CHECK_DIALOG);
layoutParams3.addRule(RelativeLayout. BELOW, ScreenUtils. ID_LAYOUT_LB_PROTOCOL_PRIVACY_CHECK_DIALOG);
// mBtn3.setBackgroundResource(R. drawable. main_btn_other);
mBtn3.setBackgroundColor(0x00000000);
mBtn3.setLayoutParams(layoutParams3);
mBtn3.setTextColor(0xffffffff);
configBuilder. addCustomViewToCheckDialog(mBtn3, new JVerifyUIClickCallback() {
@Override
public void onClicked(Context context, View view) {
Toast. makeText(context, "协议二次弹窗取消", Toast. LENGTH_SHORT).show();
}
});
Add custom controls to the text message page
Supported Version
Started Supported Version 2.1.0
Interface definition
- addSmsCustomView(View view, boolean finishFlag,JVerifyUIClickCallback callback)_
- Interface description:
- Add custom controls to the text message page
- Parameter description:
- view: Developer uploads a custom control and developer needs to set the layout properties of the control in advance. SDK Support only RelativeLayout Layout
- finishFlag: Whether to click on a custom control on a text message page finish Authorized Pages
- callbackClickback for custom controls
- Return: onClicked(Context context, View view)
- context: android Context
- viewObject: Custom Control
- Call Example:
Button mBtn = new Button(this);
mBtn. setText("自定义按钮");
RelativeLayout. LayoutParams mLayoutParams1 = new RelativeLayout. LayoutParams(RelativeLayout. LayoutParams. WRAP_CONTENT,RelativeLayout. LayoutParams. WRAP_CONTENT);
mLayoutParams1.setMargins(0, LoginUIHelper. dp2Pix(this,450.0f),0,0);
mBtn. setLayoutParams(mLayoutParams1);
new JVerifyUIConfig. Builder().addSmsCustomView(mBtn, true, new JVerifyUIClickCallback() {
@Override
public void onClicked(Context context, View view) {Toast. makeText(context,"亲, 你点了短信页面的自定义按钮",Toast. LENGTH_SHORT).show();}
});
Authorize page navigation bar to add custom controls
Supported Version
Started Supported Version 2.3.2
Interface definition
- addNavControlView(View view, JVerifyUIClickCallback callback)
- Interface description:
- Add a custom control to the top navigation bar in the authorized page
- Parameter description:
- view: Developer uploads a custom control and developer needs to set the layout properties of the control in advance. SDK Support only RelativeLayout Layout
- callbackClickback for custom controls
- Callback:
- onClicked(Context context, View view)
- context: android Context
- viewObject: Custom Control
- Call Example:
Button navBtn = new Button(this);
navBtn. setText("导航栏按钮");
RelativeLayout. LayoutParams navBtnParam = new RelativeLayout. LayoutParams(RelativeLayout. LayoutParams. WRAP_CONTENT,RelativeLayout. LayoutParams. WRAP_CONTENT);
navBtnParam. addRule(RelativeLayout. ALIGN_PARENT_RIGHT,RelativeLayout. TRUE);
navBtn. setLayoutParams(navBtnParam);
new JVerifyUIConfig. Builder().addNavControlView(navBtn, new JVerifyUIClickCallback() {
@Override
public void onClicked(Context context, View view) {Toast. makeText(context,"导航栏按钮点击",Toast. LENGTH_SHORT).show();}
});
Sets the authorized page of the bullet window mode
Supported Version
Started Supported Version 2.3.8
Interface definition
- setDialogTheme(int dialogWidth, int dialogHeight, int offsetX, int offsetY, boolean isBottom)
- Interface description:
- Set authorized page as window mode
- Parameter description:
- dialogWidth: Window width, in dp
- dialogHeight: Window height, in dp
- offsetX: Window relative x-axis offset, in dp
- offsetY: window relative y-axis offset, in dp
- isBottom: window at the bottom of the screen. After Settings offsetY Will expire
- Call Example:
new JVerifyUIConfig. Builder().setDialogTheme(410, 390, 0, 0, false)
Window Mode Style Settings
** In manifest description activity Set Window Style style**
AndroidManifest. xml
<activity android:name="cn. jiguang. verify SDK. CtLoginActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/ActivityDialogStyle" <!-- 设置自定义 style -->
android:screenOrientation="unspecified"
android:launchMode="singleTop">
</activity>
style Add specific bullet window styles
res/values/styles. xml
<style name="ActivityDialogStyle">
<!-- 隐藏 action bar 和 title bar-->
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<!-- 背景透明 -->
<item name="android:windowIsTranslucent">true</item>
<!--dialog 圆角 -->
<item name="android:windowBackground">@drawable/dialog_bg</item>
</style>
** Defines the round corner properties of windows**
res/drawable/dialog_bg. xml
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp"/>
</shape>
Set authorized page vertical UI
Supported Version
Started Supported Version 2.4.8
Interface definition
- setCustomUIWithConfig(JVerifyUIConfig uiConfigPortrait,JVerifyUIConfig uiConfigLandscape)
- Interface description:
- Modify authorized page themes to support the uploading of two sets of vertical and cross-screens config. SDK Switches according to the current vertical state. description loginAuth Call before interface.
- Parameter description:
- uiConfigPortrait: Screen config
- uiConfigLandscape: Screen config
- Call Example:
JVerifyUIConfig portrait = configBuilder. setAuthBGImgPath("main_bg").setNavColor(0xff0086d0).setNavText("登录").setNavTextColor(0xffffffff).setNavReturnImgPath("umc SDK_return_bg").setLogoWidth(70).setLogoHeight(70).setLogoHidden(false).setNumberColor(0xff333333).setLogBtnText("本机号码一键登录").setLogBtnTextColor(0xffffffff).setLogBtnImgPath("umc SDK_login_btn_bg").setPrivacyNameAndUrlBeanList(List<PrivacyBean>).setAppPrivacyColor(0xff666666, 0xff0085d0).setUncheckedImgPath("umc SDK_uncheck_image").setCheckedImgPath("umc SDK_check_image").setSloganTextColor(0xff999999).setLogoOffsetY(50).setLogoImgPath("logo_cm").setNumFieldOffsetY(190).setSloganOffsetY(220).setLogBtnOffsetY(254).setNumberSize(18).setPrivacyState(false).setNavTransparent(false).build();
JVerifyUIConfig landscape = configBuilder.setAuthBGImgPath("main_bg").setNavColor(0xff0086d0).setNavText("登录").setNavTextColor(0xffffffff).setNavReturnImgPath("umc SDK_return_bg").setLogoWidth(70).setLogoHeight(70).setLogoHidden(false).setNumberColor(0xff333333).setLogBtnText("本机号码一键登录").setLogBtnTextColor(0xffffffff).setLogBtnImgPath("umc SDK_login_btn_bg").setPrivacyNameAndUrlBeanList(List<PrivacyBean>).setAppPrivacyColor(0xff666666, 0xff0085d0).setUncheckedImgPath("umc SDK_uncheck_image").setCheckedImgPath("umc SDK_check_image").setSloganTextColor(0xff999999).setLogoOffsetY(30).setLogoImgPath("logo_cm").setNumFieldOffsetY(150).setSloganOffsetY(185).setLogBtnOffsetY(210).setPrivacyOffsetY(30).build();
JVerificationInterface. setCustomUIWithConfig(portrait, landscape);
- It needs to be both. manifest Corresponding Mandate Page Activity: LoginAuthActivity, CtLoginActivity Medium Configuration
android:configChanges="orientation|keyboardHidden|screenSize"Properties - target SDKVersion > 26 Application, in 8.0 If the system specifies the direction of the authorized page as follows: "android:screenOrientation="portrait"'"You'll miss. Only fullscreen opaque activities can request orientation
- Solutions:
- The authorized page will beandroid:screenOrientation" Set to "portrait", "landscape" Value other than that.
- target SDKVersion Replace with < = 26.
JVerifyUIConfig One-click login -- description of configuration elements
x axis without setting offsets by the default horizontal center for all components
- Set Mandate Page Background
- Supported version:2.1.1
- Note: Pictures will by default stretch the entire screen to fit different sizes of mobile phones, recommended.9.png Images are used to solve adaptation problems.
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setAuthBGImgPath | String | Set background pictures |
| setAuthBGGifPath | String | Set Local gif Background picture to be placed drawable File, enter the picture name. |
| setAuthBGVideoPath | String,String | Set Background Video Documentation. 1. Support local paths such as: "android. resource://" + context. getPackageName() + "/" + R. raw. testvideo Supporting network pathways,https Starts with a resource address (recommended to use a local path after downloading to the local area, the network path will have network problems such as Carton) and sets the default first-frequency image (to be placed) drawable file, enter the picture name, if Video File path is local, so you can fill null) |
| Regional | Methodology | Parameter Type | Annotations |
|---|---|---|---|
| 1 Status Bar | setStatusBarColorWithNav | boolean | Sets the status bar to the same colour as the navigation bar. Only android 5.0 The above equipment is in effect. since 2.4.1 |
| setStatusBarDarkMode | boolean | Sets the status bar dark mode. Only android 6.0 The above equipment is in effect. since 2.4.8 | |
| setStatusBarTransparent | boolean | Sets whether the status bar is transparent. Only android 4.4 The above equipment is in effect. since 2.4.8 | |
| setStatusBarHidden | boolean | Sets whether the status bar is hidden. since 2.4.8 | |
| setVirtualButtonTransparent | boolean | Sets whether the virtual keybar background is transparent. since 2.5.2 | |
| 2 Navigation Bar | setNavColor | int | Sets the colour of the navigation bar |
| setNavText | String | Set the navigation bar title text | |
| setNavTextColor | int | Sets the text colour for the navigation bar title | |
| setNavReturnImgPath | String | Set the Navigator Bar Return button icon | |
| setNavTransparent | boolean | Sets whether the navigation bar background is transparent. Default is not transparent. since 2.3.2 | |
| setNavTextSize | int | Sets the font size for the text of the navigation bar title (in unit: sp).since 2.4.1 | |
| setNavReturnBtnHidden | boolean | Sets whether the navigation bar returns the button to hide. Default does not hide. since 2.4.1 | |
| setNavReturnBtnWidth | int | Sets the width of the navigation bar to return the button. since 2.4.8 | |
| setNavReturnBtnHeight | int | Sets the navigation bar to return the height of the button. since 2.4.8 | |
| setNavReturnBtnOffsetX | int | Sets the navigation bar to return the button to offset from the left side of the screen. since 2.4.8 | |
| setNavReturnBtnRightOffsetX | int | Sets how the navigation bar returns the button to shift from the right side of the screen. since 2.4.8 | |
| setNavReturnBtnOffsetY | int | Sets the transition of the navigation bar from the top of the button. since 2.4.8 | |
| setNavHidden | boolean | Sets whether the navigation bar is hidden. since 2.4.8 | |
| setNavTextBold | boolean | Sets whether the heading font of the navigation bar is thicker. since 2.5.4 | |
| ③logo | setLogoWidth | int | Settings logo Width (dp) |
| setLogoHeight | int | Settings logo Height (dp) | |
| setLogoHidden | boolean | Hide logo | |
| setLogoOffsetY | int | Settings logo y Offset relative to the edge under the titlebar | |
| setLogoImgPath | String | Settings logo Picture | |
| setLogoOffsetX | int | Settings logo Shifts the x-axis relative to the left of the screen. since 2.3.8 | |
| setLogoOffsetBottomY | int | Settings logo Shifts relative to y-axis at the bottom of the screen. since 2.4.8 | |
| Number four. | setNumberColor | int | Set the font colour for cell phone number |
| setNumberSize | Number | Sets the font size of the cell phone number (in sp).since 2.3.2 | |
| setNumFieldOffsetY | int | Set the number bar to the edge of the heading bar | |
| setNumFieldOffsetX | int | Sets the number bar to offset the x-axis to the left of the screen. since 2.3.8 | |
| setNumberFieldOffsetBottomY | int | Sets the number bar to offset the y-axis relative to the bottom of the screen. since 2.4.8 | |
| setNumberFieldWidth | int | Sets the width of the number bar. since 2.4.8 | |
| setNumberFieldHeight | int | Sets the height of the number bar. since 2.4.8 | |
| setNumberTextBold | boolean | Sets if the cell phone number font is thicker. since 2.5.4 | |
| ⑤slogan | setSloganTextColor | int | Set Move slogan Text Colour |
| setSloganOffsetY | int | Settings slogan y Offset relative to the edge under the titlebar | |
| setSloganOffsetX | int | Settings slogan Shifts the x-axis relative to the left of the screen. since 2.3.8 | |
| setSloganBottomOffsetY | int | Settings slogan Offset of y-axis relative to the bottom edge of the screen, if this property is to be effectivesetSloganOffsetY=-1.since 2.3.8 | |
| setSloganTextSize | int | Settings slogan font size. since 2.4.8 | |
| setSloganTextBold | boolean | Settings slogan whether the font is thicker. since 2.5.4 | |
| Six Login Buttons | setLogBtnText | String | Set Login Button Text |
| setLogBtnTextColor | int | Set text colour for login buttons | |
| setLogBtnImgPath | String | Set an authorized login button picture | |
| setLogBtnOffsetY | int | Set login button to the edge of the titlebar y Offset | |
| setLogBtnOffsetX | int | Sets the login button to offset the x-axis to the left of the screen. since 2.3.8 | |
| setLogBtnWidth | int | Sets the width of the login button. since 2.3.8 | |
| setLogBtnHeight | int | Sets the height of the login button. since 2.3.8 | |
| setLogBtnTextSize | int | Sets the font size of the login button. since 2.3.8 | |
| setLogBtnBottomOffsetY | int | Sets the login button to offset the y-axis relative to the bottom of the screen,setLogBtnOffsetYSet to one. since 2.4.8 | |
| setLogBtnTextBold | boolean | Sets if the login button font is thicker. since 2.5.4 | |
| 7 Privacy Bar | setAppPrivacyOne | String,String | Custom privacy clause 1: Onlysince 2.3.8-2.7.2Effective;2.7.3 The subsequent version is invalid |
| setAppPrivacyTwo | String,String | Custom privacy clause II: Onlysince 2.3.8-2.7.2Effective;2.7.3 The subsequent version is invalid |
|
| setAppPrivacyColor | int,int | Sets the name of the privacy clause: |
|
| setPrivacyMarginL | int | Sets the space of the protocol to the left of the authorized page. since 2.9.6 | |
| setPrivacyMarginR | int | Sets the spacing of the protocol relative to the right of the authorized page. since 2.9.6 | |
| setPrivacyMarginT | int | Sets the spacing of the protocol relative to the top of the authorized page. since 2.9.6 | |
| setPrivacyMarginB | int | Sets the space between the protocol and the bottom of the authorized page. since 2.9.6 | |
| setCheckedImgPath | String | Pictures when setting check box | |
| setUncheckedImgPath | String | Set pictures when checkbox is not selected | |
| setPrivacyState | boolean | Sets the privacy clause to be selected by default, which is not selected by default. since 2.3.2 | |
| setPrivacyOffsetY | int | Sets the privacy clause relative to the bottom edge of the authorized page y offset, which will be abandoned. | |
| setPrivacyOffsetX | int | Set up privacy provisions (or checkbox The interval between the screen and the screen. since 2.7.2About to be abandoned. | |
| setPrivacyTextCenterGravity | boolean | Sets whether the text of the privacy clause is aligned (default left alignment).since 2.3.8 | |
| setPrivacyText | String,String | Sets the text outside the name of the privacy clause. If login is agreed...and login using its own number; since 2.7.3 |
|
| setPrivacyTextSize | int | Sets the text size of the privacy clause (in units:sp).since 2.4.1 | |
| setPrivacyTopOffsetY | int | Sets the shift of the privacy clause relative to the bottom y-axis of the navigation bar. since 2.4.8 | |
| setPrivacyCheckboxHidden | boolean | Set privacy provisions checkbox Whether it's hidden. since 2.4.8 | |
| setPrivacyCheckboxSize | int | Set privacy provisions checkbox Dimensions. since 2.4.8 | |
| setPrivacyWithBookTitleMark | boolean | Set privacy provisionscarriersWhether or not the name of the agreement is added. since 2.4.8 | |
| setPrivacyCheckboxInCenter | boolean | Set privacy provisions checkbox Whether to centre vertically relative to the text of the agreement. Default tops. since 2.4.8 | |
| enableHintToast | boolean Toast | Protocol Bar checkbox When not selected, click the login button to pop up toast Prompts the user to tick the protocol, by default. Support custom Toast. since 2.5.0 | |
| enablePrivacyCheckDialog | boolean | Supports opening bullet windows when setting unchecked privacy; when setting enablePrivacyCheckDialog Yes true enableHintToast It's also to be created as true. since 2.9.0 | |
| setPrivacyTextBold | boolean | Sets if the text of the privacy clause is thicker. since 2.5.4 | |
| setPrivacyUnderlineText | boolean | Sets whether the text of the privacy clause is underlined. since 2.5.4 | |
| setVirtualButtonColor | int | Sets the virtual navigation bar background at the bottom of the authorized interface. since 2.7.3 | |
| setPrivacyNameAndUrlBeanList(List) | String,String,String | PrivacyBeanParticipation: since 2.7.4 |
|
- Authorization Page Privacy Protocol web Page
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setIsPrivacyViewDarkMode | boolean | Set protocol presentation web whether the page fits in dark mode. since 2.9.6 true: Follow the system. false: Do not support dark mode |
| setPrivacyNavColor | int | Set protocol presentation web Page Navigation Bar background colour. since 2.4.8 |
| setPrivacyNavTitleTextColor | int | Set protocol presentation web Page Navigation Bar title text colour. since 2.4.8 |
| setPrivacyNavTitleTextSize | int | Set protocol presentation web The page navigation bar title text size (sp).since 2.4.8 |
| setPrivacyNavReturnBtn | View | Set protocol presentation web Page Navigator returns the button icon. since 2.4.8 |
| setPrivacyStatusBarColorWithNav | boolean | Set Authorization Protocol web Page status bar is the same colour as the navigation bar. Only android 5.0 The above equipment is in effect. since 2.5.2 |
| setPrivacyStatusBarDarkMode | boolean | Set Authorization Protocol web Page status bar dark mode. Only android 6.0 The above equipment is in effect. since 2.5.2 |
| setPrivacyStatusBarTransparent | boolean | Set Authorization Protocol web is the page status bar transparent. Only android 4.4 The above equipment is in effect. since 2.5.2 |
| setPrivacyStatusBarHidden | boolean | Set Authorization Protocol web whether the page status bar is hidden. since 2.5.2 |
| setPrivacyVirtualButtonTransparent | boolean | Set Authorization Protocol web whether the page virtual keybar background is transparent. since 2.5.2 |
| setVirtualButtonHidden | boolean | Supports hidden bottom virtual keys. since 2.9.0 |
| setPrivacyNavTitleTextBold | boolean | Set protocol presentation web Whether or not the page navigation bar font is thicker. since 2.5.4 |
| setPrivacyVirtualButtonColor | int | Set the virtual navigation bar background at the bottom of the privacy interface since 2.7.3 |
- Custom loading view
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setLoadingView | View,Animation | Settings login The show. loading view And animated effects. since 2.4.8 |
- Authorise Page Animation
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setNeedStartAnim | boolean | Sets whether to show the default animation when pulling up the authorized page. Default display. since 2.5.2 |
| setNeedCloseAnim | boolean | Sets whether to show the default animation when closing the authorized page. Default display. since 2.5.2 |
- Developer custom controls
| Methodology | Parameter Type | Annotations |
|---|---|---|
| addCustomView | See methodological definition above | Add custom controls and click taps to the authorized page blank |
| addNavControlView | See methodological definition above | Add custom controls and click taps to the top of the authorized page navigation bar |
- Second protocol bullet window configuration
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setPrivacyCheckDialogTitleTextSize | int | The size of the protocol binary window font |
| setPrivacyCheckDialogTitleTextBold | boolean | The protocol double-bulb window font is thick |
| setPrivacyCheckDialogTitleTextColor | int | Protocol second bullet window font colour |
| setPrivacyCheckDialogContentTextGravity | int | It's a double-barrel agreement. |
| setPrivacyCheckDialogContentTextSize | int | Font size of protocol binary window protocol |
| setPrivacyCheckDialogContentTextPaddingL | int | Second bullet window protocol to the left. Distance |
| setPrivacyCheckDialogContentTextPaddingT | int | On the top of the second bullet window protocol. Distance |
| setPrivacyCheckDialogContentTextPaddingR | int | Arrange for second bullet window protocol right range |
| setPrivacyCheckDialogContentTextPaddingB | int | Under the second bullet window protocol. Distance |
| setPrivacyCheckDialogLogBtnImgPath | String | Background picture of the protocol secondary window login button |
| setPrivacyCheckDialoglogBtnTextColor | int | Font colour for protocol double window login button |
| setPrivacyCheckDialogWidth | int | The length of the double-blast window itself. |
| setPrivacyCheckDialogHeight | int | It's a double-bulb window. |
| setprivacyCheckDialogGravity | int | Arrange for second-hand alignment of bullet windows |
| setPrivacyCheckDialogOffsetX | int | The protocol's secondary bullet window itself for the father. |
| setPrivacyCheckDialogOffsetY | int | The protocol's secondary bullet window itself for the father. |
| setPrivacyCheckDialogLogBtnWidth | int | The width of the protocol secondary window login button |
| setPrivacyCheckDialogLogBtnHeight | int | High button for protocol double window login |
| setPrivacyCheckDialogBackgroundColor | int | Protocol Blast Window Background Color |
| setPrivacyCheckDialogBackgroundImgPath | String | Protocol Blast Background Picture |
- SMS Login Page
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setPrivacyCheckDialogTitleTextSize | int | The size of the protocol binary window font |
| setPrivacyCheckDialogTitleTextColor | int | Protocol second bullet window font colour |
| setPrivacyCheckDialogContentTextGravity | int | It's a double-barrel agreement. |
| setPrivacyCheckDialogContentTextSize | int | Font size of protocol binary window protocol |
| setPrivacyCheckDialogContentTextPaddingL | int | Second bullet window protocol to the left. Distance |
| setPrivacyCheckDialogContentTextPaddingT | int | On the top of the second bullet window protocol. Distance |
| setPrivacyCheckDialogContentTextPaddingR | int | Arrange for second bullet window protocol right range |
| setPrivacyCheckDialogContentTextPaddingB | int | Under the second bullet window protocol. Distance |
| setPrivacyCheckDialogLogBtnImgPath | String | Background picture of the protocol secondary window login button |
| setPrivacyCheckDialoglogBtnTextColor | int | Font colour for protocol double window login button |
| setPrivacyCheckDialogWidth | int | The length of the double-blast window itself. |
| setPrivacyCheckDialogHeight | int | It's a double-bulb window. |
| setprivacyCheckDialogGravity | int | Arrange for second-hand alignment of bullet windows |
| setPrivacyCheckDialogOffsetX | int | The protocol's secondary bullet window itself for the father. |
| setPrivacyCheckDialogOffsetY | int | The protocol's secondary bullet window itself for the father. |
| setPrivacyCheckDialogLogBtnWidth | int | The width of the protocol secondary window login button |
| setPrivacyCheckDialogLogBtnHeight | int | High button for protocol double window login |
| setPrivacyCheckDialogBackgroundColor | int | Protocol Blast Window Background Color |
| setPrivacyCheckDialogBackgroundImgPath | String | Protocol Blast Background Picture |
- Authorized Page Language
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setAppLanguageType | int | English. since 3.4.0 |
JVerifyUIConfig SMS Login Page - Profile Element Description
x axis without setting offsets by the default horizontal center for all components
- Set Background to Login Page
- Supported version:2.1.1
- Note: Pictures will by default stretch the entire screen to fit different sizes of mobile phones, recommended.9.png Images are used to solve adaptation problems.
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setAuthBGImgPath | String | Set background pictures |
| setAuthBGGifPath | String | Set Local gif Background picture to be placed drawable File, enter the picture name. |
| setAuthBGVideoPath | String,String | Set Background Video Documentation. 1. Support local paths such as: "android. resource://" + context. getPackageName() + "/" + R. raw. testvideo Supporting network pathways,https Starts with a resource address (recommended to use a local path after downloading to the local area, the network path will have network problems such as Carton) and sets the default first-frequency image (to be placed) drawable file, enter the picture name, if Video File path is local, so you can fill null) |
- Status Bar
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setStatusBarColorWithNav | boolean | Sets the status bar to the same colour as the navigation bar. Only android 5.0 The above equipment is in effect. since 2.4.1 |
| setStatusBarDarkMode | boolean | Sets the status bar dark mode. Only android 6.0 The above equipment is in effect. since 2.4.8 |
| setStatusBarTransparent | boolean | Sets whether the status bar is transparent. Only android 4.4 The above equipment is in effect. since 2.4.8 |
| setStatusBarHidden | boolean | Sets whether the status bar is hidden. since 2.4.8 |
| setVirtualButtonTransparent | boolean | Sets whether the virtual keybar background is transparent. since 2.5.2 |
- Login Page Navigation Bar
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setNavColor | int | Sets the colour of the navigation bar |
| setSmsNavText | String | Set the navigation bar title text |
| setNavTextColor | int | Sets the text colour for the navigation bar title |
| setNavReturnImgPath | String | Set the Navigator Bar Return button icon |
| setNavTransparent | boolean | Sets whether the navigation bar background is transparent. Default is not transparent. since 2.3.2 |
| setNavTextSize | int | Sets the font size for the text of the navigation bar title (in unit: sp).since 2.4.1 |
| setNavReturnBtnHidden | boolean | Sets whether the navigation bar returns the button to hide. Default does not hide. since 2.4.1 |
| setNavReturnBtnWidth | int | Sets the width of the navigation bar to return the button. since 2.4.8 |
| setNavReturnBtnHeight | int | Sets the navigation bar to return the height of the button. since 2.4.8 |
| setNavReturnBtnOffsetX | int | Sets the navigation bar to return the button to offset from the left side of the screen. since 2.4.8 |
| setNavReturnBtnRightOffsetX | int | Sets how the navigation bar returns the button to shift from the right side of the screen. since 2.4.8 |
| setNavReturnBtnOffsetY | int | Sets the transition of the navigation bar from the top of the button. since 2.4.8 |
| setNavHidden | boolean | Sets whether the navigation bar is hidden. since 2.4.8 |
| setNavTextBold | boolean | Sets whether the heading font of the navigation bar is thicker. since 2.5.4 |
- Login Page logo
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setSmsLogoWidth | int | Settings logo Width (dp) |
| setSmsLogoHeight | int | Settings logo Height (dp) |
| setSmsLogoHidden | boolean | Hide logo |
| setSmsLogoOffsetY | int | Settings logo y Offset relative to the edge under the titlebar |
| setSmsLogoImgPath | String | Settings logo Picture |
| setSmsLogoOffsetX | int | Settings logo Shifts the x-axis relative to the left of the screen. since 2.3.8 |
| setSmsLogoOffsetBottomY | int | Settings logo Shifts relative to y-axis at the bottom of the screen. since 2.4.8 |
- Login Page slogan
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setSmsSloganTextColor | int | Set Move slogan Text Colour |
| setSmsSloganOffsetY | int | Settings slogan y Offset relative to the edge under the titlebar |
| setSmsSloganOffsetX | int | Settings slogan Shift the x-axis relative to the left of the screen |
| setSmsSloganOffsetBottomY | int | Settings slogan Offset y-axis relative to the bottom edge of the screen |
| smsSloganTextSize | int | Settings slogan Font Size |
| setSmsSloganTextBold | boolean | Settings slogan Whether fonts are thicker |
| setSmsSloganHidden | boolean | Settings slogan Whether fonts are hidden |
- Login Page Number Input Bar
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setSmsPhoneInputViewTextColor | int | Set the font colour for the cell phone number input box |
| setSmsPhoneInputViewTextSize | Number | Sets the font size of the cell phone number input box (units to configure).since 3.1.0 |
| setSmsPhoneInputViewOffsetX | int | Sets the input box to offset the x-axis to the left of the screen. since 3.1.0 |
| setSmsPhoneInputViewOffsetY | int | Sets the input box to offset the y-axis relative to the bottom of the screen. since 3.1.0 |
| setSmsPhoneInputViewWidth | int | Sets the width of the number input box. since 3.1.0 |
| setSmsPhoneInputViewHeight | int | Sets the number to enter the height of the frame. since 3.1.0 |
- Login Page Authentication Code Input Bar
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setSmsVerifyCodeEditTextViewTextColor | int | Set the font colour for the validation code input box |
| setSmsVerifyCodeEditTextViewTextSize | Number | Sets the font size of the validation code input box (in sp).since 3.1.0 |
| setSmsVerifyCodeEditTextViewOffsetY | int | Set validation code input box to the edge of the titlebar y offset |
| setSmsVerifyCodeEditTextViewTextOffsetX | int | Sets the validation code input box to offset the x-axis to the left of the screen. since 3.1.0 |
| setSmsVerifyCodeEditTextViewOffsetR | int | Sets the validation code input box to offset to the right of the screen. since 3.1.0 |
| setSmsVerifyCodeEditTextViewWidth | int | Sets the width of the validation code input box. since 3.1.0 |
| setSmsVerifyCodeEditTextViewHeight | int | Sets the height of the validation code input box. since 3.1.0 |
- Login Page Get Verifier Button
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setSmsGetVerifyCodeTextViewTextColor | int | Sets the text colour for the get-validation button |
| setSmsGetVerifyCodeBtnBackgroundPath | String | Set a picture to get the authentication code button |
| setSmsGetVerifyCodeTextViewOffsetY | int | Set the access to authentication button to offset y against the edge of the titlebar |
| setSmsGetVerifyCodeTextViewOffsetX | int | Sets to get the authentication code button to offset the x-axis to the left of the screen. since 3.1.0 |
| setSmsGetVerifyCodeDialog | int | Sets the width of the access code button. since 3.1.0 |
| setSmsGetVerifyCodeTextSize | int | Sets the font size for the get-validation button. since 3.1.0 |
| setSmsGetVerifyCodeTextViewOffsetR | int | Sets the shift of the fetching authentication code button relative to the y-axis at the bottom of the screen. since 3.1.0 |
- Login button
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setSmsLogBtnText | String | Set Login Button Text |
| setSmsLogBtnTextColor | int | Set text colour for login buttons |
| setSmsLogBtnBackgroundPath | String | Set an authorized login button picture |
| setSmsLogBtnOffsetY | int | Set login button to the edge of the titlebar y Offset |
| setSmsLogBtnOffsetX | int | Sets the login button to offset the x-axis to the left of the screen. since 2.3.8 |
| setSmsLogBtnWidth | int | Sets the width of the login button. since 2.3.8 |
| setSmsLogBtnHeight | int | Sets the height of the login button. since 2.3.8 |
| setSmsLogBtnTextSize | int | Sets the font size of the login button. since 2.3.8 |
| setSmsLogBtnBottomOffsetY | int | Sets the login button to offset the y-axis relative to the bottom of the screen. since 2.4.8 |
| isSmsLogBtnTextBold | boolean | Sets if the login button font is thicker. since 2.5.4 |
- Login Page Privacy Bar
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setAppPrivacyColor | int,int | Set a name colour for privacy clauses (basic text colour, protocol text colour) |
| setSmsPrivacyMarginL | int | Sets the space of the protocol relative to the left of the login page. since 2.9.6 |
| setSmsPrivacyMarginR | int | Sets the space between the protocol and the right of the login page. since 2.9.6 |
| setSmsPrivacyMarginT | int | Sets the space between the protocol and the top of the login page. since 2.9.6 |
| setSmsPrivacyMarginB | int | Sets the space of the protocol relative to the bottom of the login page. since 2.9.6 |
| setSmsPrivacyCheckboxMargin | int[] | Sets the space of the protocol relative to the login page. since 2.9.6 |
| setCheckedImgPath | String | Pictures when setting check box |
| setUncheckedImgPath | String | Set pictures when checkbox is not selected |
| setPrivacyState | boolean | Sets the privacy clause to be selected by default, which is not selected by default. since 2.3.2 |
| isSmsPrivacyTextGravityCenter | boolean | Sets whether the text of the privacy clause is aligned (default left alignment).since 3.1.0 |
| setPrivacyText | String,String,String,String | Sets the text outside the name of the privacy clause. If login is agreed... and...,... And login using your own machine number; parameter 1 is: "Accord to login." Parameter 2 is: "and". Parameter 3 is: ",". Parameter 4 is: "and login with your own machine number." since 2.3.8-2.7.2, 2.7.3 The subsequent version is invalid |
| setPrivacyText | String,String | Sets the text outside the name of the privacy clause. If login is agreed...... And login using your own machine number; parameter 1 is: "Accord to login." Parameter 2 is: "and login with your own machine number." since 2.7.3 |
| setPrivacyTextSize | int | Sets the text size of the privacy clause (in units:sp).since 2.4.1 |
| setSmsPrivacyTopOffsetY | int | Sets the shift of the privacy clause relative to the bottom y-axis of the navigation bar. since 2.4.8 |
| setPrivacyCheckboxHidden | boolean | Set privacy provisions checkbox Whether it's hidden. since 2.4.8 |
| setSmsPrivacyCheckboxSize | int | Set privacy provisions checkbox Dimensions. since 2.4.8 |
| setPrivacyWithBookTitleMark | boolean | Set privacy provisionscarriersWhether or not the name of the agreement is added. since 2.4.8 |
| isSmsPrivacyCheckboxInCenter | boolean | Set privacy provisions checkbox Whether to centre vertically relative to the text of the agreement. Default tops. since 2.4.8 |
| setPrivacyTextWidth | int | Discard since 2.7.2 |
| enableHintToast | boolean Toast | Protocol Bar checkbox When not selected, click the login button to pop up toast Prompts the user to tick the protocol, by default. Support custom Toast. since 2.5.0 |
| enablePrivacyCheckDialog | boolean | Supports opening bullet windows when setting unchecked privacy; when setting enablePrivacyCheckDialog Yes true enableHintToast It's also to be created as true. since 2.9.0 |
| setPrivacyTextBold | boolean | Sets if the text of the privacy clause is thicker. since 2.5.4 |
| setPrivacyUnderlineText | boolean | Sets whether the text of the privacy clause is underlined. since 2.5.4 |
| setVirtualButtonColor | int | Sets the virtual navigation bar background at the bottom of the authorized interface. since 2.7.3 |
| setPrivacyNameAndUrlBeanList(List) | PrivacyBean(String name, String url, String separator) | PrivacyBean Reference; Parameter 1 is: setting the name of the developer ' s privacy clause; Parameter 2 is: Developer ' s privacy clause URL;para. 3 is: a connection symbol. since 2.7.4 |
- Access page privacy protocol web Page
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setIsPrivacyViewDarkMode | boolean | Set protocol presentation web whether the page fits in dark mode. since 2.9.6 true: Follow the system. false: Do not support dark mode |
| setPrivacyNavColor | int | Set protocol presentation web Page Navigation Bar background colour. since 2.4.8 |
| setPrivacyNavTitleTextColor | int | Set protocol presentation web Page Navigation Bar title text colour. since 2.4.8 |
| setPrivacyNavTitleTextSize | int | Set protocol presentation web The page navigation bar title text size (sp).since 2.4.8 |
| setPrivacyNavReturnBtn | View | Set protocol presentation web Page Navigator returns the button icon. since 2.4.8 |
| setPrivacyStatusBarColorWithNav | boolean | Set Authorization Protocol web Page status bar is the same colour as the navigation bar. Only android 5.0 The above equipment is in effect. since 2.5.2 |
| setPrivacyStatusBarDarkMode | boolean | Set Authorization Protocol web Page status bar dark mode. Only android 6.0 The above equipment is in effect. since 2.5.2 |
| setPrivacyStatusBarTransparent | boolean | Set Authorization Protocol web is the page status bar transparent. Only android 4.4 The above equipment is in effect. since 2.5.2 |
| setPrivacyStatusBarHidden | boolean | Set Authorization Protocol web whether the page status bar is hidden. since 2.5.2 |
| setPrivacyVirtualButtonTransparent | boolean | Set Authorization Protocol web whether the page virtual keybar background is transparent. since 2.5.2 |
| setVirtualButtonHidden | boolean | Supports hidden bottom virtual keys. since 2.9.0 |
| setPrivacyNavTitleTextBold | boolean | Set protocol presentation web Whether or not the page navigation bar font is thicker. since 2.5.4 |
| setPrivacyVirtualButtonColor | int | Set the virtual navigation bar background at the bottom of the privacy interface since 2.7.3 |
- Custom loading view
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setLoadingView | View,Animation | Settings login The show. loading view And animated effects. since 2.4.8 |
- Login Page Animation
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setNeedStartAnim | boolean | Sets whether to show the default animation when pulling up the authorized page. Default display. since 2.5.2 |
| setNeedCloseAnim | boolean | Sets whether to show the default animation when closing the authorized page. Default display. since 2.5.2 |
- Developer custom controls
| Methodology | Parameter Type | Annotations |
|---|---|---|
| addCustomView | See methodological definition above | Add custom controls and click taps to the authorized page blank |
| addNavControlView | See methodological definition above | Add custom controls and click taps to the top of the authorized page navigation bar |
- Second protocol bullet window configuration
| Methodology | Parameter Type | Annotations |
|---|---|---|
| setPrivacyCheckDialogTitleTextSize | See methodological definition above | The size of the protocol binary window font |
| setPrivacyCheckDialogTitleTextColor | See methodological definition above | Protocol second bullet window font colour |
| setPrivacyCheckDialogContentTextGravity | See methodological definition above | It's a double-barrel agreement. |
| setPrivacyCheckDialogContentTextSize | See methodological definition above | Font size of protocol binary window protocol |
| setPrivacyCheckDialogLogBtnImgPath | See methodological definition above | Background picture of the protocol secondary window login button |
| setPrivacyCheckDialoglogBtnTextColor | See methodological definition above | Font colour for protocol double window login button |
| setPrivacyCheckDialogWidth | See methodological definition above | The length of the double-blast window itself. |
| setPrivacyCheckDialogHeight | See methodological definition above | It's a double-bulb window. |
| setprivacyCheckDialogGravity | See methodological definition above | Protocol second bullet window font colour |
| setPrivacyCheckDialogOffsetX | See methodological definition above | The protocol's secondary bullet window itself for the father. |
| setPrivacyCheckDialogOffsetY | See methodological definition above | The protocol's secondary bullet window itself for the father. |
| setPrivacyCheckDialogLogBtnWidth | See methodological definition above | The width of the protocol secondary window login button |
| setPrivacyCheckDialogLogBtnHeight | See methodological definition above | High button for protocol double window login |
| setPrivacyCheckDialogBackgroundColor | See methodological definition above | Protocol Blast Window Background Color |
| setPrivacyCheckDialogBackgroundImgPath | See methodological definition above | Protocol Blast Background Picture |
Pull up authorized page (old)
Supported Version
Started Supported Version 2.3.0
Definition of interface
- JVerificationInterface. loginAuth(final Context context, boolean autoFinish, final VerifyListener listener)
- Interface description:
- Turn one key on the authorized page and get it after the user has authorized loginToken
- Parameter description:
- context: android Context
- boolean: Whether to automatically close the authorized page,true - Yes. false - No; if this field is set to false, please call upon receipt of one key login callback SDK Provides an authorized page closure method.
- listenerInterface echoes
- Callback:
onResult(int code, String content, String carrier) - code: Return code.6000 Representative loginToken failed.6001 Representative loginToken Fetching failed. Other returns code details
- content: return code explanatory information, if successful, content information representative loginToken.
- carrier: When successfulcarriersCM for China, CU for China China Unicom, CT for China China Telecom. It's possible to fail null
- Call Example:
JVerificationInterface. loginAuth(this, false, new VerifyListener() {
@Override
public void onResult(int code, String content, String operator) {
if (code == 6000){
Log. d(TAG, "code=" + code + ", token=" + content+",operator="+operator);
}else{
Log. d(TAG, "code=" + code + ", message=" + content);
}
}
});
Pull up authorized page (old)
Supported Version
Started Supported Version 2.0.0
Definition of interface
- JVerificationInterface. loginAuth(final Context context, final VerifyListener listener)
- Interface description:
- Turn one key on the authorized page and get it after the user has authorized loginToken
- Parameter description:
- context: android Context
- listenerInterface echoes
- Callback:
onResult(int code, String content, String carrier) - code: Return code.6000 Representative loginToken failed.6001 Representative loginToken Fetching failed. Other returns code details
- content: return code explanatory information, if successful, content information representative loginToken.
- carrier: When successfulcarriersCM for China, CU for China China Unicom, CT for China China Telecom. It's possible to fail null
- Call Example:
JVerificationInterface. loginAuth(this, new VerifyListener() {
@Override
public void onResult(int code, String content, String operator) {
if (code == 6000){
Log. d(TAG, "code=" + code + ", token=" + content+",operator="+operator);
}else{
Log. d(TAG, "code=" + code + ", message=" + content);
}
}
});
Number authentication
Initialize
Call SDK Before other process methods, make sure that initialization has been called or returns uninitialized, for more information SDK Initialize API After initialization, if you call the following functional interface, you are considered to agree to open Jiguang Securely certifying business functions, we collect and report personal information necessary for business functions.
Assess whether the network environment supports
Determines whether the current mobile phone network environment can be used to authenticate the number and, if supported by the network, call the number API, or call another authentication mode API, details Assess whether the network environment supports API.
Access number authentication token(new)
Supported Version
Started Supported Version 2.2.0
Interface definition
- JVerificationInterface. getToken(Context context,int timeOut, VerifyListener listener)
- Interface description:
- Access current online at scheduled time sim Carcass. carriersand token, the interface return timed out of time if the time is exceeded. If a successful representative can be used to verify the cell phone number, the failure to obtain the message is recommended.
- China moved Hong Kong for a while APITo replace the authentication interface, if a user with a Hong Kong mobile card is required to determine whether it is Hong Kong or not, if it is not Hong Kong.
- Parameter description:
- context: android Context
- timeOut: Timeout (ms), effective range (ms)5000,30000, if less than equal 5000 Or greater 30000 Take Default 10000. Recommended settings as 5001-10000.
- listenerInterface echoes
- Callback:
onResult(int code, String content, String carrier, JSONObject carrierReturn) - code: Return code.2000 Delegates get success, others fail, see error code description
- content: when successful token, which can be used to call the cell phone interface. token It is valid for one minute and requires re-acquisition before it can be used. Not supported
- carrier: When successfulcarriersCM for China, CU for China China Unicom, CT for China China Telecom. It's possible to fail null
- carrierReturn: carriersOutcome information
- Call Example:
JVerificationInterface. getToken(this, 5000,new VerifyListner{
@Override
public void onResult(int code, String content, String operator) {if (code == 2000){Log. d(TAG, "token=" + content + ", operator=" + operator);
} else {Log. d(TAG, "code=" + code + ", message=" + content);
}
});
Note: Developers can adopt SDK Access token The callback information of the interface to select the authentication method, if obtained successfully token You can use it again. JVerificationPerform number validation; if acquired token Failure to do so requires the continuation of the validation with, for example, text message authentication codes.
Access number authentication token(old)
Supported Version
Started Supported Version 1.0.0
Interface definition
- JVerificationInterface. getToken(Context context, VerifyListener listener)
- Interface description:
- Get Current Online sim Carcass. carriersand token If a successful representative can be used to verify the cell phone number, the failure to obtain the message is recommended. Default timeout is 5000ms, this interface is abandoned and the new interface is recommended.
- China moved Hong Kong for a while APITo replace the authentication interface, if a user with a Hong Kong mobile card is required to determine whether it is Hong Kong or not, if it is not Hong Kong.
- Parameter description:
- context: androidContext
- listenerInterface echoes
- Callback:
onResult(int code, String content, String carrier) - code: Return code.2000 Delegates get success, others fail, see error code description
- content: when successful token, which can be used to call the cell phone interface. token It is valid for one minute and requires re-acquisition before it can be used. Not supported
- carrier: When successfulcarriersCM for China, CU for China China Unicom, CT for China China Telecom. It's possible to fail null
- Call Example:
JVerificationInterface. getToken(this, new VerifyListner{
@Override
public void onResult(int code, String content, String operator) {
if (code == 2000){
Log. d(TAG, "token=" + content + ", operator=" + operator);
} else {
Log. d(TAG, "code=" + code + ", message=" + content);
}
});
SDK Launch Number Authentication
2.4.3 Version started and this interface removed
Supported Version
Started Supported Version 1.0.0
Interface definition
- JVerificationInterface. verifyNumber(Context context, String token, String phone, VerifyListener listener)
- Interface description:
- Check if the cell phone is currently online. sim The card's cell phone number.
- Parameter description:
- context: android Context
- token: Select to fill,getToken Interface returned token If empty, call automatically getToken Method to execute cell phone validation
- phone: Required, cell phone number to verify. If it's passed, it'll be in the papers. 4001 Parameter Error
- listenerInterface echoes
- Callback:
onResult(int code, String content, String carrier) - code: Return code.1000 It's the same thing.1001 Representative authentication inconsistent, others failed, details of error code description
- content: Return code explanatory information
- carrier: When successfulcarriersCM for China, CU for China China Unicom, CT for China China Telecom. It's possible to fail null
- Call Example:
JVerificationInterface. verifyNumber(this, null, "13512341234", new VerifyListner{
@Override
public void onResult(int code, String content, String operator) {
if (code == 1000){
Log. d(TAG, "verify consistent, operator=" + operator);
} else if (code == 1001) {
Log. d(TAG, "verify not consistent");
} else {
Log. d(TAG, "code=" + code + ", message=" + content);
}
});
Note ****: Developer calls the interface and needs to find the application on the management console and to open it in [authentication settings]-[other settings].SDKInitiation of authentication], it is recommended that the number authentication be initiated from the developer service end.
Authentication Code
SDK Get Authentication Code
Supported Version
Started Supported Version 2.6.0
Interface definition
- JVerificationInterface. getSmsCode(Context context, String phonenum, String signid, String tempid, RequestCallback listener)
- Interface description:
- Get SMS authentication code. Use this feature if Portal ConsoleJSMSModule Add ApplicationSMS signatureAnd the SMS template. See:Operational guidelines-Once you get the SMS authentication code through this interface, you need to call Jiguang Authentication API For validation, see:Authentication API
-Parameterdescription:-context:androidContext-phonenumNumber-signid:SMSsignatureid, if null, by defaultSMS signature id - tempid: SMS template id
- listener:Return interface
- Callback:
- onResult(int code, String msg)
- code: Return code.3000 It's a good way to get a pass. msg Only identification number obtained for this purposeuuid) Other failed, see error code description
- msg: Description of results
- Call Example:
String phonenum = "159xxxxxxxx";
String sign_id = null;
String temp_id = null;
JVerificationInterface. getSmsCode(this, phonenum, sign_id, temp_id, new RequestCallback<String>() {
@Override
public void onResult(final int code, final String result) {if (code == 3000) {tvLog. post(new Runnable() {
@Override
public void run() {
String text = "uuid:" + result;
Log. d(TAG, "getCodeSuccess: " + text);
tvLog. setText(text);
}
});} else {tvLog. post(new Runnable() {
@Override
public void run() {
String text = "errCode:" + code + ",errmsg:" + result;
Log. d(TAG, "getCodeFail: " + text);
tvLog. setText(text);
}
});}
}
});
Set the interval between the time and the time to get the authentication code
Supported Version
Started Supported Version 2.6.0
Interface definition
- JVerificationInterface. setSmsIntervalTime(long intervalTime)
- Interface description:
- Set the interval between the time and after which the authentication code is obtained twice, default 10000ms, effective scope (5000,300000)
- Parameter description:
- intervalTimeTime interval, in ms.
- Call Example:
JVerificationInterface. setSmsIntervalTime(60000);// 设置间隔时间为 60 秒
Expand business-related settings
Optional Personal Information Settings
Call this API To configure optional personal data collection
Supported Version
Started Supported Version 3.1.7We need to work together. JCore Android SDK v4.6.0and above
Interface definition
JVerificationInterface. setCollectControl(Context context,JVerifyCollectControl control)
Interface Description
- Data acquisition configuration to ensure you use Jiguang We strongly recommend that you all collect the good results of the security certification.
Parameter Description
- context: android Context
control: Data Acquisition Item Configuration Category, corresponding parameter set tofalseIt is not collected. Default astrue, collect corresponding data items.
Call Example
JVerifyCollectControl. Builder ss=new JVerifyCollectControl. Builder();
ss. cell(true);....
JVerifyCollectControl build = ss. build();
JVerificationInterface. setCollectControl(this, build);
JVerifyCollectControlControl Class
IMEICollect Switches
public Build imei(boolean enable)
Methodological note ConfigureIMEICustom messagetrue, false-Collection not permitted
MACCollect Switches
public Build mac(boolean enable)
Methodological note ConfigureMACCustom messagetrue, false-Collection not permitted
CELLCollect Switches
public Build cell(boolean enable)
Methodological note ConfigureCELLCustom messagetrue, false-Collection not permitted
IMSICollect Switches
public Build imsi(boolean enable)
Methodological note ConfigureIMSICustom messagetrue, false-Collection not permitted
Authentication SDKPartial access rights
ICCIDPermission Control
Supported Version
Started Supported Version 3.4.2
Interface definition
- JVerifyDevicePermissions. setIccidEnable(boolean enable)
- Interface description:
- Settings Allow AccessICCIDInformation (for increasing double-card success rate). Default allows access.
- Parameter description:
- enable: true means ICCID, falseNot allowed
- Call Example:
JVerifyDevicePermissions. setIccidEnable(false); // 禁止获取ICCID
Expand business-related settings
Wind Configuration
Supported Version
Started Supported Version 3.2.3
Interface definition
- JVerificationInterface. setSecureControl(Context context,boolean enable)
Interface Description
If there is a telephonic need, call the interface.
Parameter Description
context: android Context
control: If there is a special need for wind control, you can call the interface and set the parameter tofalse
Call Example
JVerificationInterface. setSecureControl(this, false);
Expand Business Functional Settings
Call this API To configure extended operations
Supported Version
Started Supported Version 3.1.7We need to work together. JCore Android SDK v4.6.0and above
Apply Self Start
JCollectionAuth. enableAutoWakeup(Context context,boolean isAutoWakeupEnable);
Parameter Definition
context
Apply Context
isAutoWakeupEnable
Apply self-start switch, default totrue, false-Representatives Close
Set up network monitoring optimization
Supported Version
Started Supported Version 3.2.1
Interface definition
- JVerificationInterface. enableNetworkMonitoringOptimizer(boolean enable)
Interface Description
The default is on. SDKUsed in initialization android. net. China UnicomivityManager Listening to network changes, users can access the interface to disable SDKListening to the network at initialization
If you need to use this interface, please use SDKCall before Initialization
Parameter Description
enable: On or off
Call Example
JVerificationInterface. enableNetworkMonitoringOptimizer(false);
Supported Version
Started Supported Version 3.3.0
Interface definition
- JVerificationInterface. enableHuaweiNetworkMonitoring(boolean enable)
Interface Description
Default closes, Huawei is disabled for device default, set if neededenableHuaweiNetworkMonitoringandenableNetworkMonitoringOptimizerYestrue
If you need to use this interface, please use SDKCall before Initialization
Parameter Description
enable: On or off
Call Example
JVerificationInterface. enableHuaweiNetworkMonitoring(true);