feat(iap): add plugin native source support to Android build templates#9
Open
A-Legg wants to merge 2 commits into
Open
feat(iap): add plugin native source support to Android build templates#9A-Legg wants to merge 2 commits into
A-Legg wants to merge 2 commits into
Conversation
Changes: - AndroidManifest.xml.eex: add com.android.vending.BILLING permission for Play Billing (used by mob_iap and any other IAP plugin) - build.zig.eex: add -Dproject_plugin_sources option that accepts comma-separated name:path pairs, allowing mob_dev to auto-discover and compile plugin C sources from deps' priv/native/android/jni/ Refs: GenericJam/mob#27
Author
|
🚀 Test app now available: https://github.com/A-Legg/mob_iap_test This repo demonstrates the full IAP flow end-to-end on both iOS Simulator and Android Emulator. It validates that:
See the README for step-by-step test instructions + troubleshooting. |
The previous one-line comment didn't capture why the permission is declared unconditionally vs. gated on a generator flag. Expand it to document both the rationale (avoid generator complexity) and the tradeoff (Play Console may warn non-IAP apps about the unused permission) so users know how to opt out. Template-only change; no behavior shift. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(iap): add plugin native source support to Android build templates
This PR adds the template-level groundwork for
mob_devto auto-discover and compile plugin native C sources into Android builds.Changes
AndroidManifest.xml.eexAdds the
com.android.vending.BILLINGpermission required by Google Play Billing (used bymob_iapand any other IAP plugin). Included unconditionally — it has no runtime effect if the app doesn't use IAP, and it avoids generator complexity.build.zig.eexAdds a new
-Dproject_plugin_sourcesoption that accepts comma-separatedname:pathpairs. Whenmob_devscans dependencies and finds.cfiles underpriv/native/android/jni/, it will pass them via this flag. The build.zig template compiles each entry as a plain C object and links it intolib<app>.so.Coordination
This is the mob_new counterpart to the mob_dev plugin auto-discovery work and the mob runtime NIF hooks PR:
mobruntime: feat: IAP runtime NIF hooks (StoreKit 2 + Play Billing 7) mob#27mob_iapplugin: https://github.com/A-Legg/mob_iapBackwards compatibility
Projects without plugin native sources pass an empty string (the default), and the new iteration block is skipped. No effect on existing builds.
What's still needed in mob_dev
mob_dev'sNativeBuildmodule needs to:deps/*/priv/native/android/jni/*.cbefore each Android zig buildname:pathpairs and pass-Dproject_plugin_sources=....ktfiles frompriv/native/android/into the project's Java treedeps/*/priv/native/ios/*.swiftand pass-Dproject_swift_sources=...for iOSThese
mob_devchanges are planned as a follow-up PR.