Skip to content
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
-----

Expand Down
8 changes: 7 additions & 1 deletion DeviceUtil.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#import <RCTBridge.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(<React/RCTBridge.h>)
#import <React/RCTBridge.h>
#else
#import "RCTBridge.h"
#endif

@interface DeviceUtil : NSObject <RCTBridgeModule>

Expand Down
10 changes: 10 additions & 0 deletions DeviceUtil.m
Original file line number Diff line number Diff line change
@@ -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(<React/RCTBridge.h>)
#import <React/RCTBridge.h>
#else
#import "RCTBridge.h"
#endif
#if __has_include(<React/RCTUtils.h>)
#import <React/RCTUtils.h>
#else
#import "RCTUtils.h"
#endif
#import <sys/utsname.h>

@implementation DeviceUtil
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down