Breaking redesign of the request/result contract, plus platform dispatch and an iOS channel.
Changed (breaking)
- Pure-code string contract:
Bridge.Request(int command, string payload, Action<int code, string data> onResult).INativeChannel=Send(long seed, int command, string payload)+event Action<long,int,string> OnResult. The framework never interpretscodeand never touchesdata— it just relays. - Removed
BridgeError/onError: errors are codes. Business owns1/0/10086/…; the framework only mintsRelayCode.Timeout/RelayCode.Disposedwhen it can't get a native result.
Added
NativeChannelFactory.CreateForCurrentPlatform()—#ifplatform dispatch in one place (Editor/Windows → Mock, Android → JNI, iOS → P/Invoke), behindINativeChannel.AndroidChannel(JNI) +IosChannel(P/Invoke + GCHandle) C# sides; native contracts in docs/native-android.md, docs/native-ios.md (build the .aar / native lib on your side).
Verified
- dotnet 38 green; Unity 6: compile clean, EditMode 35/35, PlayMode 3/3 (main-thread dispatch, end-to-end timeout, 1000-request stress, steady-state zero-GC).
Install: https://github.com/forestlii/NativeRelay.git#v0.2.0 · Unity 6+ · MIT · © 2026 Likeon