-
-
Notifications
You must be signed in to change notification settings - Fork 11
fix(godot): embed ios frameworks on export #148
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
Changes from all commits
afbbbbd
47f5b40
4398c32
86a71bb
c8bdfb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,15 +29,50 @@ func _exit_tree() -> void: | |
|
|
||
| class GodotIapExportPlugin extends EditorExportPlugin: | ||
| const PLUGIN_NAME = "GodotIap" | ||
| const IOS_FRAMEWORKS: Array[String] = [ | ||
| "res://addons/godot-iap/bin/ios/GodotIap.framework", | ||
| "res://addons/godot-iap/bin/ios/SwiftGodotRuntime.framework", | ||
| ] | ||
|
|
||
| func _get_name() -> String: | ||
| return PLUGIN_NAME | ||
|
|
||
| func _supports_platform(platform: EditorExportPlatform) -> bool: | ||
| if platform is EditorExportPlatformAndroid: | ||
| return true | ||
| if platform is EditorExportPlatformIOS: | ||
| return true | ||
| return false | ||
|
|
||
| func _export_begin(features: PackedStringArray, _is_debug: bool, _path: String, _flags: int) -> void: | ||
| if not _is_ios_export(features): | ||
| return | ||
|
|
||
| for framework_path in IOS_FRAMEWORKS: | ||
| if not DirAccess.dir_exists_absolute(framework_path): | ||
| push_warning("[GodotIap] Missing iOS framework: %s" % framework_path) | ||
| continue | ||
| _add_ios_embedded_framework(framework_path) | ||
|
|
||
| func _is_ios_export(features: PackedStringArray) -> bool: | ||
| var platform = get_export_platform() | ||
| return ( | ||
| platform is EditorExportPlatformIOS | ||
| or features.has("ios") | ||
| or features.has("iOS") | ||
| ) | ||
|
|
||
| func _add_ios_embedded_framework(path: String) -> void: | ||
| if has_method("add_apple_embedded_platform_embedded_framework"): | ||
| call("add_apple_embedded_platform_embedded_framework", path) | ||
| return | ||
| if has_method("add_apple_embedded_framework"): | ||
| call("add_apple_embedded_framework", path) | ||
| return | ||
|
Comment on lines
+66
to
+71
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method name
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No code change for this one. I checked the local Godot 4.6.2 binary and it exposes |
||
|
|
||
| # Godot 4.3/4.4 still expose the iOS-specific export API. | ||
| add_ios_embedded_framework(path) | ||
|
|
||
| func _get_android_libraries(platform: EditorExportPlatform, debug: bool) -> PackedStringArray: | ||
| # Path is relative to the project root (res://) | ||
| if debug: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.