Skip to content

v0.2.0 — pure-code contract + platform dispatch

Latest

Choose a tag to compare

@forestlii forestlii released this 28 Jun 22:59

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 interprets code and never touches data — it just relays.
  • Removed BridgeError/onError: errors are codes. Business owns 1/0/10086/…; the framework only mints RelayCode.Timeout/RelayCode.Disposed when it can't get a native result.

Added

  • NativeChannelFactory.CreateForCurrentPlatform()#if platform dispatch in one place (Editor/Windows → Mock, Android → JNI, iOS → P/Invoke), behind INativeChannel.
  • 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