diff --git a/CHANGELOG.md b/CHANGELOG.md index 55629cd..e12dc16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +1.0.2 +----- + +Support React Native headers both in the React namespace, where they are in RN version 0.40+, +and no namespace, for older versions of React Native + 1.0.1 ----- diff --git a/DeviceUtil.h b/DeviceUtil.h index b30ec50..ffbafaf 100644 --- a/DeviceUtil.h +++ b/DeviceUtil.h @@ -1,4 +1,10 @@ -#import +// Support React Native headers both in the React namespace, where they are in RN version 0.40+, +// and no namespace, for older versions of React Native +#if __has_include() +#import +#else +#import "RCTBridge.h" +#endif @interface DeviceUtil : NSObject diff --git a/DeviceUtil.m b/DeviceUtil.m index 9f71e15..198fde0 100644 --- a/DeviceUtil.m +++ b/DeviceUtil.m @@ -1,6 +1,16 @@ #import "DeviceUtil.h" +// Support React Native headers both in the React namespace, where they are in RN version 0.40+, +// and no namespace, for older versions of React Native +#if __has_include() +#import +#else #import "RCTBridge.h" +#endif +#if __has_include() +#import +#else #import "RCTUtils.h" +#endif #import @implementation DeviceUtil diff --git a/package.json b/package.json index a2826db..82236d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-device", - "version": "1.0.1", + "version": "1.0.2", "description": "UIDevice wrapper for React Native", "main": "Device.js", "scripts": {