[RoboVM] Bindings!!! IAP, Ads, Analytics, Social

Anything libgdx related goes here!

[RoboVM] Bindings!!! IAP, Ads, Analytics, Social

Postby HD_92 » Thu Oct 10, 2013 10:16 pm

Bindings for RoboVM: https://github.com/BlueRiverInteractive ... s-bindings

Supported bindings:
Advertising/Monetization
+ AdColony (Awesome Video Ad solution! Thanks to YaW)
+ MoPub (All-in-one advertising solution. Allows to use iAd, AdMob, InMobi, MillennialMedia, Chartboost, RevMob and other interstitial and banner ads)
+ Vungle (Superb Video Ad solution. Earn money for video watching and award in-game currency to your users without the need of any server)
+ In-App Purchases (Simple to use InAppPurchaseManager. Query products, purchase products and restore transactions within one manager class)
Analytics
+ Crashlytics (Crash reporting)
+ Flurry (Great analytics, event logging and crash reporting system)
+ Google Analytics (Credits go to EMadGamer!)
Social
+ Facebook (Simple to use FacebookManager. Thanks to Michingo for his help finalizing this binding!)
+ Google Play Game Services (Credits go to Michingo!)

Usage:
+ Add the binding project to your workspace and reference it from your project.
+ Search the robovm.xml file and copy the necessary references and frameworks to your project's robovm.xml.
+ That's it!

Just take a look at the Sample.java class to see basic usage. All bindings have full JavaDocs, so it should be really easy to use!

I hope this is useful for some RoboVM adventurers!

Cheers,
HD_92
Last edited by HD_92 on Thu Jun 19, 2014 12:30 pm, edited 18 times in total.
HD_92
 
Posts: 453
Joined: Sun Jan 06, 2013 4:43 pm

Re: [RoboVM] Bindings!!!

Postby Trasc0 » Fri Oct 11, 2013 7:05 am

Thanks for the bindings!
Image
Trasc0
 
Posts: 86
Joined: Fri Feb 01, 2013 10:47 am
Location: Hyrule

Re: [RoboVM] Bindings!!!

Postby joaoneto » Fri Oct 11, 2013 11:25 am

Man, that's awesome! Thanks!
joaoneto
 
Posts: 371
Joined: Sat Oct 01, 2011 11:26 am

Re: [RoboVM] Bindings!!!

Postby HD_92 » Fri Oct 11, 2013 1:35 pm

Just added the super easy InAppPurchaseManager class with StoreKit bindings (thanks to Aleksandr Peshcherskikh) to the bindings repo.

Check the sample class to see basic usage!!
HD_92
 
Posts: 453
Joined: Sun Jan 06, 2013 4:43 pm

Re: [RoboVM] Bindings!!!

Postby pranav008 » Fri Oct 11, 2013 1:38 pm

I am trying to implement mopub adds on Simulator using robovm but getting some error
Most of the times is giving

MOPUB: Ad view is fetching ad network type: clear
2013-10-11 19:00:55.728 MyGdxGame[4777:c07] MOPUB: Ad server response indicated no ad available.
2013-10-11 19:00:55.729 MyGdxGame[4777:c07] MOPUB: Interstitial controller is loading ad with MoPub server URL: http://ads.mopub.com/m/ad?v=8&udid=ifa: ... t=2&av=1.0

this is bcoz no adds is available(correct me if i am wrong) . But after running again and again i got warning regarding window (i got this only once so couldnt save the log)

Here is how i implemented it

Code: Select all
@Override
   public boolean didFinishLaunching(UIApplication application, NSDictionary launchOptions) {
      boolean b=super.didFinishLaunching(application,launchOptions);
      System.out.println(" did finish launching ");
      MPInterstitialAdController interstitial = MPInterstitialAdController.getAdController("9800bf6141bf4c79a2663949153db348");
      MPInterstitialAdControllerDelegate delegate = new MPInterstitialAdControllerDelegate.Adapter() {
         @Override
         public void didExpire(MPInterstitialAdController interstitial) {
            // If the ad did expire, load a new ad.
            interstitial.loadAd();
         }

         @Override
         public void didLoadAd(MPInterstitialAdController interstitial) {
            // If the ad is ready, show it.
            if (interstitial.isReady())
               interstitial.show(mainViewController);
         }

         @Override
         public void didFailToLoadAd(MPInterstitialAdController interstitial) {
            // If the ad did fail to load, load a new ad. Check the debug log to see why it didn't load.
            interstitial.loadAd();
            System.out.println("failed to load");
         }
      };

      interstitial.setDelegate(delegate);
      interstitial.loadAd();
//      interstitial.setTesting(true);
      
      mainViewController = new UIViewController();
      UIWindow window = new UIWindow(UIScreen.getMainScreen().getBounds());
      window.setRootViewController(mainViewController);
      window.makeKeyAndVisible();
                return b;}
             

.a files have been updated in libs/ios and .xml has also been updated.

wot m i missing here???


Edit : I also tried to implement banner adds but nothing is shown .
Here is my implementation
Code: Select all
@Override
   public boolean didFinishLaunching(UIApplication application, NSDictionary launchOptions) {
      boolean b=super.didFinishLaunching(application,launchOptions);
      MPAdView adview =new MPAdView("2a7f7fbbbaba4792bcfd3a2b6f223de8", MPConstants.MOPUB_BANNER_SIZE);
      adview.setTesting(false);
      adview.setFrame(new CGRect(0,0,
            MPConstants. MOPUB_BANNER_SIZE.width(), MPConstants.MOPUB_BANNER_SIZE.height()));

      adview.loadAd();
      return b;
   }
Last edited by pranav008 on Fri Oct 11, 2013 1:47 pm, edited 1 time in total.
pranav008
 
Posts: 69
Joined: Fri Feb 08, 2013 6:23 am

Re: [RoboVM] Bindings!!!

Postby HD_92 » Fri Oct 11, 2013 1:46 pm

I assume you are using this in conjunction with libgdx?

Then you will get a warning because you can only have one UIWindow at a time and libgdx already uses one. To workaround this problem add the UIViewController's view to the active UIWindow, like:

Code: Select all
interstitialViewController = new UIViewController();
UIView interstitialView = new UIView(UIScreen.getMainScreen().getBounds());
interstitialView.setUserInteractionEnabled(false); // This is important, otherwise you won't get any touch input in your game.
interstitialViewController.setView(interstitialView);
application.getKeyWindow().addSubview(interstitialViewController.getView());


I should probably add a note to it on the repo.

Please tell me if this solves your problem.

[EDIT] Regarding banners. I haven't tested them so far but I assume you have to add them to the UIViewController.
Try this:
Code: Select all
UIViewController gdxViewController = ((IOSApplication) Gdx.app).getUIViewController();
gdxViewController.getView().addSubview(adView);
HD_92
 
Posts: 453
Joined: Sun Jan 06, 2013 4:43 pm

Re: [RoboVM] Bindings!!!

Postby pranav008 » Fri Oct 11, 2013 2:07 pm

I have been trying to test interstitial adds but no adds request found is coming . Will keep on trying till something else come.

As far as banner adds is concerned , i tried that code and got this error

2013-10-11 19:31:44.899 MyGdxGame[4999:c07] MOPUB: Banner view (2a7f7fbbbaba4792bcfd3a2b6f223de8) loading ad with MoPub server URL: http://testing.ads.mopub.com/m/ad?v=8&u ... t=2&av=1.0
2013-10-11 19:31:45.511 MyGdxGame[4999:c07] MOPUB: Banner view (2a7f7fbbbaba4792bcfd3a2b6f223de8) failed. Error: Error Domain=com.mopub.iossdk Code=0 "The operation couldn’t be completed. (com.mopub.iossdk error 0.)"

Here is code for banner adds
Code: Select all
MPAdView adview =new MPAdView("2a7f7fbbbaba4792bcfd3a2b6f223de8", MPConstants.MOPUB_BANNER_SIZE);
      adview.setTesting(true);
      adview.setFrame(new CGRect(0,0,
            MPConstants. MOPUB_BANNER_SIZE.width(), MPConstants.MOPUB_BANNER_SIZE.height()));
UIViewController gdxViewController = ((IOSApplication) Gdx.app).getUIViewController();
      gdxViewController.getView().addSubview(adview);
      adview.loadAd();


Also is there any way to test the app without getting no add request found for interstital adds??? I know its silly but is there way or shuld i keep on trying to run it again and agian??
pranav008
 
Posts: 69
Joined: Fri Feb 08, 2013 6:23 am

Re: [RoboVM] Bindings!!!

Postby HD_92 » Fri Oct 11, 2013 2:14 pm

I'll have to take a look at MPAdView, maybe there's some problem with the binding.

I also never got any mopub testing interstitials. I think you will have to add some native ad network, like Chartboost, to see ads (http://help.mopub.com/customer/portal/a ... work-setup #2).
HD_92
 
Posts: 453
Joined: Sun Jan 06, 2013 4:43 pm

Re: [RoboVM] Bindings!!!

Postby pranav008 » Fri Oct 11, 2013 2:29 pm

I want to confirm 2 things here

1) i just need to add mopub.a file from the binding project and add mopub project from binding to robovm project??? Ofcourse update xml for mopub.a file.. After this i dont need to add any other sdk or jar to my project for adds?

2) adds can run on simulator ?? as i am running it on simulator
pranav008
 
Posts: 69
Joined: Fri Feb 08, 2013 6:23 am

Re: [RoboVM] Bindings!!!

Postby HD_92 » Fri Oct 11, 2013 2:41 pm

1. Yep that's all. If you have set up some ad networks for your app at the MoPub website you should get interstitials.
You will also have an account at the various ad networks and setup everything correctly.

2. Ads can run on simulator (at least from some of the ad networks)
HD_92
 
Posts: 453
Joined: Sun Jan 06, 2013 4:43 pm

Next

Return to Libgdx

Who is online

Users browsing this forum: No registered users and 1 guest

cron