react-native-device-info
Advanced tools
Comparing version
@@ -11,2 +11,5 @@ /** | ||
}, | ||
getInstanceID: function() { | ||
return RNDeviceInfo.instanceId; | ||
}, | ||
getDeviceId: function () { | ||
@@ -13,0 +16,0 @@ return RNDeviceInfo.deviceId; |
{ | ||
"name": "react-native-device-info", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "Get device information using react-native", | ||
@@ -5,0 +5,0 @@ "main": "deviceinfo.js", |
@@ -1,5 +0,1 @@ | ||
## MAINTAINERS WANTED! | ||
Unfortunately, I don't have the time to continue maintaining this module. If you would like to take over, please open an issue or get in touch with me (@rebeccahughes). | ||
## react-native-device-info | ||
@@ -11,2 +7,10 @@ | ||
## Installation via [`rnpm`](https://github.com/rnpm/rnpm) | ||
```shell | ||
rnpm install react-native-device-info | ||
``` | ||
`rnpm` will install (--save) this module then linking for react-native, so you don't have to link for each platforms manually as the following. | ||
## Installation | ||
@@ -52,9 +56,34 @@ | ||
* register module (in MainActivity.java) | ||
* register module | ||
On React Native 0.18+: | ||
On React Native 0.29+: | ||
in MainApplication.java: | ||
```java | ||
import com.learnium.RNDeviceInfo.RNDeviceInfo; // <--- import | ||
public class MainApplication extends Application implements ReactApplication { | ||
...... | ||
@Override | ||
protected List<ReactPackage> getPackages() { | ||
return Arrays.<ReactPackage>asList( | ||
new RNDeviceInfo(), // <---- add here | ||
new MainReactPackage() | ||
); | ||
} | ||
...... | ||
} | ||
``` | ||
On React Native 0.18-0.28: | ||
in MainActivity.java: | ||
```java | ||
import com.learnium.RNDeviceInfo.RNDeviceInfo; // <--- import | ||
public class MainActivity extends ReactActivity { | ||
@@ -130,2 +159,4 @@ ...... | ||
console.log("Device Country", DeviceInfo.getDeviceCountry()); // e.g US | ||
console.log("App Instance ID", DeviceInfo.getInstanceID()); // ANDROID ONLY - see https://developers.google.com/instance-id/ | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
36938
21.58%16
14.29%159
4.61%160
24.03%1
Infinity%