MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / isVPNConnected

Function isVPNConnected

packages/core/connectivity/index.ios.ts:101–117  ·  view source on GitHub ↗
(keys)

Source from the content-addressed store, hash-verified

99}
100
101function isVPNConnected(keys) {
102 if (!keys) {
103 return false;
104 }
105 const allKeys = keys.allKeys;
106 const size = allKeys.count;
107 let isVPN = false;
108 for (let i = 0; i < size; i++) {
109 const key = allKeys.objectAtIndex(i);
110 if (key === 'tap' || key === 'tun' || key === 'ppp' || key === 'ipsec' || key === 'ipsec0' || key === 'utun1') {
111 isVPN = true;
112 break;
113 }
114 }
115
116 return isVPN;
117}
118
119export function getConnectionType(): number {
120 return _getConnectionType();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected