@falconeta/capacitor-wifi-connect
Advanced tools
Comparing version 5.1.6 to 5.1.7
{ | ||
"name": "@falconeta/capacitor-wifi-connect", | ||
"version": "5.1.6", | ||
"version": "5.1.7", | ||
"description": "plugin used for connect the device trhought Wifi also with prefix", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
@@ -12,2 +12,23 @@ # @falconeta/capacitor-wifi-connect | ||
## Example usage | ||
```typescript | ||
import { CapacitorWifiConnect } from "@falconeta/capacitor-wifi-connect"; | ||
async secureConnect() { | ||
let { value } = await CapacitorWifiConnect.checkPermission(); | ||
if (value === 'prompt') { | ||
const data = await CapacitorWifiConnect.requestPermission(); | ||
value = data.value; | ||
} | ||
if (value === 'granted') { | ||
CapacitorWifiConnect.secureConnect({ | ||
ssid: 'SSID', | ||
password: 'PWD', | ||
}).then((data) => alert(data.value)); | ||
} else { | ||
throw new Error('permission denied'); | ||
} | ||
} | ||
``` | ||
# iOS Functions | ||
@@ -24,2 +45,12 @@ For functionality, you need to note the following: | ||
* Will ensure that these permission are described in info.plist | ||
```plist | ||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> | ||
<string>...</string> | ||
<key>NSLocationAlwaysUsageDescription</key> | ||
<string>...</string> | ||
<key>NSLocationWhenInUseUsageDescription</key> | ||
<string>...</string> | ||
``` | ||
## API | ||
@@ -26,0 +57,0 @@ |
Sorry, the diff of this file is not supported yet
242
84387