You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/plugins/pin.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,15 +36,17 @@ Pin.hide()
36
36
37
37
Sends a Pin code to the middleware layer for verification. If the code is correct, the STB will be unlocked.
38
38
39
+
The `submit` method accepts `pin` and `context` as it's arguments. The context argument indicates in with what purpsose the Pin dialog is being used. The accepted values van be either `parental` or `purchase`. `context` defaults to `purchase`, but it's recommended to explicitly specify the context
40
+
39
41
The `submit` method is automatically invoked when you are using the built-in **Pin** dialog. Use this method for sending the Pin code *only* if you are making a fully custom **Pin** dialog in your App.
40
42
41
43
```js
42
-
Pin.submit('0000')
44
+
Pin.submit('0000', context)
43
45
.then(() =>console.log('Unlocked!'))
44
46
.catch(e=>console.log('Pin error', e))
45
47
```
46
48
47
-
The `submit` method returns a *Promise*. If the supplied Pin code is correct, the Promise resolves with `true` and the STB will be unlocked. If the Pin code is wrong, the Promise resolves with `false`.
49
+
The `submit` method returns a *Promise*. If the supplied Pin code is correct (and context is valid), the Promise resolves with `true` and the STB will be unlocked. If the Pin code or context are wrong, the Promise resolves with `false`.
48
50
49
51
If the middleware is unable to unlock the STB, the Promise is *rejected* (with an optional error message).
50
52
@@ -55,7 +57,7 @@ During development, the default Pin code is `0000`. Optionally, you can overwri
55
57
Checks if the STB is currently *unlocked*.
56
58
57
59
```js
58
-
Pin.unlocked()
60
+
Pin.unlocked(context)
59
61
.then(
60
62
unlocked=> unlocked ===true?
61
63
console.log('STB is unlocked') :
@@ -71,7 +73,7 @@ If the middleware is unable to retrieve the current state, the Promise is *rejec
0 commit comments