lazywei / react-native-device-uuid Goto Github PK
View Code? Open in Web Editor NEWGet iOS's UUID (identifierForVendor) for React Native Application
License: MIT License
Get iOS's UUID (identifierForVendor) for React Native Application
License: MIT License
This package would not work with other installed modules (which were working fine) in XCode unless I specifically cd'd into node_modules/react-native-device-uuid/, ran npm install invariant --save
to add the invariant dependency to the package.json, and changed the first line of node_modules/react-native-device-uuid/DeviceUUID.ios.js from var RCTDeviceUUID = require('NativeModules').DeviceUUID;
to var RCTDeviceUUID = require('react-native').NativeModules.DeviceUUID;
.
Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'getUUID' of undefined
TypeError: Cannot read property 'getUUID' of undefined
at blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:132798:20
at tryCallTwo (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:13422:7)
at doResolve (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:13586:15)
at new Promise (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:13445:5)
at Object.getUUID (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:132797:14)
at Login.<anonymous> (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:91202:26)
at commitCallbacks (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:6324:21)
at commitLifeCycles (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:8517:19)
at commitAllLifeCycles (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:9567:15)
at Object._invokeGuardedCallback (blob:http://localhost:8081/15b07455-e83e-4936-b6ec-2953b21fdf89:2789:16)
Getting this error while trying to get the uuid and print it on console using console.log. I tried to add the library using the method given in documentation but it didn't help.
Xcode 7.3 RN0.29
why not support android and give cross platform api as in react-native?
Receiving Invariant Violation that prevents application from loading:
Unable to resolve module NativeModules from /Users/.../node_modules/react-native-device-uuid/DeviceUUID.ios.js
React Native v. 0.7.1
Edit
Does it have something to do with requiring react-native instead of referencing private modules? Something like this perhaps (adapted from johanneslumpe/react-native-keyboardevents@5e57191)?:
var {
invariant,
NativeModules: {
DeviceUUID,
},
} = require('react-native');
Hi thanks for this module!
I tried this in the xcode emulator but get this:
Promise {_37: 2, _12: TypeError: Cannot read property 'getUUID' of undefined at http://localhost:8081/index.ios.bundle…, _59: null}
Any ideas?
Hey the uuid I get always is undefined
Running on both simulator and device (with update to RCTDeviceUUID.m), DeviceUUID just hangs and does not log the uuid to the console. Any ideas on how to begin debugging this?
Update
I needed to perform the following steps (adapted from react-native-keyboardevents):
In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name] Go to node_modules ➜ react-native-device-uuid and add the .xcodeproj file
In XCode, in the project navigator, select your project. Add the lib*.a from the react-native-device-uuid project to your project's Build Phases ➜ Link Binary With Libraries. Select the .a file. Go to the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for Header Search Paths and make sure it contains both
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.