SDKBOX AdMob for iPhone X

SDKBOX AdMob for iPhone X
0.0 0

#1

The current version of the AdMob plugin for SDKBOX only allows you to specify anchors for the ad. (Bottom, top, center, etc.)

With the new iPhone X, this will no longer do, as the banner will be underneath the home bar. iPhone X has a ‘safe area’ as well as an ‘unsafe’ area that you need to design for properly.

Will SDKBOX support better ad placement for iPhone X? (So that the banner is only placed in the safe area, or by allowing us to place it with specific coordinates)

And if so, when is this update coming?


#2

For banner, I’ll make the banner is only placed in the safe area.


#3

@0mega

https://developers.google.com/admob/ios/rel-notes

7.24.0	2017‑9‑20	Official release for iOS 11 support.

sdkbox_config.json

                "home":{
                    "id":"ca-app-pub-1329374026572143/3847466511",
                    "type":"banner",
                    "alignment":"bottom"
                },
                "top_banner":{
                    "id":"ca-app-pub-1329374026572143/6690628914",
                    "type":"banner",
                    "alignment":"top"
                },


Is it ok ?

It seems I need to follow this link https://developers.google.com/admob/ios/x-ad-rendering .


#4

It looks okay. Is it at the top of the safe area? It looks like the gap between the banner and the notch at the top is a bit big, but I don’t know for certain.

The same goes for bottom aligned ads naturally, they should be at the bottom of the safe area (slightly above the home bar instead of underneath the ‘home bar’ at the bottom of the screen)

There’s some additional explanation and sample code here for iOS:


#5

same as :

imagehttps://i.stack.imgur.com/Aqh7X.png

?


#6

Yep, that’s the safe area. So bottom ad should be in the bottom of the green area. Top ad in the top of the green area.
Apparently apps need to support this on the iPhone X by November 20 to stay in compliance with Google’s AdMob terms. (Ads always need to be fully visible)


#7

I have one question: game should place in the safe area ?


#8

The game should be placed on the entire screen (safe area + unsafe area)

It is up to the developer to place UI elements properly with the ‘unsafe area’ in mind. So for example the background can cover the entire screen, but if you have a button in your app you should place it in the safe area yourself so it does not get hidden by the iPhone X ‘notch’ at the top of the screen, or overlapped by the homebar at the bottom.

You can read more about that here: https://developer.apple.com/ios/human-interface-guidelines/overview/iphone-x/

There is also a property called safeAreaInsets: (https://developer.apple.com/documentation/uikit/uiview/2891103-safeareainsets) I believe this is used to determine the ‘true’ safe area (in case you are reserving space for custom views or status bars inside the safe area)

As a sidenote: For cocos2d-x itself it will also be useful if we have access to some of these values to better design for iPhone X. Or we can write our own bridge functions I guess. :slight_smile:

EDIT:

This just made me realize something. If the user has set safeAreaInsets then the banner should be placed according to the safeArea + insets. Otherwise it will overlap with any custom views or status bars the user has put in the safearea.


#9

This is going to be big pain.


#10

Yes iPhone X is a nightmare for game and UI developers and designers!


#11

@nite @yinjimmy

Are there any updates on the iPhone X changes for SDKBOX yet? If possible we would like to fix this before Google’s compliance deadline of the 20th of November.


#12

i’m using code form AdMob https://developers.google.com/admob/ios/x-ad-rendering#aligning_banners_to_the_edge_of_safe_area .


#13

Nice :slight_smile: Looks like it’s working.


#14

But it looks so ugly. It will overlap gaming elements too.
I am afraid that Apple might say “Banner Ads should not be implemented for iPhone-X” :slight_smile:


#15

tun agree with u.


#16

What’s the latest update on this?
The deadline from google to fix apps using admob for iPhone X was 20 November. I still don’t see the updated version on the sdkbox website. Can we expect the admob update today or soon?

Here’s the google message about the issue:

Dear Developer,
The iPhone X is here and with it, new design considerations – the device’s rounded corners, notch and home screen indicator on the extended screen can obscure content. When ads are placed in these areas, users will have poor ad experiences.
To ensure that users always have great experiences on your app, and to continue receiving AdMob ads, update your banner and native ad placements to designated “safe areas” for iPhone X by November 20. We’ve put together an implementation guide to help you with these changes.
Updating the ad placements will also help you stay compliant with our new ad policies that do not allow ads to be placed where objects may interfere with the user’s typical interaction with the ad or app.


#17

u can try the staging version, release ASAP.


#18

I tried the staging version: 2.3.17.3

I installed admob and used the old sdkbox_config that I already had.
The ad banner is still located in the unsafe area though (see image):
Do I need to use a special setting to ensure the ad is drawn in the safe area?

Here is my sdkbox config

        "AdMob": {
            "testdevice": "simulatorId", 
            "test": true, 
            "ads": {
                "phone": {
                    "width": 320, 
                    "type": "banner", 
                    "id": "ca-app-pub-MY_ID", 
                    "alignment": "bottom", 
                    "height": 50
                }
            }
        }, 

Tried on iPhone X simulator & iPhone X physical device

I also tried alignment top but that also put it in the unsafe area.


#19
    "ios": {
        "AdMob":{
            "test":false,
            "safearea":true,

sorry, u need to add filed safearea=true


#20

Just tested, it’s working. Thanks :smile:

EDIT: Interstitial ads are still showing the close button in the unsafe area. Does the sdkbox admob plugin use the latest google ads sdk?

Version 7.26.0 released on 2017‑11‑17
iPhone X support.
For full screen ads, the default close button now renders within the safe area.
Removed the nativeAd property from GADAdChoicesView and GADMediaView.

https://developers.google.com/admob/ios/rel-notes