Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.4.1]

### Fixed

- **iOS**: `getIpAddress()` and `getIpAddressSync()` now consistently return IPv4 addresses when available ([#39](https://github.com/l2hyunwoo/react-native-nitro-device-info/issues/39))
- Previously, the functions could return IPv6 addresses inconsistently due to network interface enumeration order
- IPv4 addresses are now prioritized, with IPv6 used only as a fallback when no IPv4 is available

- **Android**: `getHasGms()` no longer crashes when `play-services-base` dependency is not included ([#40](https://github.com/l2hyunwoo/react-native-nitro-device-info/issues/40))
- Previously, calling `getHasGms()` without the GMS dependency would throw a JNI exception (`NoClassDefFoundError`)
- The function now catches `NoClassDefFoundError` explicitly (not `Throwable`) to avoid masking serious JVM errors
- This allows apps distributed on non-GMS stores (Amazon, Huawei AppGallery) to safely use this API

## [1.4.0] - 2025-12-01

### Added
Expand Down Expand Up @@ -161,13 +174,15 @@ const charging = DeviceInfoModule.getIsBatteryCharging();
All getter functions have been converted to readonly properties for cleaner, more intuitive access ([#20](https://github.com/l2hyunwoo/react-native-nitro-device-info/pull/20)):

**Before (v1.1.x)**:

```typescript
const brand = DeviceInfoModule.getBrand();
const model = DeviceInfoModule.getModel();
const isTablet = DeviceInfoModule.isTablet();
```

**After (v1.2.0)**:

```typescript
const brand = DeviceInfoModule.brand;
const model = DeviceInfoModule.model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,23 @@ class DeviceInfo : HybridDeviceInfoSpec() {
override val supportedAbis: Array<String>
get() = Build.SUPPORTED_ABIS

/** Check if Google Mobile Services (GMS) is available */
/**
* Check if Google Mobile Services (GMS) is available
* Catches both Exception and NoClassDefFoundError to handle cases where
* play-services-base dependency is not included in the app.
*/
override fun getHasGms(): Boolean {
return try {
val result =
GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context)
result == ConnectionResult.SUCCESS
} catch (e: Exception) {
Log.w(NAME, "GMS not available or GMS library not found", e)
Log.d(NAME, "GMS not available", e)
false
} catch (e: NoClassDefFoundError) {
// NoClassDefFoundError is thrown when GMS library is not included
// This is expected in apps distributed on non-GMS stores (Amazon, Huawei AppGallery)
Log.d(NAME, "GMS library not found", e)
false
}
}
Expand Down