ttlock / iOS_SDK_Demo

TTLock is a global provider of solutions for smart locks. We provide PCBA and softwares for lock manufactures and end users. We provide open API/SDK for developers. With these APIs/SDKs, you can develop your own applications to manage smart locks. The SDK here is for mobile app to communicate with locks via bluetooth.
MIT License
12 stars 12 forks source link

Request for Confirmation of Custom Error Messages for TTError enum #38

Closed pinalpsspl closed 3 weeks ago

pinalpsspl commented 1 month ago

Hi @JuannyiOS, @ttlock ,

I’ve wanted to show a more user-friendly message to users when any operation is performed and a failure callback is triggered. To achieve this we have utilized TTError provided in the failure callback.

Could you please review the changes and confirm if these messages align with the intended user experience?

Here are the proposed messages for each error case:

  1. hadReseted: "The lock has been reset. Please reconfigure it."
  2. crcError: "Data verification failed. Please check the data and try again."
  3. noPermission: "You don’t have the necessary permissions to perform this action."
  4. wrongAdminCode: "The admin code you entered is incorrect. Please try again."
  5. lackOfStorageSpace: "There isn’t enough storage space available. Please free up some space and try again."
  6. inSettingMode: "The lock is currently in setting mode. Please wait until it finishes."
  7. noAdmin: "No admin has been set for this lock. Please configure an admin."
  8. notInSettingMode: "The lock is not in setting mode. Please start the setup process."
  9. wrongDynamicCode: "The dynamic code entered is incorrect. Please check and try again."
  10. isNoPower: "The lock appears to have no power. Please check the power source."
  11. resetPasscode: "The passcode has been reset. Please enter a new one."
  12. updatePasscodeIndex: "The passcode index has been updated successfully."
  13. invalidLockFlagPos: "The lock flag position is invalid. Please check the position and try again."
  14. ekeyExpired: "Your eKey has expired. Please renew it."
  15. passcodeLengthInvalid: "The passcode length is not valid. Please enter a passcode with the correct length."
  16. samePasscodes: "Passcodes cannot be identical. Please use different passcodes."
  17. ekeyInactive: "The eKey is inactive. Please activate it and try again."
  18. aesKey: "There’s an issue with the AES key. Please check the key and try again."
  19. fail: "The operation failed. Please try again."
  20. passcodeExist: "The passcode already exists. Please use a different one."
  21. passcodeNotExist: "The passcode does not exist. Please check and try again."
  22. lackOfStorageSpaceWhenAddingPasscodes: "Not enough storage space to add more passcodes. Please free up space and try again."
  23. invalidParaLength: "The length of the parameter is invalid. Please check and try again."
  24. cardNotExist: "The card does not exist. Please check the card and try again."
  25. fingerprintDuplication: "Fingerprint duplication detected. Please ensure each fingerprint is unique."
  26. invalidParam: "An invalid parameter was provided. Please check and correct it."
  27. fingerprintNotExist: "The fingerprint does not exist. Please check and try again."
  28. invalidCommand: "The command provided is invalid. Please check the command and try again."
  29. inFreezeMode: "The lock is in freeze mode. Please wait until it is unfrozen."
  30. invalidClientPara: "The client parameter provided is invalid. Please check and try again."
  31. lockIsLocked: "The lock is currently locked. Please unlock it and try again."
  32. recordNotExist: "The record does not exist. Please verify the record and try again."
  33. wrongSSID: "The SSID provided is incorrect. Please check and try again."
  34. wrongWifiPassword: "The Wi-Fi password is incorrect. Please check and try again."
  35. bluetoothPoweredOff: "Bluetooth is turned off. Please turn it on and try again."
  36. connectionTimeout: "The connection timed out. Please try connecting again."
  37. disconnection: "You’ve been disconnected from the lock. Please reconnect and try again."
  38. lockIsBusy: "The lock is currently busy. Please try again later."
  39. wrongLockData: "The lock data provided is incorrect. Please check the data and try again."
  40. invalidParameter: "An invalid parameter was provided. Please verify the parameter and try again."
  41. default: If a specific error message is not available, a generic message: "Oops! Something went wrong. Please try again later."

Please let me know if these messages are appropriate or if any adjustments are needed.

Thank you!

pinalpsspl commented 3 weeks ago

Hi @JuannyiOS, @ttlock

A gentle reminder to check on these messages and let us know if these messages are appropriate or if any adjustments are needed.

we request you to provide an update on this issue as soon as possible to ensure a better user experience.

ttlock commented 3 weeks ago

2 crcError: Data verification failed. Please try again. (remove check the data ,because this is a problem that occurred during the transmission process) 4 wrongAdminCode :The admin code is incorrect (remove you entered, because this is generated when adding the lock) 9 wrongDynamicCode: The dynamic code is incorrect (remove you entered, because this is generated when adding the lock) 11 resetPasscode: Reset Passcode fail 12 updatePasscodeIndex:The passcode index has been updated fail. (Here are all error returns, not success) 18 aesKey :The aesKey is incorrect

others are ok

pinalpsspl commented 3 weeks ago

@ttlock

Thank you so much for validating messages and providing valuable suggestions with detailed explanations.

Appreciate it!