Skip to content

Commit e3a6ba4

Browse files
Merge branch 'develop'
2 parents ac3ac4d + 7f965f5 commit e3a6ba4

9 files changed

Lines changed: 50 additions & 53 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ One SDK for cross-platform publishing HTML5 games.
77
+ [Crazy Games](https://crazygames.com)
88
+ [Yandex Games](https://yandex.com/games)
99
+ [Y8](https://y8.com)
10-
+ [Wortal](https://wortal.ai)
1110
+ [PlayDeck](https://playdeck.io)
1211
+ [Telegram](https://core.telegram.org/bots/webapps)
1312
+ [VK](https://vk.com)

datafiles/playgama-bridge-config.json

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,22 @@
1414
"lagged": {
1515
"devId": "",
1616
"publisherId": ""
17+
}
18+
},
19+
"advertisement": {
20+
"interstitial": {
21+
"preloadOnStart": true
1722
},
18-
"facebook": {
19-
"bannerPlacementId": "",
20-
"interstitialPlacements": [],
21-
"rewardedPlacements": []
23+
"rewarded": {
24+
"preloadOnStart": true
2225
}
2326
},
2427
"payments": [
2528
{
26-
"commonId": "test_product",
27-
"yandex": {
28-
"id": "test_product"
29-
},
30-
"facebook": {
31-
"productID": "test_product"
32-
},
33-
"msn": {
34-
"productId": "test_product"
35-
},
29+
"id": "test_product",
3630
"playgama": {
3731
"amount": 1
3832
},
39-
"qa_tool": {
40-
"id": "test_product",
41-
"amount": 1
42-
},
4333
"playdeck": {
4434
"amount": 1,
4535
"description": "TEST PRODUCT"

datafiles/playgama-bridge.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/playgama_bridge/playgama-bridge-gm.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ bridge.game.on(
2424

2525

2626
// advertisement
27-
function playgamaBridgeAdvertisementShowInterstitial() {
28-
window.bridge.advertisement.showInterstitial()
27+
function playgamaBridgeAdvertisementShowInterstitial(placement) {
28+
window.bridge.advertisement.showInterstitial(placement)
2929
}
3030

31-
function playgamaBridgeAdvertisementShowRewarded() {
32-
window.bridge.advertisement.showRewarded()
31+
function playgamaBridgeAdvertisementShowRewarded(placement) {
32+
window.bridge.advertisement.showRewarded(placement)
3333
}
3434

3535
function playgamaBridgeAdvertisementInterstitialState() {
@@ -40,6 +40,10 @@ function playgamaBridgeAdvertisementRewardedState() {
4040
return window.bridge.advertisement.rewardedState
4141
}
4242

43+
function playgamaBridgeAdvertisementRewardedPlacement() {
44+
return window.bridge.advertisement.rewardedPlacement
45+
}
46+
4347
function playgamaBridgeAdvertisementIsBannerSupported() {
4448
return serializeData(window.bridge.advertisement.isBannerSupported)
4549
}
@@ -52,13 +56,8 @@ function playgamaBridgeAdvertisementSetMinimumDelayBetweenInterstitial(value) {
5256
window.bridge.advertisement.setMinimumDelayBetweenInterstitial(value)
5357
}
5458

55-
function playgamaBridgeAdvertisementShowBanner(options) {
56-
try {
57-
options = JSON.parse(options)
58-
}
59-
catch (e) {}
60-
61-
window.bridge.advertisement.showBanner(options)
59+
function playgamaBridgeAdvertisementShowBanner(position, placement) {
60+
window.bridge.advertisement.showBanner(position, placement)
6261
}
6362

6463
function playgamaBridgeAdvertisementHideBanner() {
@@ -536,8 +535,8 @@ function playgamaBridgePaymentsPurchase(id) {
536535

537536
function playgamaBridgePaymentsConsumePurchase(id) {
538537
window.bridge.payments.consumePurchase(id)
539-
.then(() => {
540-
sendCallbackToGameMaker('payments_consume_purchase', true)
538+
.then((data) => {
539+
sendCallbackToGameMaker('payments_consume_purchase', true, data)
541540
})
542541
.catch(() => {
543542
sendCallbackToGameMaker('payments_consume_purchase', false)

extensions/playgama_bridge/playgama_bridge.yy

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objects/obj_playgama_bridge_callbacks_example/Other_70.gml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,15 @@ if async_load[? "type"] == "playgama_bridge_achievements_show_native_popup_callb
215215
if async_load[? "type"] == "playgama_bridge_payments_purchase_callback" {
216216
if async_load[? "success"] {
217217
var purchase = json_parse(async_load[? "data"])
218-
var commonId = purchase.commonId
218+
var productId = purchase.id
219+
// your logic
219220
}
220221
}
221222

222223
if async_load[? "type"] == "playgama_bridge_payments_consume_purchase_callback" {
223224
if async_load[? "success"] {
225+
var purchase = json_parse(async_load[? "data"])
226+
var productId = purchase.id
224227
// your logic
225228
}
226229
}
@@ -230,7 +233,7 @@ if async_load[? "type"] == "playgama_bridge_payments_get_catalog_callback" {
230233
var catalog = json_parse(async_load[? "data"])
231234
for (var i = 0; i < array_length(catalog); i += 1)
232235
{
233-
var commonId = catalog[i].commonId
236+
var productId = catalog[i].id
234237
var price = catalog[i].price
235238
var priceCurrencyCode = catalog[i].priceCurrencyCode
236239
var priceValue = catalog[i].priceValue
@@ -243,7 +246,7 @@ if async_load[? "type"] == "playgama_bridge_payments_get_purchases_callback" {
243246
var purchases = json_parse(async_load[? "data"])
244247
for (var i = 0; i < array_length(purchases); i += 1)
245248
{
246-
var commonId = purchases[i].commonId
249+
var productId = purchases[i].id
247250
}
248251
}
249252
}

playgama-bridge-gamemaker.yyp

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)