Skip to content

Commit 926b4da

Browse files
committed
fix: swift class not found if using static frameworks
1 parent 3030b68 commit 926b4da

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@
3232
### Added
3333

3434
- feat: add support for the new architecture (TurboModule/Fabric)
35+
36+
## v2.0.1
37+
38+
### Fixed
39+
40+
- swift class not found if using static frameworks

ios/DeviceCountry.mm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#import <NativeDeviceCountrySpec/NativeDeviceCountrySpec.h>
2+
#if __has_include(<react_native_device_country/react_native_device_country-Swift.h>)
3+
// if use_frameworks! :static
4+
#import <react_native_device_country/react_native_device_country-Swift.h>
5+
#else
26
#import "react_native_device_country-Swift.h"
7+
#endif
38

49
@interface NativeDeviceCountry : NSObject <NativeDeviceCountrySpec>
510
@end
@@ -16,7 +21,7 @@ @implementation NativeDeviceCountry
1621
return std::make_shared<facebook::react::NativeDeviceCountrySpecJSI>(params);
1722
}
1823

19-
- (void)getCountryCode:(nonnull NSString *)type resolve:(nonnull RCTPromiseResolveBlock)resolve reject:(nonnull RCTPromiseRejectBlock)reject {
24+
- (void)getCountryCode:(nonnull NSString *)type resolve:(nonnull RCTPromiseResolveBlock)resolve reject:(nonnull RCTPromiseRejectBlock)reject {
2025
NSDictionary<NSString *, NSString *> *result = [deviceCountry getCountryCode:type];
2126
if (result) {
2227
resolve(result);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-device-country",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Get device location by telephony (SIM card) or settings without using GPS tracker.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)