godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.35k stars 21.06k forks source link

display issue in landscape orientation on iOS #11547

Closed alexzheng closed 4 years ago

alexzheng commented 7 years ago

Operating system or device, Godot version, GPU Model and driver (if graphics related): 2.1 iOS

Issue description:

Just display an Admob interstitial ad in a game in landscape the ads can not be displayed correctly.

Steps to reproduce: This is the code in the module that add the interstitial to the root view : UIViewController rootViewController = (ViewController )((AppDelegate *)[[UIApplication sharedApplication] delegate]).window.rootViewController; [interstitial presentFromRootViewController:rootViewController];

Link to minimal example project:

alexzheng commented 7 years ago

img_9969

alexzheng commented 7 years ago

If the supported orientation of the iOS project is set to portrait, the ads can be display as expected.

alexzheng commented 7 years ago

what it looks like in portrait, this is correct. img_9970

akien-mga commented 7 years ago

We can't provide support for thirdparty modules. Until it's establish that it would be an engine issue, you should report bugs experienced with the admob module to its developers. If they can confirm that they are doing everything right and that the issue is in Godot, then they can open a bug report here.

alexzheng commented 7 years ago

I reported this issue to google admob group, and they replied: Hi there,

Thanks for providing me the requested information. However, I'm afraid that we do not support any third-party platforms and/or plugins in this forum (such as "Godot") and we will not be able to guarantee that everything will be working as intended. I would recommend you reach out to the support team of the platform/plugin you are using for further assistance on this.

Regards, Joshua Lagonera Mobile Ads SDK Team

alexzheng commented 7 years ago

The module is implemented by myself, and the code for load and show the interstitial is quite common. It's quite possible this issue is related to the Root ViewController of Godot. I think it's not the issue of the admob SDK, I have integrated the SDK in other engines and works well.

alexzheng commented 7 years ago

I contact the Admob SDK developer and ask them to review my module code: They replied:

Hi there,

I looked through your implementation and I didn't notice anything suspicious from our perspective, and the code implementation seems to be straightforward. Although I noticed that you seem to be using the Application's Root ViewController to present your Interstitial Ads and not the current ViewController. You can check out on where to appropriately display the Interstitial Ad from our official documentation.

As previously mentioned, it would be best for you to contact the support team of the platform you are using for further assistance as they are out of scope for our support.

Regards, Joshua Lagonera Mobile Ads SDK Team

akien-mga commented 7 years ago

I was not telling you to get in touch with the Admob SDK developers, but with those who developed the Admob module you are using. There is no Admob integration in Godot, so you must have included it from a thirdparty.

Since you didn't provide any information about the module you're using, we can't help you.

alexzheng commented 7 years ago

The module code is quite straightforward. You can check the code here: https://github.com/alexzheng/admob_for_godot.git

akien-mga commented 7 years ago

It would have been useful to mention in the first place that you are the module developer..

alexzheng commented 7 years ago

Because I thought the module code related to load and show the interstitial is nothing more than the demo code from the official documents, it's not important. It must be something issue related to the root view controller in the Godot code or the template project settings.

groud commented 7 years ago

Isn't that a duplicate of #11628 then ? (Which is more explicit)

alexzheng commented 7 years ago

absolutely different issues.

11628 is only happen on the iOS 11, and the content of game itself displayed incorrectly.

alexzheng commented 7 years ago

really lots of issues after upgrade to iOS 11.

alexzheng commented 7 years ago

Is any contributor taking care of this issue? It really prevents the engine from publishing games.

bojidar-bg commented 7 years ago

I know nothing of iOS (or OSx and Objective C), but the only thing related to their comment which I could find is:

https://github.com/godotengine/godot/blob/c5ab18f33e34b49b0603382af4af5e3fcd18c4ed/platform/iphone/app_delegate.mm#L91-L93

Not sure if it would help though :[

alexzheng commented 7 years ago

UIViewController rootViewController = (ViewController )((AppDelegate *)[[UIApplication sharedApplication] delegate]).window.rootViewController;

UIViewController *rootViewController = [AppDelegate getViewController];

This result is the same. It's just get the root view controller. There must be something wrong related to orientation in the root view controller.

alexzheng commented 7 years ago

It happens when only landscape left and landscape right is enabled for the device orientation,if portrait is also enabled, it will show correctly.

akien-mga commented 7 years ago

Maybe @BastiaanOlij or @endragor can help with this one and #11628.

BastiaanOlij commented 7 years ago

Haven't done too much with this in iOS 11, I've locked my projects in landscape mode because you don't want this sort of rotation for AR, Apple does some weird stuff. When I did accelerometer and gyro code I did spend some time making sure it worked correctly with auto rotation but that was purely in detecting what the rotation was.

Wish I knew more about this to actually give some worth while advise.

alexzheng commented 7 years ago

this issue is not only happens on iOS 11,it also happens on iOS 10.

11628 only happens on iOS 11.

And the termination issue #11623 also only happens on iOS 11.

alexzheng commented 7 years ago

This issue happens even if locked the project orientation to landscape.

sersoong commented 6 years ago

I've found the reason. And fix it in my code. Perfect. capture

alexzheng commented 6 years ago

What did you modified? It seems nothing need to modify after changing the compile SDK path.

Calinou commented 4 years ago

@alexzheng Can you still reproduce this bug in Godot 3.2.1 or 3.2.2beta4?

alexzheng commented 4 years ago

no

akien-mga commented 4 years ago

Closing as fixed then.