playMaker

Author Topic: Linking an Ad Network with Playmaker (Play Haven, Revmob)  (Read 3208 times)

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Linking an Ad Network with Playmaker (Play Haven, Revmob)
« on: June 07, 2013, 08:34:00 AM »
Hi,
im just trying to implement a Monetization Network into my game and connect it to my Playmaker FSM. In the moment im trying "Revmob" and "Play Haven". I struggle at the communication between Playmaker and the Network scripts.

For Playhaven:
i try to implement the "More Games" feature. therefore i should:
Quote
With only the PlayHaven Manager in your scene you can invoke
the “More Games” feature in your gameʼs GUI by calling the
PlayHavenManager.instance.ShowCrossPromotionWidget()
method.

I try to do so by using the "create object" and "invoke method" action (see screenshot)
But i get the following error:  InvokeMethod: PlayHavenManager missing behaviour: PlayHaven.PlayHavenManager


That is strange because why i am  able to select the behaviour in the action when it is later missing?


For Revmob:
Quote
Fullscreen is a ad unit with a high eCPM. You can show it in the beginning or in the end of a round, for example.

    To show a Fullscreen ad in your application, you can simply call the showFullscreen method:

public class GameObject : MonoBehaviour {
    void Start() {
        revmob.ShowFullscreen();
    }
}

I have no clue how i can call this from Playmaker. "Invoke Method" dont find
revmob.ShowFullscreen(); as an option...


So if someone could point me in the right direction, its highly appreciated!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linking an Ad Network with Playmaker (Play Haven, Revmob)
« Reply #1 on: June 07, 2013, 09:11:59 AM »
Hi,

 you can't call invoke here, because it the method is part of a singleton.

 you will have to implement a custom action for this.

create a new script and copy paste the content of the action "application Quit",

-- rename the class properly, refactor the tooltips and replace the line

Code: [Select]
Application.Quit();
with

Code: [Select]
PlayHavenManager.instance.ShowCrossPromotionWidget()
if you have trouble doing this, let me know, I'll do the custom action for you.


Same with revmob, you would do a special action for it and put that line the same way.

bye,

 Jean

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: Linking an Ad Network with Playmaker (Play Haven, Revmob)
« Reply #2 on: June 07, 2013, 02:10:25 PM »
Hi Jean,
thanks for your support.

Im sorry but i dont get it to work.

For Play Haven i used this code:
Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.ScriptControl)]
[Tooltip("Call the More Games feature of the Play Haven plugin")]
public class CallPlayhavenGames : FsmStateAction
{
public override void Reset()
{
}

public override void OnEnter()
{
PlayHavenManager.instance.ShowCrossPromotionWidget();
Finish();
}

}
}

and get this error:
Assets/PlayMaker/Actions/CallPlayhavenGames.cs(15,17): error CS0103: The name `PlayHavenManager' does not exist in the current context

so i understand that i have to define the Gameobject: PlayHavenManager in the action. But there i fail integrating a Gameobject var...

Not to speak about Revmob...

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: Linking an Ad Network with Playmaker (Play Haven, Revmob)
« Reply #3 on: June 08, 2013, 05:24:27 AM »
For Play Haven i think i solved it:

I just have to use "send message" action with: "ShowCrossPromotionWidget" sended to the PlayHavenManager GO.

Now i get an dummy ad displayed.


An example for Revmob is still appreciated  :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linking an Ad Network with Playmaker (Play Haven, Revmob)
« Reply #4 on: June 10, 2013, 01:17:24 AM »
Hi,

 I don't own RevMob, so this is just following their docs:
http://sdk.revmob.com/unity

 you would have something like this for example:

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("RevMob)]
[Tooltip("Display a banner using  RevMob plugin")]
public class DisplayRevMobBanner : FsmStateAction
{


public override void OnEnter()
{

#if (UNITY_IPHONE && !UNITY_EDITOR)
                RevMobIOSBAnner banner = revmob.CreateBanner();
                banner.Show();
               #endif

Finish();
}

}
}

bye,

 Jean

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: Linking an Ad Network with Playmaker (Play Haven, Revmob)
« Reply #5 on: June 12, 2013, 11:21:10 AM »
Thanks Jean,
i will try your code!