Skip to content

Commit

Permalink
- Updated example app react and react-native version
Browse files Browse the repository at this point in the history
- Added example of how to enable listeners
- Updated required react-native version on lib's package.json
  • Loading branch information
GGGava committed Jan 16, 2023
1 parent 3b741e3 commit 504deda
Show file tree
Hide file tree
Showing 8 changed files with 2,923 additions and 2,549 deletions.
11 changes: 8 additions & 3 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
* @format
*/

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

AppRegistry.registerComponent(appName, () => App);
AppRegistry.registerComponent(appName, () => {
new NativeEventEmitter(NativeModules.AppleHealthKit).addListener('healthKit:HeartRate:new', async () => {
console.log('new sample')
})
return App
});
5 changes: 4 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'
platform :ios, '13.0'

target 'example' do
config = use_native_modules!
Expand All @@ -20,6 +20,9 @@ target 'example' do
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end

Expand Down

0 comments on commit 504deda

Please sign in to comment.