UNPKG

fpt-akainsights-react-native

Version:

React Native Plugin for the akaInsights Javascript SDK

36 lines (35 loc) 1.44 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOSVersion = exports.getDeviceName = exports.getIpAdress = exports.getCurrentGeocode = exports.getDeviceToken = void 0; var react_native_device_info_1 = require("react-native-device-info"); var netinfo_1 = __importDefault(require("@react-native-community/netinfo")); var geolocation_1 = __importDefault(require("@react-native-community/geolocation")); function getDeviceToken() { return react_native_device_info_1.getUniqueId(); } exports.getDeviceToken = getDeviceToken; function getCurrentGeocode() { geolocation_1.default.getCurrentPosition(function (info) { return info; }); } exports.getCurrentGeocode = getCurrentGeocode; function getIpAdress() { netinfo_1.default.fetch().then(function (state) { console.log('Connection type', state.type); console.log('Is connected?', state.isConnected); console.log('IP', state.details); }); } exports.getIpAdress = getIpAdress; function getDeviceName() { return react_native_device_info_1.getDeviceId(); } exports.getDeviceName = getDeviceName; function getOSVersion() { return react_native_device_info_1.getSystemName() + ' ' + react_native_device_info_1.getSystemVersion(); } exports.getOSVersion = getOSVersion;