Blog: platform APIs in the core (connectivity + identity + sharing + AI)#5087
Open
shai-almog wants to merge 4 commits into
Open
Blog: platform APIs in the core (connectivity + identity + sharing + AI)#5087shai-almog wants to merge 4 commits into
shai-almog wants to merge 4 commits into
Conversation
a3190d9 to
ae74fe9
Compare
Contributor
Cloudflare Preview
|
f24bd82 to
5db7754
Compare
Consolidated follow-up to the May 29 weekly index. Covers the four surfaces that moved from "you need a cn1lib for this" to "it is in the framework" this release: - Connectivity (PR #5021): com.codename1.io.{wifi,bonjour,usb} + NetworkManager.addNetworkTypeListener with the per-platform implementations and the three new CN1_INCLUDE_* defines that keep unused entitlements out of Apple's API-usage scan. - Identity (PRs #5018, #5039): OIDC client backed by ASWebAuthenticationSession / Custom Tabs with PKCE; Sign in with Apple in core; refreshed Google/Facebook/Microsoft/Auth0/Firebase wrappers; WebAuthn / passkey client in W3C JSON wire format with iOS 16 and Android API 28 native bindings; Auth0/Firebase passkey helpers; legacy Oauth2 deprecated. - Sharing (PR #5036): ShareResult callbacks (SHARED_TO/DISMISSED/FAILED) on iOS and Android via UIActivityViewController.completionWithItemsHandler and Intent.createChooser with IntentSender; IOSShareExtensionBuilder in the Maven plugin generates a complete .ios.appext bundle. - AI (PRs #5035, #5057): com.codename1.ai with LlmClient for OpenAI/Anthropic/Gemini/Ollama, streaming SSE, ChatView, SpeechRecognizer/TextToSpeech, SecureStorage non-prompting overloads, simulator Ollama redirect, AiDependencyTable build-time injection, and the cn1-ai-mlkit-{barcode,docscan,face} cn1libs. Closes with the structural element common to all four (scanner-driven gating that mirrors the NFC/biometrics pattern from two weeks ago).
- Retitled "AI, OAuth, And Other Platform APIs In The Core". - Reordered sections so the two headline pieces come first: AI (with deep tutorials) and OAuth / OIDC (with provider walk- throughs and a migration). WiFi / connectivity and share-sheet callbacks land at the end. - Opener no longer runs together; the NFC / biometrics / crypto call-back is linked to the previous post explicitly. - AI section expanded with concrete examples for streaming, tool calls, embeddings, image generation, the simulator Ollama redirect, the SecureStorage non-prompting overloads, the ChatView binding, and an ASCII mockup of the ChatView surface for readers who haven't seen it. - New subsection explaining why the ML Kit AI features stay in cn1libs even though the LlmClient surface lives in core (core carries the plumbing every AI app wants; specialised verticals with large native dependencies stay opt-in; the cloud-build big- upload guard rules out the multi-gigabyte models). - OAuth section now walks through OIDC discovery, the four provider wrappers (Google, Microsoft, Auth0, Facebook), Sign in with Apple, an Oauth2-to-OidcClient migration example, and the WebAuthn / passkey client. - Dev-guide references go to the HTML version on the website. - Hero image lands at /blog/platform-apis-in-the-core.jpg. - Wrap-up has the link back to the intro and forward to the Wednesday post. Also updates the developer-workflow post (rebased on top) to add the forward link to this post in its wrap-up.
5db7754 to
81f62e3
Compare
- Opening description rewritten so it does not read as a comma list. - Dropped the "AI first, OAuth second" meta-paragraph. - Anthropic and Gemini are no longer described as "still in flight"; both are fully implemented in this release. - Replaced the SecureStorage "small thing that matters more than it sounds" framing with a proper "How to handle API keys" section that opens with the security rule (never check in, never embed, never hardcode), explains the proper shape (fetch from your backend over an authenticated request, cache to the platform keychain via SecureStorage), and gives a concrete getOpenAiKey example. - ChatView ASCII mockup replaced with a screenshot reference and a richer code example that drives the chat manually (ConversationStore + per-message lifecycle + error path). - Removed the Speech / TTS subsection entirely. The native iOS / Android bridges are still tracked follow-ups in PR #5035 and are not shipping in this release. - iOS Share Extension paragraph expanded into a real "how your app appears in other apps' share menus" section with a pom.xml configuration block, the cn1:generate-ios-share-extension Mojo invocation, and a host-side payload-read example. - AI cn1libs rewritten. The 13 cn1libs land in a feature table with a one-line "what it gives you" column each, followed by a "how to add and use them" paragraph and three short worked examples (barcode, text recognition, translation). The "why these are cn1libs and not core" answer follows the concrete list rather than appearing without context. - "What ties this together" section removed.
- Replaced the placeholder ChatView image reference with a real
screenshot pulled from the ChatViewDevGuideScreenshotTest output
(scripts/ios/screenshots-metal/ChatView_light.png), cropped to
remove the test-harness caption and downscaled for web payload.
- Replaced the AI cn1lib quick-table and the "Why are these cn1libs"
paragraph with thirteen per-cn1lib subsections (cn1-ai-mlkit-{
text, barcode, face, labeling, translate, smartreply, langid,
pose, segmentation, docscan}, cn1-ai-tflite, cn1-ai-whisper,
cn1-ai-stablediffusion). Each subsection covers TL;DR, per-
platform native bridge, use cases, and a real working code
sample using the actual facade signature (TextRecognizer.
recognize / BarcodeScanner.scan / FaceDetector.detect / ...
PoseDetector.detect / SelfieSegmenter.segment / ... etc).
- Up front: the cn1libs aren't in the CN1 Preferences picker yet,
so the manual pom.xml dependency snippet is the supported path;
the shared pattern is given once with just the artifactId
changing per cn1lib.
- Dropped the mention of scripts/create-ai-cn1lib.sh as an
implementation detail.
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
com.codename1.io.{wifi,bonjour,usb}+NetworkManager.addNetworkTypeListener, with per-platform implementations and three new compile-time defines that keep unused iOS entitlements out of Apple's API-usage scan.ASWebAuthenticationSession/ Custom Tabs, Sign in with Apple in core, refreshed provider wrappers,Oauth2deprecated.ShareResultcallbacks on iOS and Android, plus anIOSShareExtensionBuilderthat generates a complete.ios.appextbundle.com.codename1.aiwithLlmClient, streamingChatView,SpeechRecognizer/TextToSpeech, theSecureStoragenon-prompting overloads, the simulator Ollama redirect, theAiDependencyTablebuild-time injection, and the ML Kit cn1libs.File
docs/website/content/blog/platform-apis-in-the-core.md— single new file.Sequencing
Branches off
master; intended to publish on Monday. Front matter date is2026-06-01.Supersedes the closed PRs #5076 (connectivity), #5077 (OIDC + WebAuthn), #5078 (share callbacks), and #5082 (AI).
Test plan
docs/websitesucceeds./static/blog/platform-apis-in-the-core.jpg.