Unity Ads on android work but on iOS don’t work. I was set platform iOS. Use unity 5.3.3 on PC and 5.3.4 on mac
Hi,
Under the advanced tab, you’ll find the game IDs used to initialize Unity Ads. Can you provide me with those game IDs?
Can I see your code responsible for handling Unity Ads?
I’ll get back to you after your response.
Kind regards,
Hi,
My project id: f1316bbc-8e0b-4113-847a-c3fbe88a8c09
When was run game have debug text:
2016-05-02 12:45:43.126 UUOneGuy[959:907] Unity Ads is ready to show ads
2016-05-02 12:45:43.158 UUOneGuy[959:907] Launching ad from video, options: {
allowClientOverrides = (
noOfferScreen,
openAnimated,
muteVideoSounds,
useDeviceOrientationForVideo
);
allowSkipVideoInSeconds = 5;
allowVideoSkipInSeconds = 5;
default = 1;
defaultRewardItem = {
key = default;
name = “Default reward item”;
picture = “https://static.applifier.com/unityads/unityicon_62.png”;
};
deleted = 0;
disableBackButtonForSeconds = 30;
enabled = 1;
id = video;
incentivised = 0;
muteVideoSounds = 0;
name = Video;
noOfferScreen = 1;
openAnimated = 0;
rewardItems = (
{
key = default;
name = “Default reward item”;
picture = “https://static.applifier.com/unityads/unityicon_62.png”;
}
);
useDeviceOrientationForVideo = 1;
}
2016-05-02 12:45:43.198 UUOneGuy[959:907] Warning: Attempt to present <UnityAdsMainViewController: 0x1de76420> on <UnityDefaultViewController: 0x1c541ae0> whose view is not in the window hierarchy!
2016-05-02 12:45:43.744 UUOneGuy[959:907] You are using download over http. Currently unity adds NSAllowsArbitraryLoads to Info.plist to simplify transition, but it will be removed soon. Please consider updating to https.
For show ads use this code:
public static void ShowAd()
{
if (Advertisement.IsReady ()) {
Advertisement.Show ();
}
}
Hi,
You provided the project ID.
For avoidance of doubt, can you provide me with your game ID(s) - they’re located under the advanced tab in your services window → ads.
iOS GameID: 1055422
I couldn’t find any issues on our end that could be the cause of this.
Have you tested this on the device? Are you by chance calling the show() function too early - before Unity Ads has had time to initialize?
Is your device connected to the Internet?
Yes I tested on the device. Show calling after the initialize. Device have connection of internet(other internet functions are working). Can be problem in iOS name project is “UUOneGuy” but in Unity “EEOneGuy (2)”?
Does the IsReady() -function return true or false?
In case it’s returning false, I’d recommend waiting further after initializing ads - as it may take a while to download the campaign data.
I was delete this line " Screen.orientation=ScreenOrientation.Portrait;" and ads start work. But need portrait orientation. How can use portrait orientation with unity abs?
In the dashboard, there’s an option to use device’s orientation instead of forcing landscape.
Once enabled, your app should be able to display portrait ads.
This is don’t work.
Hey!
I’m currently experiencing the same issue. Ads do not show up on iOS devices, but they work just fine on Android. On the Editor, the default ads placement appear, they just don’t work on iOS devices.
if( Advertisement.IsReady() )
{
Advertisement.Show(null, new ShowOptions() {
resultCallback = result => {
ReceiveBonusForWatchingVideoAds();
}
});
}
Sample code for displaying ads.
Hi Mikea,
How are you initializing the ads? Are you using the iOS game ID for iOS?
Well I was using the old way of initializing the Ads, but since it has been integrated within the editor, I’ve removed that piece of code, since it should automatically initilize the ads, right?
#if UNITY_ANDROID || UNITY_IOS
Advertisement.Initialize("--ProjectCodeIntHere--");
#endif
( this is what I had… with the proper code id for the project )
Hi,
Remember that the Game ID is different for both platforms (Android & iOS) - for the services window -based integration, these are found under Window → Unity Services → Ads → Advanced tab
The Game IDs are platform -specific, so you need to use an iOS game ID for your iOS game.
I know they are platform specific. The old dashboard had a unique ID for the project. ( no using since long time ago ) But! Since I don’t need to manually initialize the Ads ( Correct me on this ). I shouldn’t be able to mess with any ID. And both IDs are the same on the Services Tab, and on the New Dashboard…
So why exactly everything works on Android and not on iOS ?
Hi,
So you’re saying the IDs are the same on the dashboard and the services window, but not equal to each other?
Can you provide me with the game IDs so that I can take a closer look?
You don’t need to manually initialize ads when using the services window -based integration, but you can change the game IDs in the services window → ads → advanced tab.
I just want to make sure you’re using the iOS game ID for the iOS build first.
Your iOS device also has a functioning Internet connection?
Have you checked the log output from the iOS device? Can you provide me with the xcode logs?
Exaclty yes, my iOS GameID = 1003298, and Android GameID = 1003297. I assume these where auto-generated?
( Project ID: 346a1310-c3e8-4aa0-b2f8-7fac4207c7dd )
Also, yes, I have wifi enabled on the phone, and/or 4G. The log on iOS I can provide later during the day, since I’m not on my Mac, but It shows something similar vvoojj 's post above ( Unity Ads don't work on iOS - Unity Services - Unity Discussions ). I can see that something is called but nothing shows on screen.
I’ll try to get that log as soon as I can. Also, should the IDs be the same for both platforms? Aren’t you filtering by platform with these ids?
Thanks for providing these. Yes, we generate the game IDs for each platform automatically. You can still change them though. You should use an iOS game ID on an iOS game and the same goes for Android. When we generate these two IDs for you - the IDs are off by one from each other.
I checked the stats for your game and it shows ad requests up to yesterday, but completed impressions only until 29. of March.
If you can provide the build as well as the logs - it could help troubleshoot the issue further.
You can also contact the support directly and send the project for inspection if this issue still persists.
I’ll post the logs later today. As for the build, I’m currently on testflight, if you have an iOS device I can send it to, PM me the email and I’ll add it to the list. ( Assuming you can check directly the calls to the api, and see it in realtime ).