iOS host integration - #330
Conversation
…uapi into feat/signing-host-ring-vrf
Use codec-derived runtime payloads and metadata-aware storage projections so field ordering and variant encoding stay aligned with chain types. Derive SSO message labels once and keep normal transcript events at debug.
Native executors need dispatch futures that can move across Tokio worker threads. Keep concise async signatures while teaching rustdoc codegen to unwrap async-trait futures.
pgherveou
left a comment
There was a problem hiding this comment.
thanks,
some early comments, will dig into it more and test
There was a problem hiding this comment.
this packages should probably live under js/packages this will I assume probably be shared with android hosts as well
There was a problem hiding this comment.
do we need this if we have truapi-host-container ?
There was a problem hiding this comment.
There reason is that we want to distribute the target script. iOS host sdk moved here https://github.com/paritytech/truapi-ios due to package distribution failure from truapi repo
There was a problem hiding this comment.
can't we just reuse the existing struct rather than mirroring them?
There was a problem hiding this comment.
The main issue is that uniffi can't represent all the types from UserConfirmationReview. For example, fixed size arrays. I thought that that was the reason why initialy the core interface was based on scale payloads but in the end of the day i decided to put the mirror in rust rather than duplicating it on both platforms
That's good I think the previous implementation was an artifact of following the web/wasm implementation where we built typed api re-using scale instead of wasm bindgen |
Summary
HostCallbacksUI-decision callbacks (navigateTo,pushNotification,devicePermission,remotePermission,featureSupported,confirmUserAction,lookupPreimage) are async and awaited by the core — hosts suspend for as long as the user takes, dropping the future cancels the prompt, and other TrUAPI traffic keeps flowing meanwhile.NativeTrUApiCorefunctions take typed values instead of SCALE-encoded bytes:NativeDevicePermission,NativeRemotePermission,PushNotificationRequest,FeatureSupportedRequest, a full-fidelityNativeUserConfirmationReviewtree, and a typedNativePermissionAuthorizationRequeston the permission admin API. ExhaustiveFromconversions make drift from the canonical types a compile error; embedders no longer hand-roll SCALE decoders.TrUAPIHostis a resolvable SPM package (rootPackage.swift): generated bindings and the bundled TS lockdown container are committed; the xcframework ships as a GitHub release asset, with auseLocalBinarytoggle for local development.ios/truapi-host/scripts/rebuild.shregenerates the xcframework, uniffi bindings, and container bundle in place;scripts/publish.sh <version>uploads the xcframework to the@parity/ios-host@<version>release and updates the manifest URL + checksum.