Skip to content

Instantly share code, notes, and snippets.

@rafaelpadovani
Created February 29, 2020 13:42
Show Gist options
  • Save rafaelpadovani/6a57701ba3cdc5f620eeeb82ae4609f3 to your computer and use it in GitHub Desktop.
Save rafaelpadovani/6a57701ba3cdc5f620eeeb82ae4609f3 to your computer and use it in GitHub Desktop.
import React, { useEffect } from 'react';
import { NativeModules } from 'react-native';
var DeviceInfo = NativeModules.DeviceInfoGet;
export default const DeviceInfoComponent = props => {
useEffect(() => {
DeviceInfo.getDeviceID((err, deviceID) => {
if (err) {
// error
} else {
// device ID returned
console.log(deviceID);
}
})
}, []);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment