Latest update: 2024-06-07
expand all

SDK Interface Description

  • JVerificationInterface, Include all interfaces of the SDK

Set Debug Mode

Supported versions

Start supporting version 1.0.0

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);
           JVerificationInterface.setDebugMode( true );
        
This code block is displayed in the floating window

SDK Initialization

Support timeout configuration and callback parameters

Supported versions

Version 2.5.0 supported at the beginning

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, 5000, new RequestCallback<String>() { @Override public void onResult(int code, String msg) {Log.d("tag","code =" + code + "msg =" + msg); } });
           JVerificationInterface. init ( this , five thousand , new  RequestCallback < String >() { @Override
                 public  void  onResult ( int code, String msg ) { Log . d ( "tag" , "code =" + code + "msg =" + msg); } });
        
This code block is displayed in the floating window

Support callback parameters

Supported versions

Version 2.3.6 supported at the beginning

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); } });
           JVerificationInterface. init ( this , new  RequestCallback < String >() { @Override
                 public  void  onResult ( int code, String msg ) { Log . d ( "tag" , "code =" + code + "msg =" + msg); } });
        
This code block is displayed in the floating window

Get the ID of whether initialization is successful

Supported versions

Version 2.3.2 supported at the beginning

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();
               boolean  isSuccess  = JVerificationInterface.isInitSuccess();
        
This code block is displayed in the floating window

Determine whether the network environment supports one click login

Supported versions

Start supporting version 1.1.3

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; }
           boolean verifyEnable = JVerificationInterface.checkVerifyEnable( this ); if (!verifyEnable){Log.d(TAG, "The current network environment does not support authentication" ); return ; }
        
This code block is displayed in the floating window

Determine whether the network environment supports SMS verification

Supported versions

Start supporting version 1.1.3

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; }
           boolean verifyEnable = JVerificationInterface.checkSmsEnable( this ); if (!verifyEnable){Log.d(TAG, "SMS is not supported in the current network environment" ); return ; }
        
This code block is displayed in the floating window

Judge whether the prefetch number is valid

Supported versions

Start supporting version 3.1.7

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);
               boolean  enable  = JVerificationInterface.isValidePreloginCache( this );
        
This code block is displayed in the floating window

Whether to obtain geographical location information

Supported versions

Version 2.9.6 supported at the beginning

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);
           JVerificationInterface.setLocationEanable( this , true );
        
This code block is displayed in the floating window

One click login

initialization

Before calling other SDK process methods, please ensure that initialization has been called, otherwise it will return uninitialized. For details, refer to SDK Initialization API After initialization, if you call the following function interface, it will be deemed that you agree to open the business functions related to Evoque security certification, and we will collect the necessary personal information of the business functions and report it.

Determine whether the network environment supports

Determine whether the current mobile phone network environment can use one button login. If the network supports it, call the one button login API again. Otherwise, call the API of other login methods. For details, refer to Determine whether the network environment supports API

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

Start supporting version 2.2.0

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, 5000,new PreLoginListener() { @Override public void onResult(final int code, final String content) {Log.d(TAG,"[" + code + "]message=" + content );} });
           JVerificationInterface.preLogin( this , five thousand , new  PreLoginListener () { @Override
             public  void  onResult ( final  int code, final String content) {Log.d(TAG, "[" + code + "]message=" +  content );} });
        
This code block is displayed in the floating window

Supported versions

Start supporting version 3.1.0

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, 5000,new PreLoginListener() { @Override public void onResult(final int code, final String content,String a1,String a2) {Log.d(TAG,"[" + code + "]message=" + content );} });
           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 );} });
        
This code block is displayed in the floating window

Clear prefetch number cache

Supported versions

Version 2.4.3 supported at the beginning

Interface definition

  • JVerificationInterface.clearPreLoginCache()
    • Interface description:
      • Clear the current prefetch number result cache of the sdk.
    • Call example:
JVerificationInterface.clearPreLoginCache();
           JVerificationInterface .clearPreLoginCache ();
        
This code block is displayed in the floating window

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

Start supporting version 3.1.7

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(15 * 1000);// 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 == 6000){Log.d(TAG, "code=" + code + ", token=" + content+",operator="+operator); }else{Log.d(TAG, "code=" + code + ", message=" + content); } } });
               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); } } });
        
This code block is displayed in the floating window

Supported versions

Version 2.5.2 supported at the beginning

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(15 * 1000);// 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 == 6000){Log.d(TAG, "code=" + code + ", token=" + content+",operator="+operator); }else{Log.d(TAG, "code=" + code + ", message=" + content); } } });
               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); } } });
        
This code block is displayed in the floating window

Supported versions

Start supporting version 2.4.0

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 == 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);} });
           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);} });
        
This code block is displayed in the floating window

Event return code

code message remarks
one login activity closed. Authorization page closing event
two login activity started. Authorization page open event
three carrier privacy clicked. Carrier agreement click event
three privacy 1 clicked. Custom Protocol 1 Click Event
three privacy 2 clicked. Custom Protocol 2 Click Event
six checkbox checked. The checkbox in the protocol bar becomes the selected event
seven checkbox unchecked. The checkbox in the protocol bar becomes unselected
eight login button clicked. One click login button (available) click event

explain : After obtaining the loginToken for one click login, return it to the application server and call it from the server REST API To get your mobile number

Pull up SMS landing page

Supported versions

Start supporting version 3.1.0

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, 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(); } }); } });
           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(); } }); } });
        
This code block is displayed in the floating window

Close the authorization page

Supported versions

Version 2.5.2 supported at the beginning

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);} });
           JVerificationInterface. dismissLoginAuthActivity ( true , new  RequestCallback < String >() { @Override
         public  void  onResult ( int code, String desc ) { Log . i ( TAG , "[dismissLoginAuthActivity] code =" + code + "desc =" + desc);} });
        
This code block is displayed in the floating window

Supported versions

Start supporting version 2.3.0

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();
           JVerificationInterface .dismissLoginAuthActivity ();
        
This code block is displayed in the floating window

Customize the UI style of the authorization page

Supported versions

Start supporting version 2.1.0

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(70) .setLogoHeight(70) .setLogoHidden(false) .setNumberColor(0xff333333) . setLogBtnText ("local number one click login") .setLogBtnTextColor(0xffffffff) .setLogBtnImgPath("umcsdk_login_btn_bg") .setPrivacyNameAndUrlBeanList(List<PrivacyBean>) .setPrivacyNameAndUrlBeanList(List<PrivacyBean>) .setUncheckedImgPath("umcsdk_uncheck_image") .setCheckedImgPath("umcsdk_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, "Other dynamically registered buttons", Toast. LENGTH_SHORT). show();} }).addCustomView(mBtn2, false, new JVerifyUIClickCallback() { @Override Public void onClicked (Context context, View view) {Toast.makeText (context, "other dynamically registered buttons 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(30).build(); JVerificationInterface.setCustomUIWithConfig(uiConfig);
           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);
        
This code block is displayed in the floating window

Authorization page add custom control

Supported versions

Start supporting version 2.1.0

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(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, "Other dynamically registered buttons", Toast. LENGTH_SHORT). show();} });
                   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 ();} });
        
This code block is displayed in the floating window

Authorize page navigation bar to add custom control

Supported versions

Version 2.3.2 supported at the beginning

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 Button"); 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();} });
                   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 ();} });
        
This code block is displayed in the floating window

Set the authorization page of pop-up mode

Supported versions

Version 2.3.8 supported at the beginning

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(410, 390, 0, 0, false)
               new JVerifyUIConfig. Builder (). setDialogTheme ( four hundred and ten , three hundred and ninety , zero , zero , false )
        
This code block is displayed in the floating window

Window Mode Style Settings

Set window style for authorization page activity in manifest

AndroidManifest.xml

<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>
           <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>
        
This code block is displayed in the floating window

Add specific pop-up window style in style

res/values/styles.xml

<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>
           < 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 >

        
This code block is displayed in the floating window

Define window fillet attributes

res/drawable/dialog_bg.xml

<shape xmlns:android=" http://schemas.android.com/apk/res/android "> <corners android:radius="5dp"/> </shape>
           < shape  xmlns:android = " http://schemas.android.com/apk/res/android " >
     < corners  android:radius = "5dp" />
 </ shape >

        
This code block is displayed in the floating window

Set the horizontal and vertical UI of the authorization page

Supported versions

Start supporting version 2.4.8

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(70) .setLogoHeight(70) .setLogoHidden(false) .setNumberColor(0xff333333) . setLogBtnText ("local number one click login") .setLogBtnTextColor(0xffffffff) .setLogBtnImgPath("umcsdk_login_btn_bg") .setPrivacyNameAndUrlBeanList(List<PrivacyBean>) .setAppPrivacyColor(0xff666666, 0xff0085d0) .setUncheckedImgPath("umcsdk_uncheck_image") .setCheckedImgPath("umcsdk_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 ("Login") .setNavTextColor(0xffffffff) .setNavReturnImgPath("umcsdk_return_bg") .setLogoWidth(70) .setLogoHeight(70) .setLogoHidden(false) .setNumberColor(0xff333333) . setLogBtnText ("local number one click login") .setLogBtnTextColor(0xffffffff) .setLogBtnImgPath("umcsdk_login_btn_bg") .setPrivacyNameAndUrlBeanList(List<PrivacyBean>) .setAppPrivacyColor(0xff666666, 0xff0085d0) .setUncheckedImgPath("umcsdk_uncheck_image") .setCheckedImgPath("umcsdk_check_image") .setSloganTextColor(0xff999999) .setLogoOffsetY(30) .setLogoImgPath("logo_cm") .setNumFieldOffsetY(150) .setSloganOffsetY(185) .setLogBtnOffsetY(210) .setPrivacyOffsetY(30) .build(); JVerificationInterface.setCustomUIWithConfig(portrait, landscape);
          
     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);
        
This code block is displayed in the floating window
  • 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

If no offset is set for x-axis, all components will be horizontally centered by default

  • 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.
method Parameter type explain
setAuthBGImgPath String Set background picture
setAuthBGGifPath String To set the local gif background image, place it in the drawable file and pass in the image name
setAuthBGVideoPath String,String Set the background video file.
1. Support local paths such as "android. resource://"+context. getPackageName()+"/"+R.raw.testvideo
2. Support network path, resource address starting with https (it is recommended to use the local path after downloading to the local, network path will have network problems such as stuck), set the default first frequency image (it needs to be placed in the drawable file, and the image name can be passed in, if the video file path is local, you can fill in null)
region method Parameter type explain
① Status bar setStatusBarColorWithNav boolean Set the status bar to be the same color as the navigation bar. It only takes effect on devices above Android 5.0. since 2.4.1
setStatusBarDarkMode boolean Set the status bar dark mode. Only valid for devices above Android 6.0. since 2.4.8
setStatusBarTransparent boolean Set whether the status bar is transparent. Only valid for devices above Android 4.4. since 2.4.8
setStatusBarHidden boolean Sets whether the status bar is hidden. since 2.4.8
setVirtualButtonTransparent boolean Set whether the background of the virtual key bar is transparent. since 2.5.2
② Navigation Bar setNavColor int Set navigation bar color
setNavText String Set navigation bar title text
setNavTextColor int Set navigation bar title text color
setNavReturnImgPath String Set navigation bar return button icon
setNavTransparent boolean Set whether the background of the navigation bar is transparent. The default is opaque. since 2.3.2
setNavTextSize int Set the font size of navigation bar title text (unit: sp). since 2.4.1
setNavReturnBtnHidden boolean Set whether the navigation bar return button is hidden. It is not hidden by default. since 2.4.1
setNavReturnBtnWidth int Set the width of the navigation bar return button. since 2.4.8
setNavReturnBtnHeight int Set the height of the navigation bar return button. since 2.4.8
setNavReturnBtnOffsetX int Set the offset of the navigation bar return button from the left side of the screen. since 2.4.8
setNavReturnBtnRightOffsetX int Set the offset of the navigation bar return button from the right side of the screen. since 2.4.8
setNavReturnBtnOffsetY int Set the upper offset of the navigation bar return button. since 2.4.8
setNavHidden boolean Set whether the navigation bar is hidden. since 2.4.8
setNavTextBold boolean Sets whether the navigation bar title font is bold. since 2.5.4
③logo setLogoWidth int Set logo width (unit: dp)
setLogoHeight int Set logo height (unit: dp)
setLogoHidden boolean Hide logo
setLogoOffsetY int Set the y offset of logo relative to the lower edge of the title bar
setLogoImgPath String Set logo image
setLogoOffsetX int Set the logo offset relative to the left x axis of the screen. since 2.3.8
setLogoOffsetBottomY int Set the logo offset relative to the y-axis at the bottom of the screen. since 2.4.8
④ Number bar setNumberColor int Set font color of mobile phone number
setNumberSize Number Set the phone number font size (unit: sp). since 2.3.2
setNumFieldOffsetY int Set the number bar y offset from the lower edge of the title bar
setNumFieldOffsetX int Set the number bar offset relative to the left x axis of the screen. since 2.3.8
setNumberFieldOffsetBottomY int Set the number bar offset relative to the y-axis at the bottom of the screen. since 2.4.8
setNumberFieldWidth int Set the width of the number bar. since 2.4.8
setNumberFieldHeight int Set the number bar height. since 2.4.8
setNumberTextBold boolean Set whether the phone number font is bold. since 2.5.4
⑤slogan setSloganTextColor int Set mobile slogan text color
setSloganOffsetY int Set the y offset of slogan relative to the lower edge of the title block
setSloganOffsetX int Set the slogan offset relative to the left x axis of the screen. since 2.3.8
setSloganBottomOffsetY int Set the y-axis offset of the slogan relative to the bottom edge of the screen. To make this attribute effective, you need to set the value of setSloganOffsetY=- 1. since 2.3.8
setSloganTextSize int Set the slogan font size. since 2.4.8
setSloganTextBold boolean Set whether the slogan font is bold. since 2.5.4
⑥ Login button setLogBtnText String Set login button text
setLogBtnTextColor int Set login button text color
setLogBtnImgPath String Set the image of the authorized login button
setLogBtnOffsetY int Set the y offset of the login button relative to the lower edge of the title bar
setLogBtnOffsetX int Set the login button offset relative to the left x axis of the screen. since 2.3.8
setLogBtnWidth int Set the width of the login button. since 2.3.8
setLogBtnHeight int Set the height of the login button. since 2.3.8
setLogBtnTextSize int Set the font size of the login button. since 2.3.8
setLogBtnBottomOffsetY int Set the y-axis offset of the login button relative to the bottom of the screen. since 2.4.8
setLogBtnTextBold boolean Set whether the login button font is bold. since 2.5.4
⑦ Privacy Bar setAppPrivacyOne String,String Custom privacy clause 1:
  • Parameter 1 (set the name of developer privacy clause)
  • Parameter 2 (Developer Privacy Terms URL)
    Only since 2.3.8-2.7.2 is valid; 2.7.3 and later version settings are invalid
  • setAppPrivacyTwo String,String Custom privacy clause 2:
  • Parameter 1 (set the name of developer privacy clause)
  • Parameter 2 (Developer Privacy Terms URL)
    Only since 2.3.8-2.7.2 is valid; 2.7.3 and later version settings are invalid
  • setAppPrivacyColor int,int Set privacy clause name color:
  • Parameter 1 (basic text color)
  • Parameter 2 (protocol text color)
  • setPrivacyMarginL int Set the spacing of the agreement relative to the left side of the authorization page. since 2.9.6
    setPrivacyMarginR int Set the spacing of the agreement relative to the right side of the authorization page. since 2.9.6
    setPrivacyMarginT int Sets the spacing of the agreement relative to the top of the authorization page. since 2.9.6
    setPrivacyMarginB int Set the spacing of the agreement relative to the bottom of the authorization page. since 2.9.6
    setCheckedImgPath String Set picture when check box is selected
    setUncheckedImgPath String Set picture when check box is not selected
    setPrivacyState boolean Set the privacy terms to be selected by default, and not selected by default. since 2.3.2
    setPrivacyOffsetY int Set the privacy clause to offset y from the bottom edge of the authorization page, and it will be abandoned.
    setPrivacyOffsetX int Set the spacing between the privacy terms (or when the checkbox is displayed) and the two sides of the screen. since 2.7.2, It will be abandoned soon.
    setPrivacyTextCenterGravity boolean Set whether the privacy clause text is centered (left aligned by default). since 2.3.8
    setPrivacyText String,String Set the text outside the name of the privacy clause. For example, when you log in, you agree to And log in with your own number;
  • Parameter 1 ("Agree upon login")
  • Parameter 2 ("Log in with your own number")
    since 2.7.3
  • setPrivacyTextSize int Set the font size of privacy terms (unit: sp). since 2.4.1
    setPrivacyTopOffsetY int Set the privacy clause offset relative to the y-axis at the lower end of the navigation bar. since 2.4.8
    setPrivacyCheckboxHidden boolean Set whether the privacy clause checkbox is hidden. since 2.4.8
    setPrivacyCheckboxSize int Set the size of the privacy clause checkbox. since 2.4.8
    setPrivacyWithBookTitleMark boolean Set whether to add a book name to the name of the operator agreement in the privacy terms. since 2.4.8
    setPrivacyCheckboxInCenter boolean Set whether the privacy clause checkbox is vertically centered relative to the agreement text. Top by default. since 2.4.8
    enableHintToast boolean Toast When the checkbox in the agreement bar is not selected, click the login button to pop up a toast to prompt the user to check the agreement, which is not displayed by default. Custom Toast is supported. since 2.5.0
    enablePrivacyCheckDialog boolean Support to open pop-up window when privacy is not checked; When enablePrivacyCheckDialog is set to true, enableHintToast must also be set to true. since 2.9.0
    setPrivacyTextBold boolean Set whether the privacy clause text font is bold. since 2.5.4
    setPrivacyUnderlineText boolean Set whether the font of privacy terms is underlined. since 2.5.4
    setVirtualButtonColor int Set the background of the virtual navigation bar at the bottom of the authorization interface. since 2.7.3
    setPrivacyNameAndUrlBeanList(List) String,String,String PrivacyBean parameter transfer:
  • Parameter 1 (set the name of developer privacy clause)
  • Parameter 2 (Developer Privacy Terms URL)
  • Parameter 3 (connection symbol)
    since 2.7.4
    • Authorization page privacy agreement web page
    method Parameter type explain
    setIsPrivacyViewDarkMode boolean Set the protocol to show whether the web page is suitable for dark mode. since 2.9.6
    True: Follow the system.
    False: Dark mode is not supported
    setPrivacyNavColor int Set the background color of protocol display web page navigation bar. since 2.4.8
    setPrivacyNavTitleTextColor int Set the text color of the navigation bar title of the protocol display web page. since 2.4.8
    setPrivacyNavTitleTextSize int Set the text size (sp) of the navigation bar title of the protocol display web page. since 2.4.8
    setPrivacyNavReturnBtn View Set the return button icon in the navigation bar of the protocol display web page. since 2.4.8
    setAppPrivacyNavTitle1 String Set the text content of the navigation bar of the web page corresponding to custom protocol 1. since 2.5.2
    setAppPrivacyNavTitle2 String Set the text content of the navigation bar of the web page corresponding to the user-defined protocol 2. since 2.5.2
    setPrivacyStatusBarColorWithNav boolean Set the status bar of the authorization agreement web page to be the same color as the navigation bar. It only takes effect on devices above Android 5.0. since 2.5.2
    setPrivacyStatusBarDarkMode boolean Set the dark mode of the status bar of the authorization agreement web page. Only valid for devices above Android 6.0. since 2.5.2
    setPrivacyStatusBarTransparent boolean Set whether the status bar of the authorization agreement web page is transparent. Only valid for devices above Android 4.4. since 2.5.2
    setPrivacyStatusBarHidden boolean Set whether the status bar of the authorization agreement web page is hidden. since 2.5.2
    setPrivacyVirtualButtonTransparent boolean Set whether the virtual key bar background of the authorization protocol web page is transparent. since 2.5.2
    setVirtualButtonHidden boolean Support to hide the bottom virtual key. since 2.9.0
    setPrivacyNavTitleTextBold boolean Set whether the protocol display web page navigation bar font is bold. since 2.5.4
    setPrivacyVirtualButtonColor int Set the background of the virtual navigation bar at the bottom of the privacy interface since 2.7.3
    • User defined loading view
    method Parameter type explain
    setLoadingView View,Animation Set the loading view and animation effect displayed in the login process. since 2.4.8
    • Authorization page animation
    method Parameter type explain
    setNeedStartAnim boolean Set whether to display the default animation when pulling up the authorization page. Default presentation. since 2.5.2
    setNeedCloseAnim boolean Set whether to display the default animation when closing the authorization page. Default presentation. since 2.5.2
    • Developer defined control
    method Parameter type explain
    addCustomView See above method definition Add a custom control and click Monitor in the blank of the authorization page
    addNavControlView See above method definition Add custom controls in the navigation bar at the top of the authorization page and click Listen
    • Secondary protocol pop-up configuration
    method Parameter type explain
    setPrivacyCheckDialogTitleTextSize int Protocol secondary pop-up font size
    setPrivacyCheckDialogTitleTextColor int Protocol secondary pop-up font color
    setPrivacyCheckDialogContentTextGravity int The second pop-up window of the agreement The content of the agreement
    setPrivacyCheckDialogContentTextSize int Protocol Secondary Pop up Protocol Content Font Size
    setPrivacyCheckDialogContentTextPaddingL int Agreement pop-up window Agreement content left margin
    setPrivacyCheckDialogContentTextPaddingT int Agreement Secondary Pop up Agreement Content Top Margin
    setPrivacyCheckDialogContentTextPaddingR int Agreement pop-up window Right margin of agreement content
    setPrivacyCheckDialogContentTextPaddingB int Agreement secondary pop-up agreement content lower margin
    setPrivacyCheckDialogLogBtnImgPath String Background image of protocol secondary pop-up login button
    setPrivacyCheckDialoglogBtnTextColor int Font color of protocol secondary pop-up login button
    setPrivacyCheckDialogWidth int The width of the agreement secondary pop-up window itself
    setPrivacyCheckDialogHeight int The height of the agreement secondary pop-up window itself
    setprivacyCheckDialogGravity int Protocol secondary pop-up alignment
    setPrivacyCheckDialogOffsetX int The offset of the protocol secondary pop-up window itself to the parent class
    setPrivacyCheckDialogOffsetY int The offset of the protocol secondary pop-up window itself to the parent class
    setPrivacyCheckDialogLogBtnWidth int The width of the protocol secondary pop-up login button
    setPrivacyCheckDialogLogBtnHeight int The height of the protocol secondary pop-up login button
    • SMS login page
    method Parameter type explain
    setPrivacyCheckDialogTitleTextSize int Protocol secondary pop-up font size
    setPrivacyCheckDialogTitleTextColor int Protocol secondary pop-up font color
    setPrivacyCheckDialogContentTextGravity int The second pop-up window of the agreement The content of the agreement
    setPrivacyCheckDialogContentTextSize int Protocol Secondary Pop up Protocol Content Font Size
    setPrivacyCheckDialogContentTextPaddingL int Agreement pop-up window Agreement content left margin
    setPrivacyCheckDialogContentTextPaddingT int Agreement Secondary Pop up Agreement Content Top Margin
    setPrivacyCheckDialogContentTextPaddingR int Agreement pop-up window Right margin of agreement content
    setPrivacyCheckDialogContentTextPaddingB int Agreement secondary pop-up agreement content lower margin
    setPrivacyCheckDialogLogBtnImgPath String Background image of protocol secondary pop-up login button
    setPrivacyCheckDialoglogBtnTextColor int Font color of protocol secondary pop-up login button
    setPrivacyCheckDialogWidth int The width of the agreement secondary pop-up window itself
    setPrivacyCheckDialogHeight int The height of the agreement secondary pop-up window itself
    setprivacyCheckDialogGravity int Protocol secondary pop-up alignment
    setPrivacyCheckDialogOffsetX int The offset of the protocol secondary pop-up window itself to the parent class
    setPrivacyCheckDialogOffsetY int The offset of the protocol secondary pop-up window itself to the parent class
    setPrivacyCheckDialogLogBtnWidth int The width of the protocol secondary pop-up login button
    setPrivacyCheckDialogLogBtnHeight int The height of the protocol secondary pop-up login button

    JVerifyUIConfig SMS Login Page - Configuration Element Description

    If no offset is set for x-axis, all components will be horizontally centered by default

    • 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.
    method Parameter type explain
    setAuthBGImgPath String Set background picture
    setAuthBGGifPath String To set the local gif background image, place it in the drawable file and pass in the image name
    setAuthBGVideoPath String,String Set the background video file.
    1. Support local paths such as "android. resource://"+context. getPackageName()+"/"+R.raw.testvideo
    2. Support network path, resource address starting with https (it is recommended to use the local path after downloading to the local, network path will have network problems such as stuck), set the default first frequency image (it needs to be placed in the drawable file, and the image name can be passed in, if the video file path is local, you can fill in null)
    • status bar
    method Parameter type explain
    setStatusBarColorWithNav boolean Set the status bar to be the same color as the navigation bar. It only takes effect on devices above Android 5.0. since 2.4.1
    setStatusBarDarkMode boolean Set the status bar dark mode. Only valid for devices above Android 6.0. since 2.4.8
    setStatusBarTransparent boolean Set whether the status bar is transparent. Only valid for devices above Android 4.4. since 2.4.8
    setStatusBarHidden boolean Sets whether the status bar is hidden. since 2.4.8
    setVirtualButtonTransparent boolean Set whether the background of the virtual key bar is transparent. since 2.5.2
    • Landing Page Navigation Bar
    method Parameter type explain
    setNavColor int Set navigation bar color
    setSmsNavText String Set navigation bar title text
    setNavTextColor int Set navigation bar title text color
    setNavReturnImgPath String Set navigation bar return button icon
    setNavTransparent boolean Set whether the background of the navigation bar is transparent. The default is opaque. since 2.3.2
    setNavTextSize int Set the font size of navigation bar title text (unit: sp). since 2.4.1
    setNavReturnBtnHidden boolean Set whether the navigation bar return button is hidden. It is not hidden by default. since 2.4.1
    setNavReturnBtnWidth int Set the width of the navigation bar return button. since 2.4.8
    setNavReturnBtnHeight int Set the height of the navigation bar return button. since 2.4.8
    setNavReturnBtnOffsetX int Set the offset of the navigation bar return button from the left side of the screen. since 2.4.8
    setNavReturnBtnRightOffsetX int Set the offset of the navigation bar return button from the right side of the screen. since 2.4.8
    setNavReturnBtnOffsetY int Set the upper offset of the navigation bar return button. since 2.4.8
    setNavHidden boolean Set whether the navigation bar is hidden. since 2.4.8
    setNavTextBold boolean Sets whether the navigation bar title font is bold. since 2.5.4
    • Login page logo
    method Parameter type explain
    setSmsLogoWidth int Set logo width (unit: dp)
    setSmsLogoHeight int Set logo height (unit: dp)
    setSmsLogoHidden boolean Hide logo
    setSmsLogoOffsetY int Set the y offset of logo relative to the lower edge of the title bar
    setSmsLogoImgPath String Set logo image
    setSmsLogoOffsetX int Set the logo offset relative to the left x axis of the screen. since 2.3.8
    setSmsLogoOffsetBottomY int Set the logo offset relative to the y-axis at the bottom of the screen. since 2.4.8
    • Login page slogan
    method Parameter type explain
    setSmsSloganTextColor int Set mobile slogan text color
    setSmsSloganOffsetY int Set the y offset of slogan relative to the lower edge of the title block
    setSmsSloganOffsetX int Set the slogan offset relative to the left x-axis of the screen
    setSmsSloganOffsetBottomY int Set the y-axis offset of slogan relative to the bottom edge of the screen
    smsSloganTextSize int Set the slogan font size
    setSmsSloganTextBold boolean Set whether the slogan font is bold
    setSmsSloganHidden boolean Set whether the slogan font is hidden
    • Login page number input field
    method Parameter type explain
    setSmsPhoneInputViewTextColor int Set font color of mobile phone number input box
    setSmsPhoneInputViewTextSize Number Set the font size of the mobile phone number input box (the unit can be configured). since 3.1.0
    setSmsPhoneInputViewOffsetX int Set the offset of the number input box relative to the x-axis on the left of the screen. since 3.1.0
    setSmsPhoneInputViewOffsetY int Set the offset of the number input box relative to the y-axis at the bottom of the screen. since 3.1.0
    setSmsPhoneInputViewWidth int Set the width of the number input box. since 3.1.0
    setSmsPhoneInputViewHeight int Set the height of the number input box. since 3.1.0
    • Login page verification code input field
    method Parameter type explain
    setSmsVerifyCodeEditTextViewTextColor int Set the font color of the verification code input box
    setSmsVerifyCodeEditTextViewTextSize Number Set the font size of the verification code input box (unit: sp). since 3.1.0
    setSmsVerifyCodeEditTextViewOffsetY int Set the offset y of the verification code input box relative to the lower edge of the title block
    setSmsVerifyCodeEditTextViewTextOffsetX int Set the offset of the verification code input box relative to the x-axis on the left of the screen. since 3.1.0
    setSmsVerifyCodeEditTextViewOffsetR int Set the offset of the verification code input box relative to the right side of the screen. since 3.1.0
    setSmsVerifyCodeEditTextViewWidth int Set the width of the verification code input box. since 3.1.0
    setSmsVerifyCodeEditTextViewHeight int Set the height of the verification code input box. since 3.1.0
    • Login page get verification code button
    method Parameter type explain
    setSmsGetVerifyCodeTextViewTextColor int Set the text color of the get verification code button
    setSmsGetVerifyCodeBtnBackgroundPath String Set the picture of the button to obtain the verification code
    setSmsGetVerifyCodeTextViewOffsetY int Set the offset y of the button for obtaining verification code relative to the lower edge of the title bar
    setSmsGetVerifyCodeTextViewOffsetX int Set the offset of the Get Verification Code button relative to the left x-axis of the screen. since 3.1.0
    setSmsGetVerifyCodeDialog int Set the width of the Get Verification Code button. since 3.1.0
    setSmsGetVerifyCodeTextSize int Set the font size of the get verification code button. since 3.1.0
    setSmsGetVerifyCodeTextViewOffsetR int Set the offset of the Get Verification Code button relative to the y-axis at the bottom of the screen. since 3.1.0
    • Login Page Login Button
    method Parameter type explain
    setSmsLogBtnText String Set login button text
    setSmsLogBtnTextColor int Set login button text color
    setSmsLogBtnBackgroundPath String Set the image of the authorized login button
    setSmsLogBtnOffsetY int Set the y offset of the login button relative to the lower edge of the title bar
    setSmsLogBtnOffsetX int Set the login button offset relative to the left x axis of the screen. since 2.3.8
    setSmsLogBtnWidth int Set the width of the login button. since 2.3.8
    setSmsLogBtnHeight int Set the height of the login button. since 2.3.8
    setSmsLogBtnTextSize int Set the font size of the login button. since 2.3.8
    setSmsLogBtnBottomOffsetY int Set the y-axis offset of the login button relative to the bottom of the screen. since 2.4.8
    isSmsLogBtnTextBold boolean Set whether the login button font is bold. since 2.5.4
    • Login Page Privacy Bar
    method Parameter type explain
    setAppPrivacyColor int,int Set privacy clause name color (basic text color, agreement text color)
    setSmsPrivacyMarginL int Set the spacing of the protocol relative to the left side of the landing page. since 2.9.6
    setSmsPrivacyMarginR int Set the spacing of the protocol relative to the right side of the landing page. since 2.9.6
    setSmsPrivacyMarginT int Set the spacing of the protocol relative to the top of the landing page. since 2.9.6
    setSmsPrivacyMarginB int Set the spacing of the protocol relative to the bottom of the landing page. since 2.9.6
    setSmsPrivacyCheckboxMargin int[] Set the spacing of the protocol relative to the landing page. since 2.9.6
    setCheckedImgPath String Set picture when check box is selected
    setUncheckedImgPath String Set picture when check box is not selected
    setPrivacyState boolean Set the privacy terms to be selected by default, and not selected by default. since 2.3.2
    isSmsPrivacyTextGravityCenter boolean Set whether the privacy clause text is centered (left aligned by default). since 3.1.0
    setPrivacyText String,String,String,String Set the text outside the name of the privacy clause.
    For example, when you log in, you agree to And And log in with your own number; Parameter 1 is "Agree Upon Login". Parameter 2 is "and". Parameter 3 is ",". Parameter 4 is: "Log in with your own number".
    Since 2.3.8-2.7.2, 2.7.3 and later versions are invalid
    setPrivacyText String,String Set the text outside the name of the privacy clause.
    For example, when you log in, you agree to And log in with your own number; Parameter 1 is "Agree Upon Login". Parameter 2 is: "Log in with your own number".
    since 2.7.3
    setPrivacyTextSize int Set the font size of privacy terms (unit: sp). since 2.4.1
    setSmsPrivacyTopOffsetY int Set the privacy clause offset relative to the y-axis at the lower end of the navigation bar. since 2.4.8
    setPrivacyCheckboxHidden boolean Set whether the privacy clause checkbox is hidden. since 2.4.8
    setSmsPrivacyCheckboxSize int Set the size of the privacy clause checkbox. since 2.4.8
    setPrivacyWithBookTitleMark boolean Set whether to add a book name to the name of the operator agreement in the privacy terms. since 2.4.8
    isSmsPrivacyCheckboxInCenter boolean Set whether the privacy clause checkbox is vertically centered relative to the agreement text. Top by default. since 2.4.8
    setPrivacyTextWidth int Discard since 2.7.2
    enableHintToast boolean Toast When the checkbox in the agreement bar is not selected, click the login button to pop up a toast to prompt the user to check the agreement, which is not displayed by default. Custom Toast is supported. since 2.5.0
    enablePrivacyCheckDialog boolean Support to open pop-up window when privacy is not checked; When enablePrivacyCheckDialog is set to true, enableHintToast must also be set to true. since 2.9.0
    setPrivacyTextBold boolean Set whether the privacy clause text font is bold. since 2.5.4
    setPrivacyUnderlineText boolean Set whether the font of privacy terms is underlined. since 2.5.4
    setVirtualButtonColor int Set the background of the virtual navigation bar at the bottom of the authorization interface. since 2.7.3
    setPrivacyNameAndUrlBeanList(List) PrivacyBean(String name, String url, String separator) PrivacyBean parameter transfer; Parameter 1 is to set the name of developer privacy clause; Parameter 2 is: developer privacy clause URL; Parameter 3 is: connection symbol. since 2.7.4
    • Login page Privacy agreement web page
    method Parameter type explain
    setIsPrivacyViewDarkMode boolean Set the protocol to show whether the web page is suitable for dark mode. since 2.9.6
    True: Follow the system.
    False: Dark mode is not supported
    setPrivacyNavColor int Set the background color of protocol display web page navigation bar. since 2.4.8
    setPrivacyNavTitleTextColor int Set the text color of the navigation bar title of the protocol display web page. since 2.4.8
    setPrivacyNavTitleTextSize int Set the text size (sp) of the navigation bar title of the protocol display web page. since 2.4.8
    setPrivacyNavReturnBtn View Set the return button icon in the navigation bar of the protocol display web page. since 2.4.8
    setAppPrivacyNavTitle1 String Set the text content of the navigation bar of the web page corresponding to custom protocol 1. since 2.5.2
    setAppPrivacyNavTitle2 String Set the text content of the navigation bar of the web page corresponding to the user-defined protocol 2. since 2.5.2
    setPrivacyStatusBarColorWithNav boolean Set the status bar of the authorization agreement web page to be the same color as the navigation bar. It only takes effect on devices above Android 5.0. since 2.5.2
    setPrivacyStatusBarDarkMode boolean Set the dark mode of the status bar of the authorization agreement web page. Only valid for devices above Android 6.0. since 2.5.2
    setPrivacyStatusBarTransparent boolean Set whether the status bar of the authorization agreement web page is transparent. Only valid for devices above Android 4.4. since 2.5.2
    setPrivacyStatusBarHidden boolean Set whether the status bar of the authorization agreement web page is hidden. since 2.5.2
    setPrivacyVirtualButtonTransparent boolean Set whether the virtual key bar background of the authorization protocol web page is transparent. since 2.5.2
    setVirtualButtonHidden boolean Support to hide the bottom virtual key. since 2.9.0
    setPrivacyNavTitleTextBold boolean Set whether the protocol display web page navigation bar font is bold. since 2.5.4
    setPrivacyVirtualButtonColor int Set the background of the virtual navigation bar at the bottom of the privacy interface since 2.7.3
    • User defined loading view
    method Parameter type explain
    setLoadingView View,Animation Set the loading view and animation effect displayed in the login process. since 2.4.8
    • Landing page animation
    method Parameter type explain
    setNeedStartAnim boolean Set whether to display the default animation when pulling up the authorization page. Default presentation. since 2.5.2
    setNeedCloseAnim boolean Set whether to display the default animation when closing the authorization page. Default presentation. since 2.5.2
    • Developer defined control
    method Parameter type explain
    addCustomView See above method definition Add a custom control and click Monitor in the blank of the authorization page
    addNavControlView See above method definition Add custom controls in the navigation bar at the top of the authorization page and click Listen
    • Secondary protocol pop-up configuration
    method Parameter type explain
    setPrivacyCheckDialogTitleTextSize See above method definition Protocol secondary pop-up font size
    setPrivacyCheckDialogTitleTextColor See above method definition Protocol secondary pop-up font color
    setPrivacyCheckDialogContentTextGravity See above method definition The second pop-up window of the agreement The content of the agreement
    setPrivacyCheckDialogContentTextSize See above method definition Protocol Secondary Pop up Protocol Content Font Size
    setPrivacyCheckDialogLogBtnImgPath See above method definition Background image of protocol secondary pop-up login button
    setPrivacyCheckDialoglogBtnTextColor See above method definition Font color of protocol secondary pop-up login button
    setPrivacyCheckDialogWidth See above method definition The width of the agreement secondary pop-up window itself
    setPrivacyCheckDialogHeight See above method definition The height of the agreement secondary pop-up window itself
    setprivacyCheckDialogGravity See above method definition Protocol secondary pop-up font color
    setPrivacyCheckDialogOffsetX See above method definition The offset of the protocol secondary pop-up window itself to the parent class
    setPrivacyCheckDialogOffsetY See above method definition The offset of the protocol secondary pop-up window itself to the parent class
    setPrivacyCheckDialogLogBtnWidth See above method definition The width of the protocol secondary pop-up login button
    setPrivacyCheckDialogLogBtnHeight See above method definition The height of the protocol secondary pop-up login button

    Pull up the authorization page (old)

    Supported versions

    Start supporting version 2.3.0

    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 == 6000){ Log.d(TAG, "code=" + code + ", token=" + content+" ,operator="+operator); }else{ Log.d(TAG, "code=" + code + ", message=" + content); } } });
               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); } } });
            
    This code block is displayed in the floating window

    Pull up the authorization page (old)

    Supported versions

    Start supporting version 2.0.0

    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 == 6000){ Log.d(TAG, "code=" + code + ", token=" + content+" ,operator="+operator); }else{ Log.d(TAG, "code=" + code + ", message=" + content); } } });
               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); } } });
            
    This code block is displayed in the floating window

    Number authentication

    initialization

    Before calling other SDK process methods, please ensure that initialization has been called, otherwise it will return uninitialized. For details, refer to SDK Initialization API After initialization, if you call the following function interface, it will be deemed that you agree to open the business functions related to Evoque security certification, and we will collect the necessary personal information of the business functions and report it.

    Determine whether the network environment supports

    Determine whether the current mobile phone network environment can use number authentication. If the network supports it, call the number authentication API. Otherwise, call the API of other authentication methods. For details, refer to Determine whether the network environment supports API

    Obtain the number authentication token (new)

    Supported versions

    Start supporting version 2.2.0

    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, 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); } });
               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); } });
            
    This code block is displayed in the floating window

    explain : Developers can obtain the callback information of the token interface through the SDK to select the verification method. If the token is successfully obtained, they can continue to use Aurora authentication for number verification; If the token acquisition fails, you need to continue to complete the verification by using SMS verification code and other methods.

    Obtain the number authentication token (old)

    Supported versions

    Start supporting version 1.0.0

    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 == 2000){ Log.d(TAG, "token=" + content + ", operator=" + operator); } else { Log.d(TAG, "code=" + code + ", message=" + content); } });
               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); } });
            
    This code block is displayed in the floating window

    SDK initiator number authentication

    Since version 2.4.3, this interface has been removed

    Supported versions

    Start supporting version 1.0.0

    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 == 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); } });
               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); } });
            
    This code block is displayed in the floating window

    explain : To call this interface, the developer needs to find the application on the management console and enable [SDK Initiate Authentication] in [Authentication Settings] - [Other Settings]. It is recommended to initiate number authentication from the developer server.

    Verification Code

    SDK Get Verification Code

    Supported versions

    Start supporting version 2.6.0

    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 == 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); } });} } });
                       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); } });} } });
            
    This code block is displayed in the floating window

    Set the time interval between acquiring the verification code before and after

    Supported versions

    Start supporting version 2.6.0

    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(60000);// Set the interval time to 60 seconds
               JVerificationInterface .setSmsIntervalTime ( sixty thousand ); //Set the interval time to 60 seconds
    
            
    This code block is displayed in the floating window

    Extended business related settings

    Optional personal information settings

    Call this API to configure optional personal information collection

    Supported versions

    Version 3.1.7 supported at the beginning needs to cooperate with JCore Android SDK v4.6.0 and above

    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);
               JVerificationInterface.setAuth( this , false ); JVerifyCollectControl.Builder ss= new  JVerifyCollectControl .Builder(); ss.cell( true ); .... JVerifyCollectControl  build  = ss.build(); JVerificationInterface.setCollectControl( this , build);
            
    This code block is displayed in the floating window

    JVerifyCollectControl control class

    IMEI acquisition switch

    public Build imei(boolean enable)
                       public Build imei ( boolean enable)
    
            
    This code block is displayed in the floating window

    Method description: Configure IMEI information collection switch. The default value is true, false - collection is not allowed

    MAC acquisition switch

    public Build mac(boolean enable)
                       public Build mac ( boolean enable)
    
            
    This code block is displayed in the floating window

    Method description: Configure the MAC information collection switch. The default value is true, false - collection is not allowed

    Cell acquisition switch

    public Build cell(boolean enable)
                       public Build cell ( boolean enable)
    
            
    This code block is displayed in the floating window

    Method description: Configure the CELL information collection switch. The default value is true, false - collection is not allowed

    IMSI acquisition switch

    public Build imsi(boolean enable)
                       public Build imsi ( boolean enable)
    
            
    This code block is displayed in the floating window

    Method description: Configure the IMSI information collection switch. The default value is true, false - collection is not allowed

    Extended business related settings

    Risk control configuration

    Supported versions

    Start supporting version 3.2.3

    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);
               JVerificationInterface.setCollectControl( this , false );
            
    This code block is displayed in the floating window

    Extended business function settings

    Call this API to configure extended business functions

    Supported versions

    Version 3.1.7 supported at the beginning needs to cooperate with JCore Android SDK v4.6.0 and above

    Application self start

    JCollectionAuth.enableAutoWakeup(Context context, boolean isAutoWakeupEnable);
               JCollectionAuth.enableAutoWakeup(Context context, boolean isAutoWakeupEnable);
            
    This code block is displayed in the floating window

    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

    Start supporting version 3.2.1

    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);
               JVerificationInterface.enableNetworkMonitoringOptimizer( false );
            
    This code block is displayed in the floating window
    Is the document content helpful to you?

    Copyright 2011-2022, jiguang.cn, All Rights Reserved. Yue ICP Bei 12056275-13 Shenzhen Hexunhuagu Information Technology Co., Ltd

    Open in Document Center