This article shows how to add admob banner in your libgdx game through robovm.
https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx
It actually did.But when I open my game,admob banner will appear at the top of the view and can't be removed.That is a problem because I plan to use IAP to remove ad in my game.I have tried a lot of functions and they could not solve the problem.
the functions include:
adview.setFrame(new CGRect(0, -bannerHeight, bannerWidth, bannerHeight));
adview.close();
adview.release();
adview.dispose();
adview.removeFromSuperview();
I have no idea now.can you help me?
Thanks you in advance.
adView.pause(); will pause serving of ads.
adView.setVisible(View.GONE); will hide the AdView.
layout.removeView(adView); will remove the AdView from your layout.
I solved this by calling:
adview.removeFromSuperview();
In case you need to add it back, just call:
iosApplication.getUIViewController().getView().addSubview(adview);
again (I do this because I hide the banner during the game and just show it on the WorldMap).
Related
i'm trying to reuse this AdMobViewController class
i applied this like described in implementation sample and looks it works ok, but my view moves up and it's header under the actionbar now.
could you please advice how to move it back?
btw: i haven't experience with admob - does test device key only allows to test device on phone when app installed throw xcode, and won't be used when user download it from market?so user will see real ads?
found that method viewDidLayoutSubviews in provided class calculate size but don't takes into account bar heig
I haven't worked with iAd ads and this is the first time i am going to implement them. Went though googling a lot of tutorials but they most of them are so old and done programmatically. What i want is to learn how to add them in the StoryBoard.
I can see the ad banner view in my StoryBoard. Although when i add the "Ad BannerView" by dragging it in my view controller and run it, it just crash saying uncaught exception. What else i need to do other than just dragging it in the StoryBoard, in order for it to work?
I think the best way to achieve this is to take a look at apple sample code. The iAd suite has many different approaches and one of the is integrating the iAd with story board. Here is the link to the sample code: https://developer.apple.com/LIBRARY/IOS/samplecode/iAdSuite/Introduction/Intro.html
Also here is the link to the iAd class reference for further study. https://developer.apple.com/library/ios/documentation/userexperience/Reference/iAd_ReferenceCollection/_index.html
I hope that clears the way for you to solve this issue.
You can just put this into -viewDidLoad:
ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
[self.view addSubview:adView];
Don't forget to import the iAd Framework. If I was you I should use Google's AdMob.
This is a good link.
I'm new to implementing ads to my app, how would i go about building a banner ad right into one of the view controllers on my app?
Use:
[[RevMobAds session]showBanner];
Do not forget to import the framework:
#import <RevMobAds/RevMobAds.h>
You could also found the answer here: http://sdk.revmobmobileadnetwork.com/ios.html#banner
This link gives the code AND a video to show you how. What more do you need?
Perhaps I'm missing something obvious but for some reason my Autolayout view doesn't react to rotation of the phone. It works in different sample project I created but I don't seem to be able how and where it's enabled.
Could you please suggest what it can be ? I posted problematic XIB here: http://pastebin.com/Sb6ch6Ln
Ah, it's set in app's plist in parameter UISupportedInterfaceOrientations. Sorry for false alarm guys!
I'm just started working in Titanium. And now working on popover in titanium, using the following code.
var myPopover = Ti.UI.iPad.createPopover({ height: 150, width: 150 });
popover.add(view);
popover.show({ view: button });
My issue is when user touches outside of the popover the popover is dismissing (default behaviour), I don't want that.
In iOS there is a delegate method called: - (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController . If we don't want to dismiss the popover when user touches outside just return NO, is there any way to do this in Titanium ?
I read the Titanium.UI.iPad.Popover documentataion, but couldn't find any such methods.
Please help me.
Thanks in advance.
Unfortunately without significant work yourself you won't be able to in the short-term.
Some tips:
Don't trust the api docs to have everything in. Instead either look through the SDK in Github or find the SDK on your system and search through the iOS (in the iPhone folder) classes for this method.
If you go to appcelerator's JIRA account, you can request this to be implemented. Go to the Q&A and make some noise about it to get other people to watch the JIRA issue so it is prioritised by Appcelerator.
You could write a module that extends the popover functionality, in fact with modules you can extend anything and create the javascript bridge yourself so you can access any properties or anything you want. There's guides for that on the Wiki..
Happy hunting ;)