Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone X support and iOS-related fixes #18106

Merged
merged 1 commit into from
Apr 11, 2018
Merged

Conversation

endragor
Copy link
Contributor

Starting from April 2018 Apple no longer accepts apps that do not
support iPhone X. For games this mainly means respecting the safe area,
unobstructed by notch and virtual home button. UI controls must be
placed within the safe area so that users can interact with them.

This commit:

  • Adds OS::get_window_safe_area method that returns unobscured area of
    the window, where interactive controls should be rendered.

  • Reorganizes how launch screens are exported - the previous way was
    incorrect and modern iPhones did not pick up the correct screens and
    because of that used a non-native resolution to render the game.

  • Adds launch screen options for iPhone X.

  • Makes launch screens optional in the export template. If not
    specified, a white screen will be used.

  • Add App Store icon (1024x1024) export option as it now has to be
    bundled with the app instead of being provided in iTunes Connect.

  • Fixes crash when launching games in iOS Simulator. It happened because
    controllerWasConnected callback came before the engine was
    initialized. Now in such case the controllers will be queued up and
    registered after initialization is done.

  • Fixes issue with the virtual keyboard where for some reason
    autocorrection panel would intersect with the keyboard itself and not
    allow you to use the top row of the keyboard. This is fixed by
    disabling autocorrection altogether.

Closes #17358. Fixes #17428, #17331.

@akien-mga
Copy link
Member

Build fails on Travis (Apple LLVM version 8.1.0 (clang-802.0.42)):

platform/iphone/gl_view.mm:84:10:{84:3-84:9}{84:12-84:38}: error: no viable overloaded '=' [2]
                insets = [_instance safeAreaInsets];
                 ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk//System/Library/Frameworks/UIKit.framework/Headers/UIGeometry.h:15:16: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'id' to 'const UIEdgeInsets' for 1st argument [2]
 typedef struct UIEdgeInsets {
                ^

@endragor
Copy link
Contributor Author

endragor commented Apr 10, 2018

Travis uses outdated Xcode by default. We need Xcode 9+ with iOS 11 SDK (Apple doesn't accept new submissions built with earlier versions). It seems osx_image needs to be set according to instructions here: https://docs.travis-ci.com/user/languages/objective-c/#Supported-Xcode-versions

@akien-mga
Copy link
Member

@endragor Can you rebase on the master branch to get #18108?

Starting from April 2018 Apple no longer accepts apps that do not
support iPhone X. For games this mainly means respecting the safe area,
unobstructed by notch and virtual home button. UI controls must be
placed within the safe area so that users can interact with them.

This commit:

- Adds OS::get_window_safe_area method that returns unobscured area of
  the window, where interactive controls should be rendered.

- Reorganizes how launch screens are exported - the previous way was
  incorrect and modern iPhones did not pick up the correct screens and
  because of that used a non-native resolution to render the game.

- Adds launch screen options for iPhone X.

- Makes launch screens optional in the export template. If not
  specified, a white screen will be used.

- Adds App Store icon (1024x1024) export option as it now has to be
  bundled with the app instead of being provided in iTunes Connect.

- Fixes crash when launching games in iOS Simulator. It happened because
  controllerWasConnected callback came before the engine was
  initialized. Now in such case the controllers will be queued up and
  registered after initialization is done.

- Fixes issue with the virtual keyboard where for some reason
  autocorrection panel would intersect with the keyboard itself and not
  allow you to use the top row of the keyboard. This is fixed by
  disabling autocorrection altogether.

Closes godotengine#17358. Fixes godotengine#17428. Fixes godotengine#17331.
@endragor
Copy link
Contributor Author

@akien-mga done.

@akien-mga akien-mga merged commit d87307d into godotengine:master Apr 11, 2018
@hpvb
Copy link
Member

hpvb commented Apr 14, 2018

cherry picked into 3.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x86_64 iOS template crashes in simulator launch screens should be optional for iOS export.
3 participants