Skip to content

Latest commit

 

History

History
107 lines (85 loc) · 5.17 KB

ios.md

File metadata and controls

107 lines (85 loc) · 5.17 KB

iOS And Apple Platform Guide

Use this guide with the shared production, permissions, plugin adapter, compatibility, and real device release checklist docs when preparing iOS, iPadOS, visionOS, or other Apple-platform exports.

Build Checklist

  1. Run npm run build so Godot exports the current dist/app.js bundle.
  2. Run npm run check:exports if your app was generated by the CLI.
  3. Create or update the Apple-platform export preset in official Godot.
  4. Keep the complete universal GodotJS add-on, including its iOS XCFrameworks.
  5. Add plist usage descriptions, entitlements, and capabilities required by the APIs your app actually uses.
  6. Install and configure native plugins required by registered @vue-godot/device adapters.
  7. Test an exported app on a real device for camera, microphone, location, notifications, safe areas, virtual keyboard behavior, and lifecycle events.

Simulator checks are useful for layout and basic startup, but hardware-backed capabilities need real devices before release.

Common Plist Keys And Entitlements

App capability Apple setup
Camera adapters / getUserMedia({ video: true }) NSCameraUsageDescription
Microphone adapters / getUserMedia({ audio: true }) NSMicrophoneUsageDescription
Geolocation adapters / navigator.geolocation Location usage description keys required by the native location plugin, commonly NSLocationWhenInUseUsageDescription
Photo or media library access NSPhotoLibraryUsageDescription when a plugin uses the photo library
Notifications User notification authorization plus plugin-specific notification setup
Universal links / associated domains Associated Domains entitlement and native link handling plugin

The browser package does not trigger Apple permission prompts directly. navigator.permissions.query() is query-only. Native plugins or app-specific bridges own permission requests and should report status through PermissionAdapter or the capability-specific adapter.

Adapter-Backed APIs

Register Apple-backed adapters before installBrowserAPIs() when you want browser-shaped globals to appear during startup:

import { installBrowserAPIs } from '@vue-godot/browser'
import { registerDeviceCapability } from '@vue-godot/device'

registerDeviceCapability({
  capability: 'media-devices',
  pluginName: 'ios-media',
  getStatus() {
    return iosMedia.getStatus()
  },
  getUserMedia(constraints) {
    return iosMedia.getUserMedia(constraints)
  },
})

installBrowserAPIs()

Adapters should report export-misconfiguration when required plist keys, entitlements, plugin files, or Xcode capabilities are missing. They should report permission-denied when the native authorization state denies access.

Deep Links And Share Sheets

Core Godot does not expose a portable incoming URL event stream or native share sheet API. Use plugin-backed adapters:

  • DeepLinkAdapter for custom URL schemes, universal links, and runtime URL open events.
  • ShareAdapter for native share sheets.
  • NotificationAdapter for local or remote notification display where a plugin provides that capability.

Route incoming URLs through the patterns in the routing guide. Keep URL scheme registration, associated domains, push notification setup, and entitlements next to the native plugin configuration in the app repository.

Storage, Network, And Media

  • localStorage persists through Godot user:// when available; verify it across app updates and reinstalls according to your app's data policy.
  • sessionStorage is process-local and is cleared when the runtime exits.
  • Network APIs depend on the selected runtime artifact and Apple network policy.
  • Camera, microphone, and media-library access should stop native resources when Vue screens unmount or Godot scenes exit.
  • Safe area and virtual keyboard behavior must be tested on the target device families your app supports.

Release Smoke

For each release candidate, test at least:

  • cold launch into the main scene
  • dist/app.js plus chunk loading
  • storage persistence under user://
  • camera, microphone, location, and notification denied states if used
  • plugin missing or disabled states
  • safe area and virtual keyboard layout
  • app background/foreground behavior
  • deep link cold-start and warm-start handling if used
  • share sheet and notification behavior if used