[mobile] Export lazy connection environment variables for mobile clients#5310
Conversation
Both for Android and iOS
📝 WalkthroughWalkthroughAdds two lazy-connection environment keys to Android and iOS mobile SDKs: Android exposes string constants, iOS exposes getter functions; both map to values from the lazyconn package. Comment for Android's EnvKeyNBForceRelay clarified. Changes
Sequence Diagram(s)(omitted — changes are small API additions without multi-component control-flow needing visualization) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This pull request exports lazy connection environment variables for mobile clients (iOS and Android) to allow configuration from within their sandboxed environments. The changes enable mobile apps to set values for lazy connection features similarly to how Force Relay is currently implemented.
Changes:
- Added exports for lazy connection environment variables (
EnvEnableLazyConnandEnvInactivityThreshold) to both iOS and Android client bindings - Imported the
lazyconnpackage alongside the existingpeerpackage in both mobile platform implementations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| client/ios/NetBirdSDK/env_list.go | Added two getter functions to export lazy connection environment variable keys for iOS gomobile binding |
| client/android/env_list.go | Added two exported package variables for lazy connection environment variable keys for Android Java client |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|



Since both Android and iOS apps run in a sandboxed context, to be able to set values for the lazy connection environment
variables, they will need to be exported to the gomobile generated code, have their values set within their respective apps and exported once they connect to the VPN, similarly how Force Relay is implemented.
Describe your changes
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit