zenocross Posted September 4, 2018 Share Posted September 4, 2018 Hi, I've been using Phaser 3 (3.11.0) and although I've got FB ads to work already, it looks like after playing an ad the scene becomes unresponsive ('pointerdown' listeners stop working from what I can tell). The Phaser systems look to be running though since I have this console for debug that gets cleared up over time. I'm wondering if anyone else encountered this and has a solution for it or knows what I'm doing wrong/missing anything? The ad fetching and showing code is same as whats in the FB instant documentation. I though it has something to do with the scene not being on top of the window or something so I've tried bringing the scene in front and even restarting the scene but it's also not working. Fetch Code: this.preloadedInterstitial = null; FBInstant.getInterstitialAdAsync( this.INTERSTITIAL_PLACEMENT_ID, // Variable set in scene ).then((interstitial) => { DebugConsole.instance.append("LOADING INTERSTITIAL"); // Load the Ad asynchronously this.preloadedInterstitial = interstitial; return this.preloadedInterstitial.loadAsync(); }).then(function() { DebugConsole.instance.append("INTERSTITIAL LOADED"); }).catch(function(err){ DebugConsole.instance.append("INTERSTITIAL FAILED TO LOAD " + err); }); Show Code: this.preloadedInterstitial.showAsync() .then(() => { // Perform post-ad success operation DebugConsole.instance.append("SHOWN VID"); }).catch((e) => { DebugConsole.instance.append("SHOW VID ERR" + e); }).finally(() => { DebugConsole.instance.append("FINALLY WORKS"); }); }); Quote Link to comment Share on other sites More sharing options...
Noel Posted September 4, 2018 Share Posted September 4, 2018 @zenocross I strongly suggest using the latest version (beta) available on github: https://github.com/photonstorm/phaser It comes with some integration with the Instant Games SDK so you should not have to deal with these issues. Quote Link to comment Share on other sites More sharing options...
rich Posted September 4, 2018 Share Posted September 4, 2018 @zenocross does the FB ad leaving anything in the DOM? (like an overlay, or an event handler) - I'm wondering if Phaser is even receiving the inputs after this point, or they're being blocked, or something else is going on. Quote Link to comment Share on other sites More sharing options...
zenocross Posted September 4, 2018 Author Share Posted September 4, 2018 Thank you for the immediate responses. @Noel I did but still had issues with it though I have figured it out already. Sorry, apparently the actual issue in the code was not included in my snippet. Hi @rich, No, there's no overlay after closing the ad so I thought everything looked like it was still normal. Anyway I have figured it out after looking through the github issues and reading about someone stating the pointerdown function is queued for next update or something like that. The issue was that in my code that shows the ad, the function was put inside a text gameobject's pointerdown function. After that, it looks like the input is blocked totally. I'm not sure if it's something that needs attention with Phaser itself but the fix is actually simpler than I thought. For anyone else with this problem : showing Facebook Ads should be put on the pointerup event. I hope it helps. Quote Link to comment Share on other sites More sharing options...
o0Corps0o Posted September 11, 2018 Share Posted September 11, 2018 Hi guys, I'm using Phaser 2 to build a Multiplayer FB game. We've got it pretty much working, but now we're trying to add Rewards/Interstitual Ads, However following the examples/tutorials the best I can, I keep getting and error "Client does not support the message: getinterstitialadasync" (Obviously if I try it with the reward ad code, it would be similar to this) Another example I tried (snippet): const INTERSTITIAL_PLACEMENT_ID = '***_***'; FBInstant.startGameAsync().then(function() { var supportedAPIs = FBInstant.getSupportedAPIs(); if (supportedAPIs.includes('getInterstitialAdAsync')){ displayError("Supported Interstitial API"); FBInstant.getInterstitialAdAsync( INTERSTITIAL_PLACEMENT_ID, // Variable set in scene ).then((interstitial) => { displayError('Interstitial video loading'); //console.log("LOADING INTERSTITIAL"); // Load the Ad asynchronously preloadedInterstitial = interstitial; return preloadedInterstitial.loadAsync(); }).then(function() { displayError("INTERSTITIAL LOADED"); }).catch(function(err){ displayError("INTERSTITIAL FAILED TO LOAD " + err); }); } else { displayError('Insterstitial Ads not supported'); } If I use this code above the supportedAPIs.includes('getInterstitialAdAsyn') also fails. Any ideas would be appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
Noel Posted September 13, 2018 Share Posted September 13, 2018 (edited) @o0Corps0o On which platform do you test? Reminder: ads are only available on the mobile apps, not on www. Edited September 13, 2018 by Noel Forgot important details. Quote Link to comment Share on other sites More sharing options...
o0Corps0o Posted September 13, 2018 Share Posted September 13, 2018 Hi Noel, I was testing on my Samsung S9, but it seems to work now, I'm not sure why it suddenly started working. I submitted for review (the ads) and was declined, because it wasn't working and still had a load of debugging in the game. But since I did this, it started working.. So could just be that it doesn't work instantly? and you have to wait a few days for it to kick in maybe? I dont know.. But it works now. Just wish I knew what the issue was incase it happened again Thanks for the reply Quote Link to comment Share on other sites More sharing options...
Noel Posted September 13, 2018 Share Posted September 13, 2018 @o0Corps0o Glad to hear that! ? Quote Link to comment Share on other sites More sharing options...
BerMon Posted April 2, 2019 Share Posted April 2, 2019 We already know that facebook has a documentation for this, but it's basic not for all the supported engines like Phazer, Construct 2&3 or GameMaker Studio, we have to search and ask about this or write it by your self, we wait for this also for construct 2 we have the same problem in the games, the ads appears just 1 time in the launch of the game, a big problem ? Quote Link to comment Share on other sites More sharing options...
Noel Posted April 3, 2019 Share Posted April 3, 2019 @BerMon Why don't you request those features to the game engine creators then? They are the ones who know and control their engine the best. The only alternative is to make the changes by yourself. For most engines you will find tutorials made by developers who managed to do it. BerMon 1 Quote Link to comment Share on other sites More sharing options...
edward110 Posted April 5, 2019 Share Posted April 5, 2019 hello guys, Im new here, and i get the code for both, inters and rewards :but it s not working i don t know why ? and i did a showrewards and inter in my init.js file but nothing's happening . Any ideas, FYI : my Audience network mark it s not green i don t know why maybe is it the problème ?? //*=================================================*// //*-------------------------------------------------*// //*----------------- Facebook ----------------------*// //*--------------- Instant Game --------------------*// //*--------------- AdsController -------------------*// const INTERSTITIAL_PLACEMENT_ID = 'xx'; //*-------- Interstitial -------*// const REWARDED_PLACEMENT_ID = 'xx'; //*-------- Rewarded Video -----*// // LoadRewarded(); // LoadInter(); // ShowRewarded(); // ShowInter(); var preloadedRewardedVideo; var preloadedInterstitial; //*=================================================*// //*-------- Interstitial ADS By edward -------*// //*=================================================*// //*-------- Load Interstitial --------*// function LoadInter() { var supportedAPIs = FBInstant.getSupportedAPIs(); if (supportedAPIs.includes('getInterstitialAdAsync')){ preloadedInterstitial = null; FBInstant.getInterstitialAdAsync( INTERSTITIAL_PLACEMENT_ID, ).then(function(interstitial) { preloadedInterstitial = interstitial; return preloadedInterstitial.loadAsync(); }).then(function() { console.log('Interstitial preloaded') }).catch(function(err){ console.error('Interstitial failed to preload: ' + err.message); }); } else { displayError('Ads not supported in this session'); } } //*-------- Show Interstitial --------*// function ShowInter() { preloadedInterstitial.showAsync() .then(function () { console.log('Interstitial ad finished successfully'); }) .catch(function (e) { console.error(e.message); }); } //*=================================================*// //*-------- Rewarded Video ADS By edward-----*// //*=================================================*// //*-------- Load Rewarded --------*// function LoadRewarded() { var supportedAPIs = FBInstant.getSupportedAPIs(); if (supportedAPIs.includes('getRewardedVideoAsync')){ preloadedRewardedVideo = null; FBInstant.getRewardedVideoAsync( REWARDED_PLACEMENT_ID ).then(function(rewarded) { preloadedRewardedVideo = rewarded; return preloadedRewardedVideo.loadAsync(); }).then(function() { console.log('Rewarded Video preloaded') }).catch(function(err){ console.error('Rewarded Video failed to preload: ' + err.message); }); } else { displayError('Ads not supported in this session'); } } //*-------- Show Rewarded --------*// function ShowRewarded() { preloadedRewardedVideo.showAsync() .then(function () { console.log('Rewarded Video ad finished successfully'); }) .catch(function (e) { console.error(e.message); }); } //*=================================================*// //*-------------------------------------------------*// //*----------------- Facebook ----------------------*// //*--------------- Instant Game --------------------*// //*--------------- AdsController -------------------*// //*-------------- edward------------------*// //*-------------------------------------------------*// //*=================================================*// Quote Link to comment Share on other sites More sharing options...
MassimoFellucci Posted April 24, 2020 Share Posted April 24, 2020 Hi did you find the answer? Quote Link to comment Share on other sites More sharing options...
Noel Posted April 27, 2020 Share Posted April 27, 2020 @MassimoFellucci Do you have the same issue? Are you using the latest version of Phaser and the Instant Games plugin? Also, you might want to ask your question on this group: https://www.facebook.com/groups/instantgamedevelopers/ The community is quite responsive. Perrycat 1 Quote Link to comment Share on other sites More sharing options...
MassimoFellucci Posted April 28, 2020 Share Posted April 28, 2020 23 hours ago, Noel said: @MassimoFellucci Do you have the same issue? Are you using the latest version of Phaser and the Instant Games plugin? Also, you might want to ask your question on this group: https://www.facebook.com/groups/instantgamedevelopers/ The community is quite responsive. Thank you for your response. I actually posted a similar post on Instant Game Developer Community and they said, In order to show Ads, my game have to reach a threshold in DAU. I hope this answer helps others. Noel 1 Quote Link to comment Share on other sites More sharing options...
Perrycat Posted June 13, 2020 Share Posted June 13, 2020 On 4/27/2020 at 4:37 PM, Noel said: @MassimoFellucci Do you have the same issue? Are you using the latest version of Phaser and the Instant Games plugin? Also, you might want to ask your question on this group: https://www.facebook.com/groups/instantgamedevelopers/ The community is quite responsive. Thanks for sharing! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.