Skip to content

Commit 504deda

Browse files
committed
- Updated example app react and react-native version
- Added example of how to enable listeners - Updated required react-native version on lib's package.json
1 parent 3b741e3 commit 504deda

File tree

8 files changed

+2923
-2549
lines changed

8 files changed

+2923
-2549
lines changed

example/index.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
* @format
33
*/
44

5-
import {AppRegistry} from 'react-native';
5+
import { AppRegistry, NativeEventEmitter, NativeModules } from 'react-native';
66
import App from './App';
7-
import {name as appName} from './app.json';
7+
import { name as appName } from './app.json';
88

9-
AppRegistry.registerComponent(appName, () => App);
9+
AppRegistry.registerComponent(appName, () => {
10+
new NativeEventEmitter(NativeModules.AppleHealthKit).addListener('healthKit:HeartRate:new', async () => {
11+
console.log('new sample')
12+
})
13+
return App
14+
});

example/ios/Podfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative '../node_modules/react-native/scripts/react_native_pods'
22
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33

4-
platform :ios, '10.0'
4+
platform :ios, '13.0'
55

66
target 'example' do
77
config = use_native_modules!
@@ -20,6 +20,9 @@ target 'example' do
2020
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
2121
post_install do |installer|
2222
flipper_post_install(installer)
23+
installer.pods_project.build_configurations.each do |config|
24+
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
25+
end
2326
end
2427
end
2528

0 commit comments

Comments
 (0)