SDK Interface Description
-
JVerificationInterface, Include all interfaces of the SDK
Set Debug Mode
Supported versions
Interface definition
-
JVerificationInterface.setDebugMode(boolean enable) -
Interface description: -
Set whether to enable debug mode. True will print more log information. It is recommended to call before the init interface.
-
-
Parameter description: -
Enable: debug switch
-
-
Call example:
-
JVerificationInterface.setDebugMode( true );
SDK Initialization
Support timeout configuration and callback parameters
Supported versions
Interface definition
-
JVerificationInterface.init(Context context, int timeOut,RequestCallback callback) -
Interface description: -
Initialize the interface. It is recommended to call in onCreate of Application
-
-
Parameter description: -
Context: Android context -
TimeOut: timeout (ms). The valid value range is (500030000]. If it is less than or equal to 5000 or greater than 30000, the default value is 10000 The recommended setting is 5001-10000 -
Callback: callback interface
-
-
Callback description:
onResult(int code, String msg) -
Code: return code. 8000 indicates successful initialization and others indicate failure. See error code description for details -
Msg: Result description
-
-
Call example:
-
JVerificationInterface. init ( this , five thousand , new RequestCallback < String >() { @Override
public void onResult ( int code, String msg ) { Log . d ( "tag" , "code =" + code + "msg =" + msg); } });
Support callback parameters
Supported versions
Interface definition
-
JVerificationInterface.init(Context context, RequestCallback callback) -
Interface description: -
Initialize the interface. It is recommended to call in onCreate of Application
-
-
Parameter description: -
Context: Android context -
Callback: callback interface
-
-
Callback description:** onResult(int code, String msg) ** -
Code: return code. 8000 indicates successful initialization and others indicate failure. See error code description for details -
Msg: Result description
-
-
Call example:
-
JVerificationInterface. init ( this , new RequestCallback < String >() { @Override
public void onResult ( int code, String msg ) { Log . d ( "tag" , "code =" + code + "msg =" + msg); } });
Get the ID of whether initialization is successful
Supported versions
Interface definition
-
JVerificationInterface.isInitSuccess() -
Interface description: -
Obtain the ID of whether the overall initialization of the sdk is successful
-
-
Return Results -
Boolean: true - success, false - failure
-
-
Call example:
-
boolean isSuccess = JVerificationInterface.isInitSuccess();
Determine whether the network environment supports one click login
Supported versions
Interface definition
-
JVerificationInterface.checkVerifyEnable(Context context) -
Interface description: -
Determine whether the current mobile network environment can use authentication.
-
-
Parameter description: -
Context: Android context
-
-
Return description: -
Return true to indicate that it can be used; If false is returned, it is recommended to use other authentication methods.
-
-
Call example:
-
boolean verifyEnable = JVerificationInterface.checkVerifyEnable( this ); if (!verifyEnable){Log.d(TAG, "The current network environment does not support authentication" ); return ; }
Determine whether the network environment supports SMS verification
Supported versions
Interface definition
-
JVerificationInterface.checkSmsEnable(Context context) -
Interface description: -
Determine whether the current mobile phone network environment can use SMS login.
-
-
Parameter description: -
Context: Android context
-
-
Return description: -
Return true to indicate that it can be used; If false is returned, it is recommended to use other authentication methods.
-
-
Call example:
-
boolean verifyEnable = JVerificationInterface.checkSmsEnable( this ); if (!verifyEnable){Log.d(TAG, "SMS is not supported in the current network environment" ); return ; }
Judge whether the prefetch number is valid
Supported versions
Interface definition
-
JVerificationInterface.isValidePreloginCache(Context context) -
Interface description: -
Judge whether the current prefetch number is valid.
-
-
Parameter description: -
Context: Android context
-
-
Return description: -
Return true to indicate that it can be used; If false is returned, it is recommended to use other authentication methods.
-
-
Call example:
-
boolean enable = JVerificationInterface.isValidePreloginCache( this );
Whether to obtain geographical location information
Supported versions
Interface definition
JVerificationInterface.setLocationEanable(Context context, boolean eanable) -
Interface description: -
The geographical position acquisition switch is enabled by default, and true is enabled.
-
-
Call example:
-
JVerificationInterface.setLocationEanable( this , true );
One click login
initialization
Determine whether the network environment supports
Prefetch number
-
The sdk will cache the prefetch number results, and increase the speed of the authorization page pulling. Therefore, it is recommended to call this interface to prefetch the number before pulling up the authorization page, such as on the opening page or the business entry page. -
After the request is successful, do not repeatedly call. -
Do not call the prefetch number repeatedly or pull up the authorization page interface in the prefetch number callback.
Supported versions
Interface definition
-
JVerificationInterface.preLogin(Context context, int timeOut, PreLoginListener listener) -
Interface description: -
Verify whether the current operator network can perform one click login operation. This method will cache the number retrieval information and improve the efficiency of one click login. It is recommended to call this method before launching one click login.
-
-
Parameter description: -
Context: Android context -
TimeOut: timeout (ms). The valid value range is (500030000]. If it is less than or equal to 5000 or greater than 30000, the default value is 10000 The recommended setting is 5001-10000 -
Listener: interface callback
-
-
Callback description:
onResult(int code, String content) -
Code: return code. 7000 indicates success, and others indicate failure. See error code description for details -
Content: Call result information description
-
-
Call example:
-
JVerificationInterface.preLogin( this , five thousand , new PreLoginListener () { @Override
public void onResult ( final int code, final String content) {Log.d(TAG, "[" + code + "]message=" + content );} });
Supported versions
Interface definition
-
JVerificationInterface.preLogin(final boolean enableSMSService , final Context context, final int timeOut, final PreLoginListener listener) -
Interface description: -
Verify whether the current operator network can perform one click login operation. This method will cache the number retrieval information and improve the efficiency of one click login. It is recommended to call this method before launching one click login.
-
-
Parameter description: -
EnableSMSService: Whether to switch to SMS login mode when prefetching number fails -
Context: Android context -
TimeOut: timeout (ms). The valid value range is (500030000]. If it is less than or equal to 5000 or greater than 30000, the default value is 10000 The recommended setting is 5001-10000 -
Listener: interface callback
-
-
Callback description:
onResult(int code, String content) -
Code: return code. 7000 indicates success, and others indicate failure. See error code description for details -
Content: Call result information description -
A1: Extension parameter. This version does not need to be ignored -
A2: Extension parameter. This version does not need to be ignored
-
-
Call example:
-
JVerificationInterface. preLogin (fasle, this , five thousand , new PreLoginListener () { @Override
public void onResult ( final int code, final String content, String a1, String a2 ) { Log . d ( TAG , "[" + code + "]message=" + content );} });
Clear prefetch number cache
Supported versions
Interface definition
-
JVerificationInterface.clearPreLoginCache() -
Interface description: -
Clear the current prefetch number result cache of the sdk.
-
-
Call example:
-
JVerificationInterface .clearPreLoginCache ();
Pull up the authorization page
-
One click login depends on the result of the prefetch number. If there is no prefetch number, the number will be automatically prefetched during one click login. -
It is recommended to call this interface for prefetch number before pulling up the authorization page, such as on the opening page or business entry page, to improve the speed of pulling up the authorization page and optimize the experience. -
After a successful one click login request, do not call it repeatedly. The operator will limit the number of requests per unit time. -
Do not repeatedly call the prefetch number or pull up the authorization page interface in the one click login callback.
Supported versions
Interface definition
-
JVerificationInterface.loginAuth(final Context context, LoginSettings settings, final VerifyListener listener) -
Interface description: -
Call up the one click login authorization page to obtain the loginToken after user authorization, and support the authorization page event listening
-
-
Parameter description: -
Context: Android context -
Settings: login interface settings. -
Listener: Login authorization result callback
-
-
Callback description:
VerifyListener
onResult(int code, String content, String operator, JSONObject operatorReturn) -
Code: return code. 6000 indicates that the loginToken was obtained successfully, and 6001 indicates that the loginToken was obtained failed. See the description for other return codes -
Content: The explanation information of the return code. If obtained successfully, the content information represents loginToken. -
Operator: when successful, it is the corresponding operator. CM represents China Mobile, CU represents China Unicom, and CT represents China Telecom. May be null on failure -
OperatorReturn: operator result information
-
-
Call example:
-
LoginSettings settings = new LoginSettings (); settings. setAutoFinish ( true ); //Set whether to automatically close the authorization page after login settings. setTimeout ( fifteen * one thousand ); //Set the timeout in milliseconds. The legal range (5000, 30000], and the default setting outside the range is 10000 settings. setAuthPageEventListener ( new AuthPageEventListener () { @Override
public void onEvent ( int cmd, String msg ) { //do something...} }); //Set authorization page event listening JVerificationInterface. loginAuth ( this , settings, new VerifyListener () { @Override
public void onResult ( int code, String content, String operator, JSONObject operatorReturn ) { if (code == six thousand ){ Log . d ( TAG , "code=" + code + ", token=" + content+ ",operator=" +operator); } else { Log . d ( TAG , "code=" + code + ", message=" + content); } } });
Supported versions
Interface definition
-
JVerificationInterface.loginAuth(final Context context, LoginSettings settings, final VerifyListener listener) -
Interface description: -
Call up the one click login authorization page to obtain the loginToken after user authorization, and support the authorization page event listening
-
-
Parameter description: -
Context: Android context -
Settings: login interface settings. -
Listener: Login authorization result callback
-
-
Callback description:
VerifyListener
onResult(int code, String content, String operator) -
Code: return code. 6000 indicates that the loginToken was obtained successfully, and 6001 indicates that the loginToken was obtained failed. See the description for other return codes -
Content: The explanation information of the return code. If obtained successfully, the content information represents loginToken. -
Operator: when successful, it is the corresponding operator. CM represents China Mobile, CU represents China Unicom, and CT represents China Telecom. May be null on failure
-
-
Call example:
-
LoginSettings settings = new LoginSettings (); settings. setAutoFinish ( true ); //Set whether to automatically close the authorization page after login settings. setTimeout ( fifteen * one thousand ); //Set the timeout in milliseconds. Legal range (500030000], and the default setting outside the range is 10000 settings. setAuthPageEventListener ( new AuthPageEventListener () { @Override
public void onEvent ( int cmd, String msg ) { //do something...} }); //Set authorization page event listening JVerificationInterface. loginAuth ( this , settings, new VerifyListener () { @Override
public void onResult ( int code, String content, String operator ) { if (code == six thousand ){ Log . d ( TAG , "code=" + code + ", token=" + content+ ",operator=" +operator); } else { Log . d ( TAG , "code=" + code + ", message=" + content); } } });
Supported versions
Interface definition
-
JVerificationInterface.loginAuth(final Context context, boolean autoFinish, final VerifyListener listener, final AuthPageEventListener authPageEventListener) -
Interface description: -
Call up the one click login authorization page to obtain the loginToken after user authorization, and support the authorization page event listening
-
-
Parameter description: -
Context: Android context -
Boolean: Whether to automatically close the authorization page, true - Yes, false - No -
Listener: Login authorization result callback -
AuthPageEventListener: authorization page event callback
-
-
Callback description: -
VerifyListener
onResult(int code, String content, String operator) -
Code: return code. 6000 indicates that the loginToken was obtained successfully, and 6001 indicates that the loginToken was obtained failed. See the description for other return codes -
Content: The explanation information of the return code. If obtained successfully, the content information represents loginToken. -
Operator: when successful, it is the corresponding operator. CM represents China Mobile, CU represents China Unicom, and CT represents China Telecom. May be null on failure
-
-
AuthPageEventListener
onEvent(int code, String content) -
Cmd: return code, see the event return code table for details. -
Content: Content description.
-
-
-
Call example:
-
JVerificationInterface. loginAuth ( this , false , new VerifyListener () { @Override
public void onResult ( int code, String content, String operator ) { if (code == six thousand ){ 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
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Pull up SMS landing page
Supported versions
Interface definition
-
JVerificationInterface.smsLoginAuth(final Context context, boolean autoFinish , final int timeOut, final SmsListener listener) -
Interface description: -
Pull up the SMS login page, and customers can customize the page style. Some configuration styles are compatible with the one button login style, such as navigation bar, protocol bar, protocol display page, protocol secondary pop-up window and other styles.
-
-
Parameter description: -
Context: Android context -
AutoFinish: set whether to automatically close the authorization page after login -
TimeOut: timeout (ms). The valid value range is (500030000]. If it is less than or equal to 5000 or greater than 30000, the default value is 10000 The recommended setting is 5001-10000 -
Listener: interface callback
-
-
Callback description:
onResult(int code, String content) -
Code: return code, 4000 means success, others are failure, see error code description for details -
Content: Call result information description
-
-
Call example:
-
JVerificationInterface.smsLoginAuth( this , true , five thousand , 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 the authorization page
Supported versions
Interface definition
-
dismissLoginAuthActivity(boolean needCloseAnim, RequestCallback callback) -
Interface description: -
Close the login authorization page. If the current authorization is in progress, the loginAuth interface will immediately trigger 6002 to cancel the callback.
-
-
Parameter description: -
NeedCloseAnim: whether to show the animation of closing the default authorization page (if any). True - required, false - not required
-
-
Callback description:
RequestCallback
onResult(int code, String desc) -
Code: return code, 0 indicates that the authorization page was successfully closed -
Desc: Description of the return 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 versions
Interface definition
-
JVerificationInterface.dismissLoginAuthActivity() -
Interface description: -
Close the login authorization page. If the current authorization is in progress, the loginAuth interface will immediately trigger 6002 to cancel the callback.
-
-
Call example:
-
JVerificationInterface .dismissLoginAuthActivity ();
Customize the UI style of the authorization page
Supported versions
Interface definition
-
JVerificationInterface.setCustomUIWithConfig(JVerifyUIConfig uiConfig) -
Interface description: -
To modify the theme of the authorization page, developers can modify the theme of the authorization page through the setCustomUIWithConfig method loginAuth Called before the interface
-
-
Parameter description: -
UiConfig: Subject configuration object. The developer calls the corresponding method in the JVerifyUIConfig.java class to configure the corresponding element in the authorization page. For details, refer to JVerifyUIConfig Configuration Element Description 。
-
-
Call example:
-
JVerifyUIConfig uiConfig = new JVerifyUIConfig. Builder (). setAuthBGImgPath ( "main_bg" ) . setNavColor ( 0xff0086d0 ) . setNavText ( Login ) . setNavTextColor ( 0xffffffff ) . setNavReturnImgPath ( "umcsdk_return_bg" ) . setLogoWidth ( seventy ) . setLogoHeight ( seventy ) . setLogoHidden ( false ) . setNumberColor ( 0xff333333 ) . setLogBtnText ( "One click login with local number" ) . setLogBtnTextColor ( 0xffffffff ) . setLogBtnImgPath ( "umcsdk_login_btn_bg" ) . setPrivacyNameAndUrlBeanList ( List < PrivacyBean >) . setPrivacyNameAndUrlBeanList ( List < PrivacyBean >) . setUncheckedImgPath ( "umcsdk_uncheck_image" ) . setCheckedImgPath ( "umcsdk_check_image" ) . setSloganTextColor ( 0xff999999 ) . setLogoOffsetY ( fifty ) . setLogoImgPath ( "logo_cm" ) . setNumFieldOffsetY ( one hundred and seventy ) . setSloganOffsetY ( two hundred and thirty ) . setLogBtnOffsetY ( two hundred and fifty-four ) . setNumberSize ( eighteen ) . setPrivacyState ( false ) . setNavTransparent ( false ) . addCustomView (mBtn, true , new JVerifyUIClickCallback ( ) { @Override
public void onClicked ( Context context, View view ) { Toast . makeText (context, "Other buttons for dynamic registration" , Toast . LENGTH_SHORT ). show ();} }). addCustomView (mBtn2, false , new JVerifyUIClickCallback ( ) { @Override
public void onClicked ( Context context, View view ) { Toast . makeText (context, "Other buttons for dynamic registration 222" , Toast . LENGTH_SHORT ). show ();} }). addNavControlView (navBtn, new JVerifyUIClickCallback ( ) { @Override
public void onClicked ( Context context, View view ) { Toast . makeText (context, "Navigation bar button click" , Toast . LENGTH_SHORT ). show ();} }). setPrivacyOffsetY ( thirty ). build (); JVerificationInterface. setCustomUIWithConfig (uiConfig);
Authorization page add custom control
Supported versions
Interface definition
-
addCustomView(View view, boolean finishFlag,JVerifyUIClickCallback callback) -
Interface description: -
Add a custom control on the authorization page
-
-
Parameter description: -
View: The developer needs to set the layout properties of the user-defined control in advance when importing it. The SDK only supports the RelativeLayout layout -
FinishFlag: whether to click finish on the authorization page through the user-defined control -
Callback: click callback of user-defined control
-
-
Callback description: onClicked(Context context, View view) -
Context: Android context -
View: the object of the user-defined control
-
-
Call example:
-
Button mBtn = new Button ( this ); mBtn. setText ( "Login in other ways" ); RelativeLayout . LayoutParams mLayoutParams1 = new RelativeLayout . LayoutParams ( RelativeLayout . LayoutParams . WRAP_CONTENT , RelativeLayout . LayoutParams . WRAP_CONTENT ); mLayoutParams1. setMargins ( zero , Login UIHelper. dp2Pix ( this , four hundred and fifty 0f), zero , zero ); mBtn. setLayoutParams (mLayoutParams1); new JVerifyUIConfig. Builder (). addCustomView (mBtn, true , new JVerifyUIClickCallback ( ) { @Override
public void onClicked ( Context context, View view ) { Toast . makeText (context, "Other buttons for dynamic registration" , Toast . LENGTH_SHORT ). show ();} });
Authorize page navigation bar to add custom control
Supported versions
Interface definition
-
addNavControlView(View view, JVerifyUIClickCallback callback) -
Interface description: -
Add custom controls to the top navigation bar of the authorization page
-
-
Parameter description: -
View: The developer needs to set the layout properties of the user-defined control in advance when importing it. The SDK only supports the RelativeLayout layout -
Callback: click callback of user-defined control
-
-
Callback description: -
onClicked(Context context, View view) -
Context: Android context -
View: the object of the user-defined control
-
-
-
Call example:
-
Button navBtn = new Button ( this ); navBtn. setText ( Navigation Bar Buttons ); 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, "Navigation bar button click" , Toast . LENGTH_SHORT ). show ();} });
Set the authorization page of pop-up mode
Supported versions
Interface definition
-
setDialogTheme(int dialogWidth, int dialogHeight, int offsetX, int offsetY, boolean isBottom) -
Interface description: -
Set the authorization page to pop-up mode
-
-
Parameter description: -
DialogWidth: window width, in dp -
DialogHeight: window height, in dp -
OffsetX: the x-axis offset of the window relative to the screen center, in dp -
OffsetY: the y-axis offset of the window relative to the screen center, in dp -
IsBottom: Whether the window is at the bottom of the screen. OffsetY will become invalid after setting
-
-
Call example:
-
new JVerifyUIConfig. Builder (). setDialogTheme ( four hundred and ten , three hundred and ninety , zero , zero , false )
Window Mode Style Settings
<activity android:name= "cn.jiguang.verifysdk.CtLoginActivity" android:configChanges= "orientation|keyboardHidden|screenSize" android:theme= "@style/ActivityDialogStyle" <!-- Set custom style --> android:screenOrientation= "unspecified" android:launchMode= "singleTop" > </activity>
< style name = "ActivityDialogStyle" >
<!-- Hide action bar and title bar -->
< item name = "android:windowActionBar" > false </ item >
< item name = "android:windowNoTitle" > true </ item >
<!-- Transparent background -->
< item name = "android:windowIsTranslucent" > true </ item >
<!-- Dialog Rounded corner -->
< item name = "android:windowBackground" > @drawable/dialog_bg </ item >
</ style >
< shape xmlns:android = " http://schemas.android.com/apk/res/android " >
< corners android:radius = "5dp" />
</ shape >
Set the horizontal and vertical UI of the authorization page
Supported versions
Interface definition
-
setCustomUIWithConfig(JVerifyUIConfig uiConfigPortrait, JVerifyUIConfig uiConfigLandscape) -
Interface description: -
Modify the theme of the authorization page, and support two sets of configs: vertical screen and horizontal screen. The sdk will switch dynamically according to the current horizontal and vertical screen status. It is required to call loginAuth Interface.
-
-
Parameter description: -
UiConfigPortrait: Portrait config -
UiConfigLandscape: landscape config
-
-
Call example:
-
JVerifyUIConfig portrait = configBuilder.setAuthBGImgPath( "main_bg" ) .setNavColor( 0xff0086d0 ) .setNavText( Login ) .setNavTextColor( 0xffffffff ) .setNavReturnImgPath( "umcsdk_return_bg" ) .setLogoWidth( seventy ) .setLogoHeight( seventy ) .setLogoHidden( false ) .setNumberColor( 0xff333333 ) .setLogBtnText( "One click login with local number" ) .setLogBtnTextColor( 0xffffffff ) .setLogBtnImgPath( "umcsdk_login_btn_bg" ) .setPrivacyNameAndUrlBeanList(List<PrivacyBean>) .setAppPrivacyColor( 0xff666666 , 0xff0085d0 ) .setUncheckedImgPath( "umcsdk_uncheck_image" ) .setCheckedImgPath( "umcsdk_check_image" ) .setSloganTextColor( 0xff999999 ) .setLogoOffsetY( fifty ) .setLogoImgPath( "logo_cm" ) .setNumFieldOffsetY( one hundred and ninety ) .setSloganOffsetY( two hundred and twenty ) .setLogBtnOffsetY( two hundred and fifty-four ) .setNumberSize( eighteen ) .setPrivacyState( false ) .setNavTransparent( false ) .build(); JVerifyUIConfig landscape = configBuilder .setAuthBGImgPath( "main_bg" ) .setNavColor( 0xff0086d0 ) .setNavText( Login ) .setNavTextColor( 0xffffffff ) .setNavReturnImgPath( "umcsdk_return_bg" ) .setLogoWidth( seventy ) .setLogoHeight( seventy ) .setLogoHidden( false ) .setNumberColor( 0xff333333 ) .setLogBtnText( "One click login with local number" ) .setLogBtnTextColor( 0xffffffff ) .setLogBtnImgPath( "umcsdk_login_btn_bg" ) .setPrivacyNameAndUrlBeanList(List<PrivacyBean>) .setAppPrivacyColor( 0xff666666 , 0xff0085d0 ) .setUncheckedImgPath( "umcsdk_uncheck_image" ) .setCheckedImgPath( "umcsdk_check_image" ) .setSloganTextColor( 0xff999999 ) .setLogoOffsetY( thirty ) .setLogoImgPath( "logo_cm" ) .setNumFieldOffsetY( one hundred and fifty ) .setSloganOffsetY( one hundred and eighty-five ) .setLogBtnOffsetY( two hundred and ten ) .setPrivacyOffsetY( thirty ) .build(); JVerificationInterface.setCustomUIWithConfig(portrait, landscape);
-
It needs to be configured in the authorization page Activity: LoginAuthActivity and CtLoginActivity corresponding to the manifest android:configChanges="orientation|keyboardHidden|screenSize" attribute -
For applications with targetSDKVersion>26, if the authorization page direction is specified on the 8.0 system, such as "android: screenOrientation=" portlet ", an error Only fullscreen opaque activities can request orientation will be reported -
resolvent: -
Set the authorization page "android: screenOrientation" to a value other than "portlet" and "landscape". -
The targetSDKVersion is changed to<=26.
-
-
JVerifyUIConfig One Key Login - Configuration Element Description
-
Set Authorization Page Background -
Supported version: 2.1.1 -
Note: The picture will stretch and spread all over the screen by default to fit different sizes of mobile phones. It is recommended to use the. 9.png picture to solve the problem.
-
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
![](assets/renzheng-ui.jpg)
|
|
|
|
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Authorization page privacy agreement web page
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
User defined loading view
|
|
|
---|---|---|
|
|
|
-
Authorization page animation
|
|
|
---|---|---|
|
|
|
|
|
|
-
Developer defined control
|
|
|
---|---|---|
|
|
|
|
|
|
-
Secondary protocol pop-up configuration
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
SMS login page
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JVerifyUIConfig SMS Login Page - Configuration Element Description
-
Set Landing Page Background -
Supported version: 2.1.1 -
Note: The picture will stretch and spread all over the screen by default to fit different sizes of mobile phones. It is recommended to use the. 9.png picture to solve the adaptation problem.
-
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
![](assets/yanzhengma-ui.png)
-
status bar
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Landing Page Navigation Bar
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Login page logo
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Login page slogan
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Login page number input field
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Login page verification code input field
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Login page get verification code button
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Login Page Login Button
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Login Page Privacy Bar
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
Login page Privacy agreement web page
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
User defined loading view
|
|
|
---|---|---|
|
|
|
-
Landing page animation
|
|
|
---|---|---|
|
|
|
|
|
|
-
Developer defined control
|
|
|
---|---|---|
|
|
|
|
|
|
-
Secondary protocol pop-up configuration
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Pull up the authorization page (old)
Supported versions
Definition of interface
-
JVerificationInterface.loginAuth(final Context context, boolean autoFinish, final VerifyListener listener) -
Interface description: -
Call up the one click login authorization page, and obtain loginToken after user authorization
-
-
Parameter description: -
Context: Android context -
Boolean: Whether to automatically close the authorization page, true - Yes, false - No; If this field is set to false, please call the closing authorization page method provided by the SDK after receiving the one click login callback. -
Listener: interface callback
-
-
Callback description:
onResult(int code, String content, String operator) -
Code: return code. 6000 indicates that the loginToken was obtained successfully, and 6001 indicates that the loginToken was obtained failed. See the description for other return codes -
Content: The explanation information of the return code. If obtained successfully, the content information represents loginToken. -
Operator: when successful, it is the corresponding operator. CM represents China Mobile, CU represents China Unicom, and CT represents China Telecom. May be null on failure
-
-
Call example:
-
JVerificationInterface. loginAuth ( this , false , new VerifyListener () { @Override
public void onResult ( int code, String content, String operator ) { if (code == six thousand ){ Log . d ( TAG , "code=" + code + ", token=" + content+ " ,operator=" +operator); } else { Log . d ( TAG , "code=" + code + ", message=" + content); } } });
Pull up the authorization page (old)
Supported versions
Definition of interface
-
JVerificationInterface.loginAuth(final Context context, final VerifyListener listener) -
Interface description: -
Call up the one click login authorization page, and obtain loginToken after user authorization
-
-
Parameter description: -
Context: Android context -
Listener: interface callback
-
-
Callback description:
onResult(int code, String content, String operator) -
Code: return code. 6000 indicates that the loginToken was obtained successfully, and 6001 indicates that the loginToken was obtained failed. See the description for other return codes -
Content: The explanation information of the return code. If obtained successfully, the content information represents loginToken. -
Operator: when successful, it is the corresponding operator. CM represents China Mobile, CU represents China Unicom, and CT represents China Telecom. May be null on failure -
Call example:
-
-
JVerificationInterface. loginAuth ( this , new VerifyListener () { @Override
public void onResult ( int code, String content, String operator ) { if (code == six thousand ){ Log . d ( TAG , "code=" + code + ", token=" + content+ " ,operator=" +operator); } else { Log . d ( TAG , "code=" + code + ", message=" + content); } } });
Number authentication
initialization
Determine whether the network environment supports
Obtain the number authentication token (new)
Supported versions
Interface definition
-
JVerificationInterface.getToken(Context context, int timeOut, VerifyListener listener) -
Interface description: -
Get the operator and token of the currently online sim card within the preset time. If the set time is exceeded, the interface callback returns timeout. If the acquisition is successful, it can be used to verify the mobile phone number. If the acquisition fails, it is recommended to do SMS verification.
-
-
Parameter description: -
Context: Android context -
TimeOut: timeout (ms). The valid value range is (500030000]. If it is less than or equal to 5000 or greater than 30000, the default value is 10000 The recommended setting is 5001-10000 -
Listener: interface callback
-
-
Callback description:
onResult(int code, String content, String operator, JSONObject operatorReturn) -
Code: return code, 2000 means success, others are failure, see error code description for details -
Content: If successful, it is token, which can be used to call the mobile phone number verification interface. The validity period of the token is 1 minute. It needs to be retrieved before it can be used. Failure information in case of failure -
Operator: when successful, it is the corresponding operator. CM represents China Mobile, CU represents China Unicom, and CT represents China Telecom. May be null on failure -
OperatorReturn: operator result information
-
-
Call example:
-
JVerificationInterface. getToken ( this , five thousand , new VerifyListner { @Override
public void onResult ( int code, String content, String operator ) { if (code == two thousand ){ Log . d ( TAG , "token=" + content + ", operator=" + operator); } else { Log . d ( TAG , "code=" + code + ", message=" + content); } });
Obtain the number authentication token (old)
Supported versions
Interface definition
-
JVerificationInterface.getToken(Context context, VerifyListener listener) -
Interface description: -
Get the operator and token of the sim card currently online. If the acquisition is successful, it can be used to verify the mobile phone number. If the acquisition fails, it is recommended to do SMS verification. The default timeout duration is 5000ms. This interface is obsolete. It is recommended to use a new interface.
-
-
Parameter description: -
Context: Android context -
Listener: interface callback
-
-
Callback description:
onResult(int code, String content, String operator) -
Code: return code, 2000 means success, others are failure, see error code description for details -
Content: If successful, it is token, which can be used to call the mobile phone number verification interface. The valid period of the token is 1 minute. It needs to be retrieved before it can be used. Failure information in case of failure -
Operator: when successful, it is the corresponding operator. CM represents China Mobile, CU represents China Unicom, and CT represents China Telecom. May be null on failure
-
-
Call example:
-
JVerificationInterface. getToken ( this , new VerifyListner { @Override
public void onResult ( int code, String content, String operator ) { if (code == two thousand ){ Log . d ( TAG , "token=" + content + ", operator=" + operator); } else { Log . d ( TAG , "code=" + code + ", message=" + content); } });
SDK initiator number authentication
Supported versions
Interface definition
-
JVerificationInterface.verifyNumber(Context context, String token, String phone, VerifyListener listener) -
Interface description: -
Verify whether the phone number is the phone number of the currently online sim card
-
-
Parameter description: -
Context: Android context -
Token: optional; the token returned by the getToken interface. If it is empty, the getToken method will be automatically called to verify the phone number -
Phone: required, the phone number to be verified. If empty, 4001 parameter error will be reported -
Listener: interface callback
-
-
Callback description:
onResult(int code, String content, String operator) -
Code: the return code. 1000 indicates that the verification is consistent, 1001 indicates that the verification is inconsistent, and others indicate failure. See the error code description for details -
Content: Explanation information of return code -
Operator: when successful, it is the corresponding operator. CM represents China Mobile, CU represents China Unicom, and CT represents China Telecom. May be null on failure
-
-
Call example:
-
JVerificationInterface. verifyNumber ( this , null , "13512341234" , new VerifyListner { @Override
public void onResult ( int code, String content, String operator ) { if (code == one thousand ){ Log . d ( TAG , "verify consistent, operator=" + operator); } else if (code == one thousand and one ) { Log . d ( TAG , "verify not consistent" ); } else { Log . d ( TAG , "code=" + code + ", message=" + content); } });
Verification Code
SDK Get Verification Code
Supported versions
Interface definition
-
JVerificationInterface.getSmsCode(Context context, String phonenum, String signid, String tempid, RequestCallback listener) -
Interface description: -
To obtain the SMS verification code, you need to add the application SMS signature and verification code SMS template in the Aurora SMS module of the Portal console. See: Operation Guide -
After the SMS verification code is obtained through this interface, you need to call the Aurora verification code API for verification. See details: Verification code verification API
-
-
Parameter description: -
Context: Android context -
Phonenum: phone number -
Signid: SMS signature ID. If null, it is the default SMS signature ID -
Tempid: SMS template id -
Listener: callback interface
-
-
Callback description: -
onResult(int code, String msg) -
Code: return code. 3000 means that the verification code is obtained successfully. msg is the unique identification code (uuid) obtained this time. Others are failures. See the error code description for details -
Msg: Result description
-
-
-
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 == three thousand ) {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 time interval between acquiring the verification code before and after
Supported versions
Interface definition
-
JVerificationInterface.setSmsIntervalTime(long intervalTime) -
Interface description: -
Set the time interval for acquiring the verification code twice. The default is 10000ms, and the effective range is 50003000000
-
-
Parameter description: -
IntervalTime: time interval, in milliseconds (ms).
-
-
Call example:
-
JVerificationInterface .setSmsIntervalTime ( sixty thousand ); //Set the interval time to 60 seconds
Extended business related settings
Optional personal information settings
Supported versions
Interface definition
JVerificationInterface.setCollectControl(Context context, JVerifyCollectControl control) Interface description -
Data collection configuration. In order to ensure the good effect of using aurora security certification, we strongly recommend that you collect all data.
-
Parameter Description -
Context: Android context -
Control: Data collection item configuration class. If the corresponding parameter is set to false, data collection will not be performed. The default value is true, and the corresponding data item is collected.
-
Call example
JVerificationInterface.setAuth( this , false ); JVerifyCollectControl.Builder ss= new JVerifyCollectControl .Builder(); ss.cell( true ); .... JVerifyCollectControl build = ss.build(); JVerificationInterface.setCollectControl( this , build);
JVerifyCollectControl control class
IMEI acquisition switch
public Build imei ( boolean enable)
MAC acquisition switch
public Build mac ( boolean enable)
Cell acquisition switch
public Build cell ( boolean enable)
IMSI acquisition switch
public Build imsi ( boolean enable)
Extended business related settings
Risk control configuration
Supported versions
Interface definition
JVerificationInterface.setSecureControl(Context context,boolean enable) Interface description -
This interface can be called if there is a risk control demand of the ICT Institute
-
Parameter Description -
Context: Android context -
Control: If there are special requirements for risk control, you can call this interface and set the parameter to false
-
Call example
JVerificationInterface.setCollectControl( this , false );
Extended business function settings
Supported versions
Application self start
JCollectionAuth.enableAutoWakeup(Context context, boolean isAutoWakeupEnable);
Parameter definition
context -
Application Context
-
isAutoWakeupEnable -
Apply the self start switch. The default value is true, and false means off
-
Set network monitoring optimization function
Supported versions
Interface definition
JVerificationInterface.enableNetworkMonitoringOptimizer(boolean enable) Interface description -
It is enabled by default. Android. net is used during SDK initialization The ConnectivityManager listens to network changes. The user can call this interface to prevent the SDK from listening to the network during initialization -
If you need to use this interface, please call it before SDK initialization
-
Parameter Description -
Enable: Turn on or off
-
Call example
JVerificationInterface.enableNetworkMonitoringOptimizer( false );