flutter_vpn
用於開發者在其 Flutter 應用中存取 VPN 服務的外掛程式。
用於存取 Flutter 的 VPN 服務的外掛程式 | Flutter 的 VPN 外掛程式
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^2.0.0以下為英文專案原文快照,最新內容請造訪 GitHub。
This plugin help developers to access VPN service in their flutter app.
本插件帮助开发者在自己的应用内调用 VPN 服务。
The Android part was implemented by strongswan which support ikev2 protocol.
The iOS part was implemented by NEVPNManager.
Issues and PRs are welcome!
Modify your app/build.gradle to use abiFilter since flutter doesn't apply abiFilter for target platform yet.
android {
...
buildTypes {
...
release {
...
ndk {
if (!project.hasProperty('target-platform')) {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
} else {
def platforms = project.property('target-platform').split(',')
def platformMap = [
'android-arm' : 'armeabi-v7a',
'android-arm64': 'arm64-v8a',
'android-x86' : 'x86',
'android-x64' : 'x86_64',
]
abiFilters = platforms.stream().map({ e ->
platformMap.containsKey(e) ? platformMap[e] : e
}).toArray()
}
}
}
}
The plugin will automatically download pre-build native libraries from here if they haven't been downloaded.
You need to open Personal VPN and Network Extensions capabilities in Xcode: see Project->Capabilities.
VPN connection errors are handled in swift code, you need to use Xcode to see connection errors if there is any.