From 35576745a49346555ebdbbe4759649d20f26c90e Mon Sep 17 00:00:00 2001 From: Tisho Georgiev Date: Wed, 11 Jan 2017 14:38:28 -0800 Subject: [PATCH 1/5] Move to namespaced imports for compatibility with RN 0.40.0 --- DeviceUtil.h | 2 +- DeviceUtil.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DeviceUtil.h b/DeviceUtil.h index b30ec50..e3402e2 100644 --- a/DeviceUtil.h +++ b/DeviceUtil.h @@ -1,4 +1,4 @@ -#import +#import @interface DeviceUtil : NSObject diff --git a/DeviceUtil.m b/DeviceUtil.m index 9f71e15..ea68d67 100644 --- a/DeviceUtil.m +++ b/DeviceUtil.m @@ -1,6 +1,6 @@ #import "DeviceUtil.h" -#import "RCTBridge.h" -#import "RCTUtils.h" +#import +#import #import @implementation DeviceUtil From f062af3406c2207f074dac73792b16945ccec52f Mon Sep 17 00:00:00 2001 From: Justin Hamade Date: Thu, 10 Aug 2017 09:20:18 -0700 Subject: [PATCH 2/5] Support React Native headers for 0.40+ Also support previous versions --- DeviceUtil.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DeviceUtil.h b/DeviceUtil.h index e3402e2..ffbafaf 100644 --- a/DeviceUtil.h +++ b/DeviceUtil.h @@ -1,4 +1,10 @@ +// 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 From 44d17ff27190e931d83f39fa6ba321acc7744987 Mon Sep 17 00:00:00 2001 From: Justin Hamade Date: Thu, 10 Aug 2017 09:21:42 -0700 Subject: [PATCH 3/5] Support React Native headers for 0.40+ Also provide backwards compatibility for <=0.39 --- DeviceUtil.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/DeviceUtil.m b/DeviceUtil.m index ea68d67..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 From 2c00462a8944200a341cac356d87cf68af7a5d44 Mon Sep 17 00:00:00 2001 From: Justin Hamade Date: Thu, 10 Aug 2017 09:22:52 -0700 Subject: [PATCH 4/5] Bump version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": { From d8fe791f002d7acc021bd3fc0abadb718c1fcc88 Mon Sep 17 00:00:00 2001 From: Justin Hamade Date: Thu, 10 Aug 2017 09:23:39 -0700 Subject: [PATCH 5/5] Update Change log --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) 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 -----