You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented cross-platform single-instance locking and second-instance argument forwarding on Application in libnativeapi/nativeapi-core#111 and #74 (available across C++, C ABI, Dart/Flutter, Rust, C#, JS/TS, Python, Go, and Swift):
Application.requestSingleInstanceLock(identifier, arguments) — acquires the OS-level lock on the primary instance (returning true), or forwards arguments and the current working directory to the running primary instance and returns false.
Application.hasSingleInstanceLock() / Application.releaseSingleInstanceLock() — inspect or release the lock.
ApplicationSecondInstanceEvent (arguments, workingDirectory) — delivered on the primary instance's UI thread when a secondary process launches.
Windows: per-session named mutex + overlapped named pipe IPC; secondary instances also call AllowSetForegroundWindow(ASFW_ANY) so the primary window can focus itself immediately.
Activity
Merge pull request #74 from libnativeapi/feat/single-instance-issue-72
lijy91 commentedon Dec 1, 2026
Implemented cross-platform single-instance locking and second-instance argument forwarding on
Applicationin libnativeapi/nativeapi-core#111 and #74 (available across C++, C ABI, Dart/Flutter, Rust, C#, JS/TS, Python, Go, and Swift):Application.requestSingleInstanceLock(identifier, arguments)— acquires the OS-level lock on the primary instance (returningtrue), or forwardsargumentsand the current working directory to the running primary instance and returnsfalse.Application.hasSingleInstanceLock()/Application.releaseSingleInstanceLock()— inspect or release the lock.ApplicationSecondInstanceEvent(arguments,workingDirectory) — delivered on the primary instance's UI thread when a secondary process launches.AllowSetForegroundWindow(ASFW_ANY)so the primary window can focus itself immediately.flocklock file (kernel-released on crash) + Unix domain socket IPC.Flutter usage example
See the full runnable example at
examples/flutter_single_instance_example.Empty-57 commentedon Dec 1, 2026
@lijy91 Is there an approximate release date for the next stable version?
lijy91 commentedon Dec 1, 2026
@Empty-57
0.6.3has just been released and published to pub.dev (cnativeapi,nativeapi, andnativeapi_flutter^0.6.3): https://github.com/libnativeapi/nativeapi/releases/tag/v0.6.3Empty-57 commentedon Dec 1, 2026
@lijy91 是否有计划完善所有方法/类文档