Add ShareResult callback API + iOS Share Extension authoring helper#5036
Merged
shai-almog merged 5 commits intoMay 25, 2026
Merged
Conversation
ShareService.share(...) and Display.share(...) can now report the outcome of a share request through a ShareResultListener: SHARED_TO(packageName), DISMISSED, or FAILED(message). iOS plumbs the result via UIActivityViewController.completionWithItemsHandler; Android plumbs the chosen target via Intent.createChooser's IntentSender callback (API 22+) and documents that Android exposes no dismissal signal. ShareButton exposes setShareResultListener(...). IOSShareExtensionBuilder generates a complete .ios.appext bundle (Info.plist with NSExtension activation rules, App Group entitlements, a ShareViewController.swift that posts the payload via UserDefaults(suiteName:), and buildSettings.properties) so apps no longer need to bootstrap the extension target in Xcode. Composes with the existing IPhoneBuilder.extractAppExtensions pipeline. Developer-guide section added under The-Components-Of-Codename-One. Unit tests cover ShareResult, ShareService delivery semantics, and the extension builder file map / zip output / validation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Vale flagged six contraction/foreign-phrase issues in the new sections and LanguageTool flagged the British "normalises" / "synthesised" / "customised" spellings that leaked from comments into the generated HTML. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 20 screenshots: 20 matched. |
Contributor
Cloudflare Preview
|
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
The trailing '}}' was flagged as 'right curly not followed by whitespace' on JDK 8 quality gate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
The version stamps were incorrect (actual current is 7.0.245). Remove them from the new APIs' Javadoc, the IOSShareExtensionBuilder class Javadoc, and the developer-guide prose. Leave pre-existing @SInCE annotations in untouched code unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
IPhoneBuilder is an implementation detail of the maven plugin; the public guide should refer to "the iOS build pipeline" without naming the internal class. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
ShareResult/ShareResultListenerAPI surfaces the outcome of a share sheet (SHARED_TO(packageName),DISMISSED,FAILED). Plumbed throughDisplay.share(...),ShareButton.setShareResultListener(...), andShareService.deliverResult(...). iOS usesUIActivityViewController.completionWithItemsHandler; Android usesIntent.createChooserwith anIntentSendercallback (API 22+).IOSShareExtensionBuilder(maven plugin module) generates a complete.ios.appextbundle programmatically --Info.plistwith NSExtension activation rules, App Group entitlements, aShareViewController.swiftthat posts the payload viaUserDefaults(suiteName:), andbuildSettings.properties. Composes with the existingIPhoneBuilder.extractAppExtensionspipeline so apps no longer need to bootstrap the extension target in Xcode.docs/developer-guide/The-Components-Of-Codename-One.asciidoc(new sub-sections under the ShareButton entry).Relation to #3427: this PR is complementary -- the builder emits exactly the artefact the existing server-side extractor consumes, and it would also fit a future
ios/app_extensions/directory pipeline if/when that lands. Provisioning-profile generation (the certificate-wizard piece of #3427) is intentionally out of scope.Test plan
mvn -DskipTests=true compileclean on core and maven plugin modulesmvn testincodenameone-maven-plugin-- 11 new tests, all green (IOSShareExtensionBuilderTest)mvn -DunitTests=true -Dtest='ShareResult*,ShareServiceResultDeliveryTest,ShareServiceTest,ShareButtonTest' testincore-unittests-- 16 tests, all green\U0001F916 Generated with Claude Code