Skip to content

Commit b9e7bca

Browse files
committed
fixing Platform selection
1 parent 4cac5a9 commit b9e7bca

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

examples/BeaconsDemo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"moment": "^2.17.1",
1212
"react": "16.0.0-alpha.6",
1313
"react-native": "0.43.3",
14-
"react-native-beacons-manager": "^1.0.5",
14+
"react-native-beacons-manager": "git+https://github.com/MacKentoch/react-native-beacons-manager.git",
1515
"react-native-bluetooth-state": "^2.0.0"
1616
},
1717
"devDependencies": {

examples/BeaconsDemo/yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3307,6 +3307,10 @@ react-native-beacons-manager@^1.0.5:
33073307
version "1.0.5"
33083308
resolved "https://registry.yarnpkg.com/react-native-beacons-manager/-/react-native-beacons-manager-1.0.5.tgz#14c5e6de0f1deced30c42d4a3ab3e38fb3cb0516"
33093309

3310+
"react-native-beacons-manager@git+https://github.com/MacKentoch/react-native-beacons-manager.git":
3311+
version "1.0.6"
3312+
resolved "git+https://github.com/MacKentoch/react-native-beacons-manager.git#4cac5a9f688dc6d8b79d19f54510d37c862f19b8"
3313+
33103314
react-native-bluetooth-state@^2.0.0:
33113315
version "2.0.0"
33123316
resolved "https://registry.yarnpkg.com/react-native-bluetooth-state/-/react-native-bluetooth-state-2.0.0.tgz#a38eb7d68e0f5977375e41e20b5020ae27c3e800"

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// flow weak
22

33
import { Platform } from 'react-native';
4-
import RNiBeaconAndroid from './lib/module.android.js';
5-
import RNiBeaconIOS from './lib/module.ios.js';
4+
5+
const RNiBeaconAndroid = require('./lib/module.android.js');
6+
const RNiBeaconIOS = require('./lib/module.ios.js');
67

78
function moduleSelector() {
8-
if (Platform.OS === 'android') {
9-
return RNiBeaconAndroid;
9+
if (Platform.OS === 'ios') {
10+
return RNiBeaconIOS;
1011
}
11-
return RNiBeaconIOS;
12+
return RNiBeaconAndroid;
1213
}
1314

1415
const RNiBeaconsModule = moduleSelector();

0 commit comments

Comments
 (0)