Commit 71796205 authored by Gant Laborde's avatar Gant Laborde Committed by GitHub

Merge pull request #232 from firefueled/get-android-api-level

Add android-only getAPILevel method
parents 50357ab7 f7226362
This diff is collapsed.
...@@ -187,6 +187,7 @@ RCT_EXPORT_MODULE() ...@@ -187,6 +187,7 @@ RCT_EXPORT_MODULE()
return @{ return @{
@"systemName": currentDevice.systemName, @"systemName": currentDevice.systemName,
@"systemVersion": currentDevice.systemVersion, @"systemVersion": currentDevice.systemVersion,
@"apiLevel": @"not available",
@"model": self.deviceName, @"model": self.deviceName,
@"brand": @"Apple", @"brand": @"Apple",
@"deviceId": self.deviceId, @"deviceId": self.deviceId,
......
...@@ -121,6 +121,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule { ...@@ -121,6 +121,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
constants.put("model", Build.MODEL); constants.put("model", Build.MODEL);
constants.put("brand", Build.BRAND); constants.put("brand", Build.BRAND);
constants.put("deviceId", Build.BOARD); constants.put("deviceId", Build.BOARD);
constants.put("apiLevel", Build.VERSION.SDK_INT);
constants.put("deviceLocale", this.getCurrentLanguage()); constants.put("deviceLocale", this.getCurrentLanguage());
constants.put("deviceCountry", this.getCurrentCountry()); constants.put("deviceCountry", this.getCurrentCountry());
constants.put("uniqueId", Secure.getString(this.reactContext.getContentResolver(), Secure.ANDROID_ID)); constants.put("uniqueId", Secure.getString(this.reactContext.getContentResolver(), Secure.ANDROID_ID));
......
...@@ -29,6 +29,9 @@ module.exports = { ...@@ -29,6 +29,9 @@ module.exports = {
getSystemVersion: function () { getSystemVersion: function () {
return RNDeviceInfo.systemVersion; return RNDeviceInfo.systemVersion;
}, },
getAPILevel: function () {
return RNDeviceInfo.apiLevel;
},
getBundleId: function() { getBundleId: function() {
return RNDeviceInfo.bundleId; return RNDeviceInfo.bundleId;
}, },
......
...@@ -99,6 +99,7 @@ namespace RNDeviceInfo ...@@ -99,6 +99,7 @@ namespace RNDeviceInfo
constants["deviceName"] = deviceName; constants["deviceName"] = deviceName;
constants["systemName"] = "Windows"; constants["systemName"] = "Windows";
constants["systemVersion"] = osVersion; constants["systemVersion"] = osVersion;
constants["apiLevel"] = "not available";
constants["model"] = model; constants["model"] = model;
constants["brand"] = model; constants["brand"] = model;
constants["deviceId"] = hardwareVersion; constants["deviceId"] = hardwareVersion;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment