How to Update User Role Passwords Using API: Difference between revisions

From wizarPOS
No edit summary
No edit summary
Line 5: Line 5:
== Required Permissions ==
== Required Permissions ==
* Include the following permissions in your application's manifest:
* Include the following permissions in your application's manifest:
** ''''android.permission.USER_PWD'''':permission for isUserPwd.
** ''''android.permission.USER_PWD'''': permission for isUserPwd.
** ''''android.permission.USER_PWD_MODIFY'''': permission for forceModifyUserPwd, enableUserLogin.
** ''''android.permission.USER_PWD_MODIFY'''': permission for forceModifyUserPwd, enableUserLogin.


Line 11: Line 11:
=== <big>isUserPwd</big> ===
=== <big>isUserPwd</big> ===
   <syntaxhighlight lang="java">boolean isUserPwd(String pwd);</syntaxhighlight>
   <syntaxhighlight lang="java">boolean isUserPwd(String pwd);</syntaxhighlight>
* Checks if the provided string (''''pwd'''') is the current user password.
 
{|class="wizarpostable"
{|class="wizarpostable"
|-
|-
! scope="row" colspan="2" | Parameters
! scope="row" colspan="2" | Checks if the provided string (''''pwd'''') is the current user password.
|-
|-
| pwd || '''String:''' Not null.
| param pwd || '''String:''' Not null.
|}
{|
|-
|-
|  
| return boolean || true of false.
|}
{|class="wizarpostable"
|-
!  scope="row" colspan="2" | Returns
|-
boolean || true of false.
|}
|}
=== <big>forceModifyUserPwd</big> ===
=== <big>forceModifyUserPwd</big> ===
   <syntaxhighlight lang="java">boolean forceModifyUserPwd(String newPwd);</syntaxhighlight>
   <syntaxhighlight lang="java">boolean forceModifyUserPwd(String newPwd);</syntaxhighlight>
Line 33: Line 26:
{|class="wizarpostable"
{|class="wizarpostable"
|-
|-
! scope="row" colspan="2" | Parameters
! scope="row" colspan="2" | Parameters and Returns
|-
|-
| newPwd ||  '''String:''' Not null.
| newPwd ||  '''String:''' Not null.
|}
{|
|-
|-
|  
| return boolean || true of false.
|}
{|class="wizarpostable"
|-
!  scope="row" colspan="2" | Returns
|-
boolean || true of false.
|}
|}
=== <big>enableUserLogin</big> ===
=== <big>enableUserLogin</big> ===
   <syntaxhighlight lang="java">boolean enableUserLogin(boolean eneable);</syntaxhighlight>
   <syntaxhighlight lang="java">boolean enableUserLogin(boolean eneable);</syntaxhighlight>
Line 52: Line 38:
{|class="wizarpostable"
{|class="wizarpostable"
|-
|-
! scope="row" colspan="2" | Parameters
! scope="row" colspan="2" | Parameters/Returns
|-
|-
| name || '''boolean:''' true to enable, false to disable.
| @param name || '''boolean:''' true to enable, false to disable.
|}
{|
|-
|-
|  
| @return boolean || true of false.
|}
{|class="wizarpostable"
|-
!  scope="row" colspan="2" | Returns
|-
boolean || true of false.
|}
|}
== Code Snippet and AIDL File ==
== Code Snippet and AIDL File ==
* Access the necessary code snippets and [http://ftp.wizarpos.com/advanceSDK/IModifyAdminPwdService.aidl download the AIDL file] for implementation.
* Access the necessary code snippets and [http://ftp.wizarpos.com/advanceSDK/IModifyAdminPwdService.aidl download the AIDL file] for implementation.

Revision as of 09:12, 5 January 2024

Interface Details

  • Package Name: 'com.wizarpos.wizarviewagentassistant'
  • Class Name: 'com.wizarpos.wizarviewagentassistant.AdminPwdMainService'
  • Before using the interface, ensure the package is imported and necessary permissions are added to the Android manifest file.

Required Permissions

  • Include the following permissions in your application's manifest:
    • 'android.permission.USER_PWD': permission for isUserPwd.
    • 'android.permission.USER_PWD_MODIFY': permission for forceModifyUserPwd, enableUserLogin.

API Functions

isUserPwd

boolean isUserPwd(String pwd);
Checks if the provided string ('pwd') is the current user password.
param pwd String: Not null.
return boolean true of false.

forceModifyUserPwd

boolean forceModifyUserPwd(String newPwd);
  • Modifies the user role password to the new password ('newPwd').
Parameters and Returns
newPwd String: Not null.
return boolean true of false.

enableUserLogin

boolean enableUserLogin(boolean eneable);
  • Enables or disables user role login based on the boolean value ('enable').
Parameters/Returns
@param name boolean: true to enable, false to disable.
@return boolean true of false.

Code Snippet and AIDL File

<!-- AdminPwdMainService -->
<uses-permission android:name="android.permission.USER_PWD"/>
<uses-permission android:name="android.permission.USER_PWD_MODIFY"/>

boolean result = adminPwdService.forceModifyUserPwd(newPwd);
boolean isUserPwd = adminPwdService.isUserPwd(newPwd);

ComponentName comp = new ComponentName (
        "com.wizarpos.wizarviewagentassistant",
        "com.wizarpos.wizarviewagentassistant.AdminPwdMainService");