Skip to content

Commit

Permalink
Merge pull request #295 from alvarezloaiciga/master
Browse files Browse the repository at this point in the history
Fix applicationName
  • Loading branch information
GantMan committed Jan 17, 2018
2 parents 583f7f5 + ae5f3c8 commit d80e333
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -5,7 +5,9 @@
- Make play-services optional (https://github.com/rebeccahughes/react-native-device-info/pull/226)
- Critical fix on WIFI STATE (https://github.com/rebeccahughes/react-native-device-info/pull/249)
- Added `getTotalMemory` and `getMaxMemory` (https://github.com/rebeccahughes/react-native-device-info/pull/289)
- Introduced `getApplicationName` to see the name of the app both on ios, android and win (https://github.com/rebeccahughes/react-native-device-info/pull/210)
- Introduced `getApplicationName` to see the name of the app both on ios, android and win
- https://github.com/rebeccahughes/react-native-device-info/pull/210
- https://github.com/rebeccahughes/react-native-device-info/pull/295

### 0.12.0

Expand Down
Expand Up @@ -126,7 +126,6 @@ public String getCarrier() {

PackageManager packageManager = this.reactContext.getPackageManager();
String packageName = this.reactContext.getPackageName();
String applicationName = this.reactContext.getApplicationInfo().loadLabel(this.reactContext.getPackageManager()).toString();

constants.put("appVersion", "not available");
constants.put("appName", "not available");
Expand All @@ -136,11 +135,12 @@ public String getCarrier() {
try {
PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0);
PackageInfo info = packageManager.getPackageInfo(packageName, 0);
String applicationName = this.reactContext.getApplicationInfo().loadLabel(this.reactContext.getPackageManager()).toString();
constants.put("appVersion", info.versionName);
constants.put("buildNumber", info.versionCode);
constants.put("firstInstallTime", info.firstInstallTime);
constants.put("lastUpdateTime", info.lastUpdateTime);
constants.put("appName", packageManager.getApplicationLabel(applicationInfo).toString());
constants.put("appName", applicationName);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit d80e333

Please sign in to comment.