Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Rayden

Junior Member
Registered:
Posts: 7
Reply with quote  #1 
Hey everybody,

I'm trying to check the chartboost event didFinishInterstitialEvent from prime31. If I have an interstitial right before I'm closing the game, how do you check if the user fired that event?

Thanks

__________________
https://play.google.com/store/apps/developer?id=3dgalaxymap.com
0
NKY-Games

Avatar / Picture

Registered:
Posts: 208
Reply with quote  #2 
I dont have much experience with Prime 31's plugin, but I'm pretty sure if you download the new chartboost plugin it would be this line in the chartBoostExample script.
I realise it may be completely different for Prime, so Im sorry if this is not of any use to you.


Quote:
void didCloseInterstitial(CBLocation location) {
Debug.Log("didCloseInterstitial: " + location);
}


That function calls this line from the ChartBoost script:

Quote:
private void didCloseInterstitialEvent(string location) {
if (didCloseInterstitial != null)
didCloseInterstitial(CBLocation.locationFromName(location));
}

__________________
Come visit me at @ http://www.nkygames.com
0
Rayden

Junior Member
Registered:
Posts: 7
Reply with quote  #3 
I tried adding the Chartboost SDK (having Prime31 Admob already installed) and I'm getting some errors from unity. Apparently you can't have multiple files in your assets folder such as two AndroidManifest files or two xxx.jar files, even if you have them in different folders.

Does the Chartboost SDK (not prime31) need the entire google-play-services_lib folder imported?

The prime31 has these events like 

public static event Action<string> didFinishInterstitialEvent;

public void didFinishInterstitial( string param )
{
if( didFinishInterstitialEvent != null )
didFinishInterstitialEvent( param );
}
 

And i have no idea how to check if they fired - there's nothing in their examples.

Thanks

__________________
https://play.google.com/store/apps/developer?id=3dgalaxymap.com
0
NKY-Games

Avatar / Picture

Registered:
Posts: 208
Reply with quote  #4 
Quote:
Originally Posted by Rayden
Apparently you can't have multiple files in your assets folder such as two AndroidManifest files or two xxx.jar files, even if you have them in different folders.


You can have multiple manifests, but they would have to be named differently or in different folders. But not the same jar file. Although you may only have 1 file called AndroidManifest 

Quote:
Does the Chartboost SDK (not prime31) need the entire google-play-services_lib folder imported?


Yep, thats right, and the CB plugin comes with one, but then again so does prime. Do you not have the official prime chartboost plugin?

Good luck[wink]

__________________
Come visit me at @ http://www.nkygames.com
0
Rayden

Junior Member
Registered:
Posts: 7
Reply with quote  #5 
Quote:
Yep, thats right, and the CB plugin comes with one, but then again so does prime. Do you not have the official prime chartboost plugin?


Yes, I tried two things:
1. prime31 chartboost + prime31 admob - it works but I have no idea how to check the didFinishInterstitial event in an if statement.
2. official chartboost + prime31 admob - getting those errors about multiple files with the same name in Unity when trying to build the apk. Official chartboost has and androidmanifest file, prime31 has one as well and I don't know if changing the file name for any of these two is a good idea.

I haven't really looked at number 2 in depth - I will give it a few more shots, because this prime31 support is really bad.

__________________
https://play.google.com/store/apps/developer?id=3dgalaxymap.com
0
NKY-Games

Avatar / Picture

Registered:
Posts: 208
Reply with quote  #6 
Depending on the functionality you are trying to achieve, could you not just set it up with some booleans, or timers┬┐
__________________
Come visit me at @ http://www.nkygames.com
0
neilb

Junior Member
Registered:
Posts: 20
Reply with quote  #7 
@Rayden

1) You will have added a static handler class provided by Prime31 to a gameobject in your scene - I don't know what it's called, sorry. This class is used to catch events from the plugin. You need to assign a handler to whatever the didFinishInterstitialEvent event is in this class. It's probably going to look something like this:
public class YourClass {
  void Start() {
    Prime31StaticHandlerClass.didFinishInterstitialEvent += YourInterstitialClosedEvent;
  } 

  public void YourInterstitialClosedEvent(string location) {
    Application.Quit();
  }
}

2) For this method to work, you'd need to merge the chartboost manifest requirements into Prime31's manifest. However, the last time I looked, Prime31 have their own derived version of the UnityPlayerActivity which can make it really hard to get their plugins to work with anything that they didn't create. Even if you do merge the manifest correctly, it still might not work.
0
Rayden

Junior Member
Registered:
Posts: 7
Reply with quote  #8 
Thanks Neil, I will try it out.
__________________
https://play.google.com/store/apps/developer?id=3dgalaxymap.com
0
Roman

Avatar / Picture

Senior Member
Registered:
Posts: 304
Reply with quote  #9 
move ChartboostEventListener.cs to your scene into some new gameobject that you make. Then open that script...

Find

void didFinishInterstitialEvent( string location, string reason )
{
Debug.Log( "didFinishInterstitialEvent. Location: " + location + ", reason: " + reason );
}

and change it to

void didFinishInterstitialEvent( string location, string reason )
{
Application.Quit();
Debug.Log( "didFinishInterstitialEvent. Location: " + location + ", reason: " + reason );
}

This will close your app every time you close interstitial or click on it. You can use this is your menu scene for exit button. I hope that helps.

__________________
http://wasted-droid.com
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.