@abl-solutions/wifi-connect
Version:
The WiFi Connect React Native SDK enables the use of WiFi WPA2-Enterprise networks on mobile devices that are managed and operated by abl solutions GmbH
37 lines (34 loc) • 1.64 kB
JavaScript
import { NativeModules, Platform } from 'react-native';
import { CampaignServiceImpl } from './campaign';
import { WifiConnectServiceImpl } from './wifi-connect';
/**
* Initializer factory that returns an instance of WifiConnectService. This service can be used
* to perform any Wifi Connectivity related action (e.g. configuring the device's network settings).
* @param options Options for the WifiConnectService instance.
* @returns The new WifiConnectService instance.
*/
export const initWifiConnectService = options => {
const LINKING_ERROR = `The package '@abl-solutions/wifi-connect' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
const NativeWifiConnect = NativeModules.WifiConnect ? NativeModules.WifiConnect : new Proxy({}, {
get() {
throw new Error(LINKING_ERROR);
}
});
return new WifiConnectServiceImpl(NativeWifiConnect, options);
};
/**
* Initializer factory that returns an instance of CampaignService. This service can be used to
* perform any campaign related action.
* @param options Options for the CampaignService instance.
* @returns The new CampaignService instance.
*/
export const initCampaignService = options => {
return new CampaignServiceImpl(options);
};
export { LegalTerms, WifiConnectService, WifiConnectOptions } from './wifi-connect';
export { Campaign, CampaignOptions, CampaignService } from './campaign';
export { ErrorCode } from './error-code';
//# sourceMappingURL=index.js.map