I implemented Ionic Native's Admob Free.
https://ionicframework.com/docs/native/admob-free/
Then, ads are always fixed at the bottom.
Is it impossible to display this in any position?
Can I do with Admob Pro?
If you know something, please let me know.
As you can see in the AdMob Free plugin documentation, you can place the ad at top or bottom.
To place it on top you have to set bannerAtTop as true in the config.
const bannerConfig: AdMobFreeBannerConfig = {
...
bannerAtTop: true,
};
this.admobFree.banner.config(bannerConfig);
But, in the AdMob Pro, you can set the x,y coordinates position in pixels using showBannerAtXY() method. Here is the documentation.
Related
I'm making a react-native based app, and I can partially use Swift code by react-native's NativeModule feature.
My app will be used as Split view / Slide over mode in iPad, and I want to know if my app is in the left-side, right-side, or Slide-over.
I could get width and height, also origin (CGPoint) by this code.
let window = UIApplication.shared.windows.first
// Then getting X, Y like this...
window.frame.origin.x
Now my app has only one webview, made by react-native-webview.
So I guess, since the webview is the whole content of the app, and it fills app 100%, so it always returns app.
I want to know, not in webView's perspective, but in app's perpective, the POSITION relative to the screen.
For example, if my iPad width is 1400, and if my app is on the half right side, x should be 700.
And if it is on left side, it should be 0.
I really struggled this, but couldn't find any solution.
FYI, I drawed a diagram for this question.
As I wrote on the above, I tried UIApplication.shared.windows.first.frame.
But it only show the CGPoint of webview, not app relative to the screen.
There is no API for getting 'X' or 'LEFT' in react-native-dimension too.
onLayout also not helpful.
Good afternoon, who once worked with heremap sdk premium for ios. How do I make it possible to click on the NMAMapMarker? What they have written in the documentation does not describe it, but maybe I'm wrong.
there are different option available for NMAMapMarker to use.
This represents a marker used to display an icon on a geographical position on a map. The map handles proper placement of icons on the screen as well as panning and rotation.
+mapMarkerWithGeoCoordinates:
+mapMarkerWithGeoCoordinates:icon:
+mapMarkerWithGeoCoordinates:image:
coordinates
icon
draggable
draggingOffsetEnabled
anchorOffset
-initWithGeoCoordinates:
-initWithGeoCoordinates:icon:
-initWithGeoCoordinates:image:
-setAnchorOffsetUsingLayoutPosition:
-setSize:forZoomLevel:
-setSize:forZoomRange:
-resetIconSize
Check for more details : https://developer.here.com/documentation/ios-premium/3.18/api_reference_jazzy/Classes/NMAMapMarker.html#%2Fc:objc(cs)NMAMapMarker(im)initWithGeoCoordinates.
Please revert with your code implementation in case of any further concern.
This is not a duplicate..
In the new Admob SDK (Google-Mobile-Ads-SDK 7.31.0) when you show a test ad it shows you a REAL ad(!) and it adds an annotation with the words "Test Ad"
But sometimes, when you really needs an ad to show (for testing purposes) - you get Error code 1 "Request Error: No ad to show."
It IS a test ad. I can see the words "Test Ad" when the test shows! (when it was showed, now nothing shows =[)
SO, my question is:
Does someone knows a workaround?
Now I know the answer... It's a bug in the SDK. =[
see here
The easiest way to load test ads is to use our dedicated test ad unit
ID for iOS banners: ca-app-pub-3940256099942544/2934735716
It's been specially configured to return test ads for every request,
and you're free to use it in your own apps while coding, testing, and
debugging. Just make sure you replace it with your own ad unit ID
before publishing your app.
EDIT: I've found and solved the REAL issue.
When you create an ad, you have two options:
Add it to view hierarchy AFTER it loads an ad ---> works always
Add it to view hierarchy BEFORE it loads an ad ---> BE CAREFUL WITH THIS ONE
If you choose the second approach you have to set the frame of the ad view to a visible size (width + height) and you must ensure that isHidden = false
My problem was that I wanted to animate the showing of the ad. I added the banner to UIStackView and set its isHidden to true.
I used the delegate so when ad was loaded I animated the isHidden to false. All looks good, but apparently the Google Mobile Ads SDK validates that the ad is visible before it loads an ad --- my ad view was NOT visible! so I got the Request Error: No ad to show
Thanks Google for "great" documentation =[
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).
Hi friends now i am developing Ads for Ipad,I am Using Admob.i have a small problem.
in admob documentation itself adsize in portrait view is 728x90.i want to change adsize to 768x90 to fit exactly in screen.i have changed frame by calling setFrtame for AdBannerView but it cant changes the size
*is it possible to change add size...? and at the same time i nee to show add in landscape with size 1024x90 *
Here is My Code
[AdmobBanner setFrame:CGRectMake(0,0,768,90)]; //Portrait
[AdmobBanner setFrame:CGRectMake(0,0,1024,90)]; //Landscape
Can any one help me to find the solution For this
AdMob currently supports only few ad dimensions. There is no way how to set your own size. Best thing to do would be to insert your ad into some kind of visual container with proper dimensions and fill rest of the screen with appropriate graphics