Commit 858ca079 authored by Becca Hughes's avatar Becca Hughes Committed by GitHub

Merge pull request #203 from tmdude9586/153-patch

Updated Documentation and typings for pin/fingerprint
parents 1aafc6f0 63711bcf
......@@ -163,33 +163,33 @@ var DeviceInfo = require('react-native-device-info');
// or import DeviceInfo from 'react-native-device-info';
```
| Name | Method | Return | Notes |
| :------------------------- | :------------------------------- | :-------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- |
| Device Unique ID | `getUniqueID()` | FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9 | This is IDFV on iOS so it will change if all apps from the current apps vendor have been previously uninstalled. |
| Device Manufacturer | `getManufacturer()` | Apple | |
| Device Brand | `getBrand()` | Apple / htc / Xiaomi | |
| Device Model | `getModel()` | iPhone 6 | |
| Device ID | `getDeviceId()` | iPhone7,2 | Or the board on Android e.g. goldfish |
| System Name | `getSystemName()` | iPhone OS | |
| System Version | `getSystemVersion()` | 9.0 | |
| Bundle ID | `getBundleId()` | com.learnium.mobile | |
| Build Number | `getBuildNumber()` | 89 | |
| App Version | `getVersion()` | 1.1.0 | |
| App Version (Readable) | `getReadableVersion()` | 1.1.0.89 | |
| Device Name | `getDeviceName()` | Becca's iPhone 6 | |
| User Agent | `getUserAgent()` | Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D) | |
| Device Locale | `getDeviceLocale()` | en-US | |
| Device Country | `getDeviceCountry()` | US | |
| Timezone | `getTimezone()` | America/Mexico_City | |
| App Instance ID | `getInstanceID()` | | ANDROID ONLY - see https://developers.google.com/instance-id/ |
| App is running in emulator | `isEmulator()` | true | if app is running in emulator return true |
| App is running on a tablet | `isTablet()` | true | if app is running on a tablet return true |
| PIN or fingerprint set | `isPinOrFingerprintSet(callback)`| | Only supported in Android and iOS 9.0 and above
Since the device setting for PIN/Fingerprint can be modified while the app is still open, this is available via callback instead of as a constant. To use, pass a callback function in your javascript:
| Name | Method | Return | Notes |
| :------------------------- | :------------------------------- | :-------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- |
| Device Unique ID | `getUniqueID()` | FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9 | This is IDFV on iOS so it will change if all apps from the current apps vendor have been previously uninstalled. |
| Device Manufacturer | `getManufacturer()` | Apple | |
| Device Brand | `getBrand()` | Apple / htc / Xiaomi | |
| Device Model | `getModel()` | iPhone 6 | |
| Device ID | `getDeviceId()` | iPhone7,2 | Or the board on Android e.g. goldfish |
| System Name | `getSystemName()` | iPhone OS | |
| System Version | `getSystemVersion()` | 9.0 | |
| Bundle ID | `getBundleId()` | com.learnium.mobile | |
| Build Number | `getBuildNumber()` | 89 | |
| App Version | `getVersion()` | 1.1.0 | |
| App Version (Readable) | `getReadableVersion()` | 1.1.0.89 | |
| Device Name | `getDeviceName()` | Becca's iPhone 6 | |
| User Agent | `getUserAgent()` | Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D) | |
| Device Locale | `getDeviceLocale()` | en-US | |
| Device Country | `getDeviceCountry()` | US | |
| Timezone | `getTimezone()` | America/Mexico_City | |
| App Instance ID | `getInstanceID()` | | ANDROID ONLY - see https://developers.google.com/instance-id/ |
| App is running in emulator | `isEmulator()` | true | if app is running in emulator return true |
| App is running on a tablet | `isTablet()` | true | if app is running on a tablet return true |
| PIN or fingerprint set | `isPinOrFingerprintSet()(callback)`| | Only supported in Android and iOS 9.0 and above
Since the device setting for PIN/Fingerprint can be modified while the app is still open, this is available via callback instead of as a constant. To use, pass a callback function to the returned bridge function in your javascript:
```js
RNDeviceInfo.isPinOrFingerprintSet(isPinOrFingerprintSet => {
RNDeviceInfo.isPinOrFingerprintSet()(isPinOrFingerprintSet => {
if (!isPinOrFingerprintSet) {
...
}
......
......@@ -21,7 +21,7 @@ declare class DeviceInfo {
public static getInstanceID(): string;
public static isEmulator(): boolean;
public static isTablet(): boolean;
public static isPinOrFingerprintSet(cb: (isSet: boolean) => void): void;
public static isPinOrFingerprintSet(): (cb: (isPinOrFingerprintSet: boolean) => void) => void;
}
export default DeviceInfo;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment