Closed dagonco closed 7 months ago
Hi, we were discussing in the team about this bridge method and the comment came up to try to give a more generic/scalable solution. I mean that instead of returning a boolean value maybe we could be interested in something more generic like an enum where initially the values could be:
enum {
case PIN_ENABLED
case PIN_DISABLED
}
I do not have current uses cases but perhaps in the future we might be interested in returning in this function values like:
PIN_NOT_SUPPORTED
PIN_AND_BIOMETRY_IS_ENABLED
Updated: I upload a sample response
Response -> {type: "GET_PINCODE_INFO", payload: {"status": "PIN_ENABLED"}}
Hi, we were discussing in the team about this bridge method and the comment came up to try to give a more generic/scalable solution. I mean that instead of returning a boolean value maybe we could be interested in something more generic like an enum where initially the values could be:
enum { case PIN_ENABLED case PIN_DISABLED }
I do not have current uses cases but perhaps in the future we might be interested in returning in this function values like:
PIN_NOT_SUPPORTED PIN_AND_BIOMETRY_IS_ENABLED
Updated: I upload a sample response
Response -> {type: "GET_PINCODE_INFO", payload: {"status": "PIN_ENABLED"}}
Agree with @DavidMarinCalleja
Btw, I would simplify the tokens:
Response -> {type: "GET_PINCODE_INFO", payload: {"status": "enabled" | "disabled"}}
[!NOTE]
disabled
for any unknownstatus
Sure, that looks much better! We could go that way, thanks! 🚀
Please update the issue description with the final proposal
LGTM. Some suggestions:
Please, specify the possible status values in the function return type:
getPincodeInfo: () => Promise<{status: "enabled" | "disabled"}>
Also document that any status different than "enabled" (like unknown, not supported, etc) will be reported as "disabled"
Minor thing: the id
was missing in the response:
Request → {type: "GET_PINCODE_INFO", id: string}
Response → {type: "GET_PINCODE_INFO", id: string, payload: {status: "enabled" | "disabled"}}
LGTM. Jira ticket for web implementation: https://jira.tid.es/browse/WEB-1760
Based on the migration from Profile to the web, from the native part it must be exposed through the bridge whether the user has Pincode activated or not. Link to the PRD.
Get Pincode Info