Skip to content

@react-native-community/react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps: #657

@tanaymathur001

Description

@tanaymathur001

Not able to retrieve Device Info
// "react-native-device-info": "^1.6.1",

import DeviceInfo from 'react-native-device-info';

export default class SignUp extends Component {

constructor(props) {
super(props);
this.state = {
email : '',
fullName: '',
password: '',
mobileNo: '',
deviceId: '',
}
}

async componentWillMount(){
try{
var id = DeviceInfo.getUniqueID();
this.setState({ deviceId: id, });
}
catch(e){
console.log('Trouble getting device info ', e);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions