Skip to content

Commit 82e1908

Browse files
Site changes [skip-ci]
1 parent 14a3cf8 commit 82e1908

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

_data/extensions/extension-poki-sdk_poki_sdk.json

+16
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@
4747
{
4848
"doc": "",
4949
"name": "callback",
50+
"parameters": [
51+
{
52+
"doc": "The calling script instance",
53+
"name": "self",
54+
"types": [
55+
"object"
56+
]
57+
},
58+
{
59+
"doc": "One of the statuses: `poki_sdk.REWARDED_BREAK_ERROR`, `poki_sdk.REWARDED_BREAK_START`, `poki_sdk.REWARDED_BREAK_SUCCESS`",
60+
"name": "status",
61+
"types": [
62+
"number"
63+
]
64+
}
65+
],
5066
"types": [
5167
"function"
5268
]

extension-poki-sdk/index.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,15 @@ Rewarded breaks allow for a user to choose to watch a rewarded video ad in excha
5858

5959
```lua
6060
-- gameplay stops
61-
poki_sdk.rewarded_break(function(self, success)end)
61+
poki_sdk.rewarded_break(function(self, status)
62+
if status == poki_sdk.REWARDED_BREAK_ERROR then
63+
print("Rewarded break error!")
64+
elseif status == poki_sdk.REWARDED_BREAK_START then
65+
print("Rewarded break start")
66+
elseif status == poki_sdk.REWARDED_BREAK_SUCCESS then
67+
print("Rewarded break success")
68+
end
69+
end)
6270
```
6371

6472
### About the rewarded break timer
@@ -74,9 +82,14 @@ Make sure that audio and keyboard input are disabled during commercialBreaks, so
7482

7583
```lua
7684
-- gameplay stops
77-
-- fire your mute audio function
85+
-- fire your mute audio function, for example:
86+
sound.pause("#music", true)
7887
poki_sdk.commercial_break(function(self)
79-
-- fire your unmute audio function
88+
-- fire your unmute audio function, for example:
89+
if status == poki_sdk.REWARDED_BREAK_ERROR or
90+
status == poki_sdk.REWARDED_BREAK_SUCCESS then
91+
sound.pause("#music", false)
92+
end
8093
-- fire your function to continue to game
8194
end)
8295
```

0 commit comments

Comments
 (0)