[jpPlugins] Plugins by JPierron

The new ShiVa Asset Store. A forum for product inquiries, reviews, comments and critique.

Re: [jpPlugins] Plugins by JPierron

Postby Develophel » 2015-11-19 13:02

I think I've the same problem as vsipola with chartboost, all the ads works perfectly but the event handlers never get fired.
I've referenced jpEventqueue and tested it by calling
Code: Select all
jpEventQueue.push("ChartboostAI", "onChartboostDidCacheInPlay", new jpAIVariableWrapper("Test"));

And the handler get fired.

Here's a step by step of what I did:
  1. Added jpChartboost and jpEventQueue plugins to the game.
  2. Created a user level AI "ChartboostAI" to wire it into.
  3. Added all listed "onChartboostDid_xxx" handlers to ChartboostAI.
  4. Added inside ChartboostAI.onInit:
    jpChartboost.activate
    jpChartboost.startSession
  5. Called jpChartboost.cacheInterstitial (jpChartboost.kLocationLevelStart )
  6. Later on called
    jpChartboost.showInterstitial ( jpChartboost.kLocationLevelStart )
    The ads get showed correctly and so I guess that the relative handler "onChartboostDidDisplayInterstitial" should get fired, but that never happens.
    I've tried the same with the reward video, the video work flawlessly but "onChartboostDidCompleteRewardedVideo" never get called.

Any idea?
Could it be perhaps because the game isn't published but only in beta?

The code of ChartboostAI:
Code: Select all
function ChartboostAI.onInit (  )
--------------------------------------------------------------------------------
    -- In Game Ads
    jpChartboost.activate ( "yaddayadda", "yaddayadda" )
    jpChartboost.startSession ( "yaddayadda", "yaddayadda" )
--------------------------------------------------------------------------------
end

Code: Select all
function ChartboostAI.onAction ( sAction )
--------------------------------------------------------------------------------
   
    local hUser = this.getUser ( )
    if ( this.bAds ( ) == true ) then
        if ( sAction == "Activate" ) then
            -- Check if player should have adds or not
            local xmlPlayer = xml.getRootElement ( user.getAIVariable ( hUser, "MenuAI", "xmlVars" ))
            xmlPlayer = xml.getElementFirstChildWithName ( xmlPlayer, "Shop" )
            if xmlPlayer then
                xmlPlayer = xml.getElementFirstChildWithName ( xmlPlayer, "NoAds" )
            end
            if ( xmlPlayer ) then
                this.bAds ( false )
            else
                log.message ( "Log: Caching ads" )
                jpChartboost.cacheRewardedVideo ( jpChartboost.kLocationItemStore )
                jpChartboost.cacheInterstitial ( jpChartboost.kLocationLevelStart )
            end
        elseif ( sAction == "LevelStart" ) then
            jpChartboost.showInterstitial ( jpChartboost.kLocationLevelStart )
            jpChartboost.cacheInterstitial ( jpChartboost.kLocationLevelStart )
        elseif ( sAction == "ShowRewardedVideo" ) then
            log.message ( "Log: Showing ads" )
            jpChartboost.showRewardedVideo ( jpChartboost.kLocationItemStore )
            jpChartboost.cacheRewardedVideo ( jpChartboost.kLocationItemStore )       
        end   
    end
   
--------------------------------------------------------------------------------
end

Code: Select all
function ChartboostAI.onChartboostDidCompleteRewardedVideo ( kLocation )
--------------------------------------------------------------------------------
   
    local hUser = this.getUser ( )
    -- Increase user money by 50k
    --user.sendEventImmediate ( application.getCurrentUser ( ), "Comp2dAI", "onDebugAddMsg", "Reward worked!" )
   log.message ( "Reward worked!" )
    local xmlPlayer = xml.getRootElement ( user.getAIVariable ( hUser, "MenuAI", "xmlVars" ) )
    xmlPlayer = xml.getElementFirstChildWithName ( xmlPlayer, "Balance" )
    local nBalance = string.toNumber ( xml.getElementValue ( xmlPlayer ) )
    xml.setElementValue ( xmlPlayer, ""..(nBalance+50000) )
    user.sendEventImmediate ( hUser, "MenuAI", "onXmlSave", "Vars" )
--------------------------------------------------------------------------------
end
Develophel
Junior Boarder
Junior Boarder
 
Posts: 39
Joined: 2014-03-13 01:12

Re: [jpPlugins] Plugins by JPierron

Postby jpierron » 2015-11-19 16:25

Thank you for your help, it was a bug of jpChartboost.
I've uploaded a new version with the events fixed :
jpChartboost v2.3

Thanks again.
User avatar
jpierron
Gold Boarder
Gold Boarder
 
Posts: 192
Joined: 2013-05-13 09:56
Location: France

Re: [jpPlugins] Plugins by JPierron

Postby Develophel » 2015-11-20 09:18

You're welcome ;)
Develophel
Junior Boarder
Junior Boarder
 
Posts: 39
Joined: 2014-03-13 01:12

Re: [jpPlugins] Plugins by JPierron

Postby jpierron » 2017-03-28 10:32

My first tvOS (and also iOS) plugin is out : jpCloudEnvironment.
Image

It helps you store environment variables in iCloud, allowing you to share variables across the user devices, including Apple TV, iPhone and iPad devices.

Its API is very close to the ShiVa environment system, so you may not be lost ;)
User avatar
jpierron
Gold Boarder
Gold Boarder
 
Posts: 192
Joined: 2013-05-13 09:56
Location: France

Re: [jpPlugins] Plugins by JPierron

Postby broozar » 2017-04-01 09:05

great! the plugin is now also available on the ShiVa Store: http://www.shiva3dstore.com/jpcloudenvironment
User avatar
broozar
Administrator
Administrator
 
Posts: 4079
Joined: 2007-09-16 10:22
Location: Berlin - Germany

Previous

Return to Asset Store

Who is online

Users browsing this forum: No registered users and 1 guest

cron