- Print
showContentPinOverlay()
- Print
showContentPinOverlay()
Present the X1 Platform content pin overlay, allowing the X1 Application to leverage that system (including validation of pin and lockout after several failed attempts). The results of the pin challenge are returned back to the application as a JSON object in either the success or failure callback methods. The content pin overlay behaves identically to the purchase pin.
An example of the purchase pin overlay can be seen below:
Signature:
$badger.showContentPinOverlay()
Parameters:
None.
Return Values:
Result will be returned via a success or failure callback with a status together one or more other returned values:
callback | scenario | status | message |
---|---|---|---|
success | The user entered a valid pin in the overlay | SUCCESS | Successful Pin Validation |
success | The user has not enabled the purchase pin so no overlay is shown | PIN_NOT_REQUIRED | Pin not required: content_pin not enabled |
failure | Five consecutive invalid PINs have been entered in the overlay and user will be locked out for 60 minutes | LOCKED | Maximum attempts exceeded. Wait minute(s) before retrying |
failure | The user dismissed the overlay without entering a valid PIN. | USER_DISMISSED_OVERLAY | User dismissed Pin overlay |
failure | The X1 Platform failed to query Parental Control Info to determine if a PIN has been enabled | PARENT_CONTROL_QUERY_ERROR | Failed to query Parental Control Info |
failure | The X1 Platform failed to communicate with the associated PIN validation service. This could be a result of a networking error. | SERVICE_COMMUNICATION_ERROR | Failed to communicate with PinOverlayService |
failure | The X1 Platform failed to launch the PIN overlay due to unexpected system errors | OVERLAY_LAUNCH_ERROR | Failed to launch Pin Overlay |
failure | One of the two possible PIN overlays (parental or purchase) are currently displaying and an attempt was made to launch one of them again. Only one PIN overlay is allowed to be displayed at any given time | OVERLAY_LAUNCH_ERROR | Invalid state, a Pin overlay has already been launched |
Usage Example:
When an X1 App calls the method below:
var promise = $badger.showContentPinOverlay()
The result will be an overlay like below (note that the Content pin looks and behaves identically to the Purchase pin except for the text at the top of the overlay):
If the user enters a pin incorrectly once, they will see the following:
If the user enters a pin incorrectly 5 times in a row, they will see the following: