Comments (8)
Also getting this, although it was working in 1.1.1 but #6 seems to have broken it.
@smartdemocracy can you shed some light on this?
from react-native-device-uuid.
I had to update my JavaScript code from the code shown in the readme to a callback:
DeviceUUID.getUUID((errors, result) => {
...
})
I prefer the promise, so I re-wrote it
return new Promise((resolve, reject) => {
DeviceUUID.getUUID((errors, result) => {
if (errors)
return reject(errors);
else
return resolve(result);
})
});
from react-native-device-uuid.
I tested again, still working here.You may need to check the values before accessing. is working well with setState:
//[...]
class App extends Component {
constructor(props) {
super(props);
this.state = {
uuid: ''
}
}
componentDidMount() {
var DeviceUUID = require("react-native-device-uuid");
DeviceUUID.getUUID().then((uuid) => {
this.setState({uuid});
});
}
render() {
return (
<View style={styles.container}>
<Text style={{backgroundColor:'white', paddingTop: 77}}>
{this.state.uuid || 'NO UUID'}
</Text>
</View>
);
}
}
from react-native-device-uuid.
I found my error; NativeModules are required from react-native
not require('NativeModules')
. I modified our version for this:
https://github.com/fixdio/react-native-device-uuid/blob/master/DeviceUUID.ios.js
Documentation from react native: facebook/react-native@e5ba0f3#comments
from react-native-device-uuid.
I had the same issue and using @ashleydw seemed to resolve it - thanks!
from react-native-device-uuid.
awesome!
@ashleydw would you mind send me a pull request for your modification?
Thanks 👍
from react-native-device-uuid.
I assume this issue has been solved. Please feel free to reopen it if not
Thanks for all you guys' efforts.
from react-native-device-uuid.
I no longer get any errors, thanks.
Also thanks for the doc, very helpful
from react-native-device-uuid.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-device-uuid.