Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/release-godot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,12 @@ jobs:
run: |
mkdir -p dist/addons/godot-iap/android
mkdir -p dist/addons/godot-iap/bin/ios
mkdir -p dist/addons/godot-iap/scripts

cp addons/godot-iap/*.gd dist/addons/godot-iap/
cp addons/godot-iap/plugin.cfg dist/addons/godot-iap/
cp scripts/fix_ios_embed.sh dist/addons/godot-iap/scripts/
chmod +x dist/addons/godot-iap/scripts/fix_ios_embed.sh

cp android/build/outputs/aar/godot-iap-release.aar dist/addons/godot-iap/android/GodotIap.release.aar
cp android/build/outputs/aar/godot-iap-release.aar dist/addons/godot-iap/android/GodotIap.debug.aar
Expand Down
19 changes: 14 additions & 5 deletions knowledge/internal/05-docs-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,20 @@ Before adding or editing a `Package Releases` list:
2. Read the current package metadata from `origin/main`, not from memory.
3. For planned patch releases, add exactly one patch version to each affected
framework package and label the block `Planned Package Releases`.
4. For published release links, confirm each tag exists with
`gh release view <tag> --repo hyodotdev/openiap` before adding an `<a href>`.
5. If a release workflow is still running, keep the entry as plain text with
planned wording. Add links only after the GitHub Release exists.
6. Run `bun run audit:docs`; the audit fails when a published
4. If the user explicitly asks to write the note as already released, says to
"assume it will be deployed/published", or asks to follow the existing linked
release-note style, do **not** use `Planned Package Releases` or
`(planned)`. Write the block as `Package Releases`, add the expected GitHub
Release tag link (for example `godot-iap-2.2.8`), and use shipped wording
such as "Publishes" / "Ships" instead of "Prepares".
5. For links to releases that should already exist in GitHub, confirm each tag
exists with `gh release view <tag> --repo hyodotdev/openiap` before adding an
`<a href>`. This existence check is skipped only when step 4 applies because
the user explicitly requested an assumed post-release note.
6. If a release workflow is still running and the user has not requested an
already-released note, keep the entry as plain text with planned wording. Add
links only after the GitHub Release exists.
7. Run `bun run audit:docs`; the audit fails when a published
`Package Releases` block contains a package/version item without a GitHub
Release link.

Expand Down
1 change: 1 addition & 0 deletions libraries/godot-iap/addons/godot-iap/godot_iap.gd
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ func _await_products_fetched_for(method: String, request_id: String = "") -> Dic
if payload is Dictionary and payload.get("method", "") == method:
if request_id.is_empty() or payload.get("requestId", "") == request_id:
return payload as Dictionary
return {}

## Extract the native `requestId` token from the synchronous "pending" JSON
## returned by a GDExtension @Callable, or empty string if missing.
Expand Down
35 changes: 35 additions & 0 deletions libraries/godot-iap/addons/godot-iap/godot_iap_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment thread
hyochan marked this conversation as resolved.
return
if has_method("add_apple_embedded_framework"):
call("add_apple_embedded_framework", path)
return
Comment on lines +66 to +71

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The method name add_apple_embedded_platform_embedded_framework appears to be incorrect and does not exist in the Godot Engine source. The standard modern method for Godot 4.2+ is add_apple_embedded_framework. I recommend removing the redundant and incorrect check to simplify the logic while maintaining compatibility with older versions via the existing fallback.

		if has_method("add_apple_embedded_framework"):
			call("add_apple_embedded_framework", path)
			return

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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 add_apple_embedded_platform_embedded_framework, add_apple_embedded_platform_framework, add_ios_embedded_framework, and add_ios_framework, but not add_apple_embedded_framework. Keeping add_apple_embedded_platform_embedded_framework preserves the modern Godot 4.6 path; add_apple_embedded_framework remains as an extra compatibility fallback before add_ios_embedded_framework.


# 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:
Expand Down
Loading