├── android ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values-night │ │ │ │ │ └── colors.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── drawable-hdpi │ │ │ │ │ └── splashscreen_image.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ └── splashscreen_image.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ └── splashscreen_image.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ └── splashscreen_image.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ └── splashscreen_image.png │ │ │ │ ├── drawable │ │ │ │ │ ├── splashscreen.xml │ │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ ├── values │ │ │ │ │ ├── colors.xml │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ └── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── jni │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── MainApplicationModuleProvider.h │ │ │ │ ├── OnLoad.cpp │ │ │ │ ├── MainComponentsRegistry.h │ │ │ │ ├── MainApplicationModuleProvider.cpp │ │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ │ │ └── MainComponentsRegistry.cpp │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── dfriyia2 │ │ │ │ │ └── expoblesample │ │ │ │ │ ├── newarchitecture │ │ │ │ │ ├── components │ │ │ │ │ │ └── MainComponentsRegistry.java │ │ │ │ │ ├── modules │ │ │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ │ │ │ └── MainApplicationReactNativeHost.java │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ └── AndroidManifest.xml │ │ └── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── dfriyia2 │ │ │ └── expoblesample │ │ │ └── ReactNativeFlipper.java │ ├── debug.keystore │ ├── proguard-rules.pro │ ├── build_defs.bzl │ ├── BUCK │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── gradle.properties ├── build.gradle ├── gradlew.bat └── gradlew ├── ios ├── Podfile.properties.json ├── expoblesample │ ├── Images.xcassets │ │ ├── Contents.json │ │ ├── SplashScreen.imageset │ │ │ ├── image.png │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── App-Icon-20x20@1x.png │ │ │ ├── App-Icon-20x20@2x.png │ │ │ ├── App-Icon-20x20@3x.png │ │ │ ├── App-Icon-29x29@1x.png │ │ │ ├── App-Icon-29x29@2x.png │ │ │ ├── App-Icon-29x29@3x.png │ │ │ ├── App-Icon-40x40@1x.png │ │ │ ├── App-Icon-40x40@2x.png │ │ │ ├── App-Icon-40x40@3x.png │ │ │ ├── App-Icon-60x60@2x.png │ │ │ ├── App-Icon-60x60@3x.png │ │ │ ├── App-Icon-76x76@1x.png │ │ │ ├── App-Icon-76x76@2x.png │ │ │ ├── ItunesArtwork@2x.png │ │ │ ├── App-Icon-83.5x83.5@2x.png │ │ │ └── Contents.json │ │ └── SplashScreenBackground.imageset │ │ │ ├── image.png │ │ │ └── Contents.json │ ├── noop-file.swift │ ├── AppDelegate.h │ ├── main.m │ ├── expoblesample.entitlements │ ├── Supporting │ │ └── Expo.plist │ ├── Info.plist │ ├── SplashScreen.storyboard │ └── AppDelegate.mm ├── expoblesample.xcworkspace │ └── contents.xcworkspacedata ├── .gitignore ├── .xcode.env ├── Podfile ├── expoblesample.xcodeproj │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── expoblesample.xcscheme │ └── project.pbxproj └── Podfile.lock ├── img ├── expo.png └── heart.png ├── assets ├── icon.png ├── splash.png ├── favicon.png └── adaptive-icon.png ├── tsconfig.json ├── babel.config.js ├── metro.config.js ├── .gitignore ├── eas.json ├── index.js ├── package.json ├── app.json ├── PulseIndicator.tsx ├── App.tsx ├── DeviceConnectionModal.tsx └── useBLE.ts /android/app/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ios/Podfile.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo.jsEngine": "jsc" 3 | } 4 | -------------------------------------------------------------------------------- /img/expo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/img/expo.png -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/assets/icon.png -------------------------------------------------------------------------------- /img/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/img/heart.png -------------------------------------------------------------------------------- /assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/assets/splash.png -------------------------------------------------------------------------------- /assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/assets/favicon.png -------------------------------------------------------------------------------- /assets/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/assets/adaptive-icon.png -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/debug.keystore -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "expo/tsconfig.base", 3 | "compilerOptions": { 4 | "strict": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "expo" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/expoblesample/noop-file.swift: -------------------------------------------------------------------------------- 1 | // 2 | // @generated 3 | // A blank Swift file must be created for native modules with Swift files to work correctly. 4 | // 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/drawable-hdpi/splashscreen_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/drawable-mdpi/splashscreen_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/SplashScreen.imageset/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/SplashScreen.imageset/image.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | // Learn more https://docs.expo.io/guides/customizing-metro 2 | const { getDefaultConfig } = require('expo/metro-config'); 3 | 4 | module.exports = getDefaultConfig(__dirname); 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | dist/ 4 | npm-debug.* 5 | *.jks 6 | *.p8 7 | *.p12 8 | *.key 9 | *.mobileprovision 10 | *.orig.* 11 | web-build/ 12 | 13 | # macOS 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/splashscreen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-20x20@1x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-20x20@2x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-20x20@3x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-29x29@1x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-29x29@2x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-29x29@3x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-40x40@1x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-40x40@2x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-40x40@3x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-60x60@2x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-60x60@3x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-76x76@1x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-76x76@2x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/SplashScreenBackground.imageset/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/SplashScreenBackground.imageset/image.png -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friyiajr/BLESampleExpo/HEAD/ios/expoblesample/Images.xcassets/AppIcon.appiconset/App-Icon-83.5x83.5@2x.png -------------------------------------------------------------------------------- /eas.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "development": { 4 | "developmentClient": true, 5 | "distribution": "internal" 6 | }, 7 | "preview": { 8 | "distribution": "internal" 9 | }, 10 | "production": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ios/expoblesample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | #import 6 | 7 | @interface AppDelegate : EXAppDelegateWrapper 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ios/expoblesample/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff 3 | #FFFFFF 4 | #023c69 5 | #ffffff 6 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Android/IntelliJ 6 | # 7 | build/ 8 | .idea 9 | .gradle 10 | local.properties 11 | *.iml 12 | *.hprof 13 | 14 | # BUCK 15 | buck-out/ 16 | \.buckd/ 17 | *.keystore 18 | !debug.keystore 19 | 20 | # Bundle artifacts 21 | *.jsbundle 22 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | expo-ble-sample 3 | contain 4 | false 5 | -------------------------------------------------------------------------------- /ios/expoblesample/expoblesample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ios/expoblesample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/app/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13) 2 | 3 | # Define the library name here. 4 | project(expoblesample_appmodules) 5 | 6 | # This file includes all the necessary to let you build your application with the New Architecture. 7 | include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake) 8 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { registerRootComponent } from 'expo'; 2 | 3 | import App from './App'; 4 | 5 | // registerRootComponent calls AppRegistry.registerComponent('main', () => App); 6 | // It also ensures that whether you load the app in Expo Go or in a native build, 7 | // the environment is set up appropriately 8 | registerRootComponent(App); 9 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string &moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/SplashScreen.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "universal", 5 | "filename": "image.png", 6 | "scale": "1x" 7 | }, 8 | { 9 | "idiom": "universal", 10 | "scale": "2x" 11 | }, 12 | { 13 | "idiom": "universal", 14 | "scale": "3x" 15 | } 16 | ], 17 | "info": { 18 | "version": 1, 19 | "author": "expo" 20 | } 21 | } -------------------------------------------------------------------------------- /android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/SplashScreenBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "universal", 5 | "filename": "image.png", 6 | "scale": "1x" 7 | }, 8 | { 9 | "idiom": "universal", 10 | "scale": "2x" 11 | }, 12 | { 13 | "idiom": "universal", 14 | "scale": "3x" 15 | } 16 | ], 17 | "info": { 18 | "version": 1, 19 | "author": "expo" 20 | } 21 | } -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | .xcode.env.local 25 | 26 | # Bundle artifacts 27 | *.jsbundle 28 | 29 | # CocoaPods 30 | /Pods/ 31 | -------------------------------------------------------------------------------- /ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /ios/expoblesample/Supporting/Expo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | EXUpdatesCheckOnLaunch 6 | ALWAYS 7 | EXUpdatesEnabled 8 | 9 | EXUpdatesLaunchWaitMs 10 | 0 11 | EXUpdatesSDKVersion 12 | 47.0.0 13 | EXUpdatesURL 14 | https://exp.host/@dfriyia2/expo-ble-sample 15 | 16 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # react-native-reanimated 11 | -keep class com.swmansion.reanimated.** { *; } 12 | -keep class com.facebook.react.turbomodule.** { *; } 13 | 14 | # Add any project specific keep options here: 15 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 14 | 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "expo-ble-sample", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "start": "expo start --dev-client", 6 | "android": "expo run:android", 7 | "ios": "expo run:ios", 8 | "web": "expo start --web" 9 | }, 10 | "dependencies": { 11 | "@config-plugins/react-native-ble-plx": "^5.0.0", 12 | "@shopify/react-native-skia": "0.1.157", 13 | "eas-cli": "^3.5.2", 14 | "expo": "~47.0.12", 15 | "expo-dev-client": "~2.0.1", 16 | "expo-device": "~5.0.0", 17 | "expo-splash-screen": "~0.17.5", 18 | "expo-status-bar": "~1.4.2", 19 | "react": "18.1.0", 20 | "react-dom": "18.1.0", 21 | "react-native": "0.70.5", 22 | "react-native-base64": "^0.2.1", 23 | "react-native-ble-plx": "^2.0.3", 24 | "react-native-web": "~0.18.9" 25 | }, 26 | "devDependencies": { 27 | "@babel/core": "^7.12.9", 28 | "@types/react": "~18.0.14", 29 | "@types/react-native": "~0.70.6", 30 | "@types/react-native-base64": "^0.2.0", 31 | "typescript": "^4.6.3" 32 | }, 33 | "private": true 34 | } 35 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/dfriyia2/expoblesample/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace facebook { 7 | namespace react { 8 | 9 | std::shared_ptr MainApplicationModuleProvider( 10 | const std::string &moduleName, 11 | const JavaTurboModule::InitParams ¶ms) { 12 | // Here you can provide your own module provider for TurboModules coming from 13 | // either your application or from external libraries. The approach to follow 14 | // is similar to the following (for a library called `samplelibrary`: 15 | // 16 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 17 | // if (module != nullptr) { 18 | // return module; 19 | // } 20 | // return rncore_ModuleProvider(moduleName, params); 21 | 22 | // Module providers autolinked by RN CLI 23 | auto rncli_module = rncli_ModuleProvider(moduleName, params); 24 | if (rncli_module != nullptr) { 25 | return rncli_module; 26 | } 27 | 28 | return rncore_ModuleProvider(moduleName, params); 29 | } 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'expo-ble-sample' 2 | 3 | apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle"); 4 | useExpoModules() 5 | 6 | apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle"); 7 | applyNativeModulesSettingsGradle(settings) 8 | 9 | include ':app' 10 | includeBuild(new File(["node", "--print", "require.resolve('react-native-gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile()) 11 | 12 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 13 | include(":ReactAndroid") 14 | project(":ReactAndroid").projectDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../ReactAndroid"); 15 | include(":ReactAndroid:hermes-engine") 16 | project(":ReactAndroid:hermes-engine").projectDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../ReactAndroid/hermes-engine"); 17 | } 18 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/dfriyia2/expoblesample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string &name, 25 | const std::shared_ptr &jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string &name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(const std::string &name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/dfriyia2/expoblesample/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.dfriyia2.expoblesample.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "expo-ble-sample", 4 | "slug": "expo-ble-sample", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/icon.png", 8 | "userInterfaceStyle": "light", 9 | "plugins": [ 10 | [ 11 | "@config-plugins/react-native-ble-plx", 12 | { 13 | "isBackgroundEnabled": true, 14 | "modes": ["peripheral", "central"], 15 | "bluetoothAlwaysPermission": "Allow $(PRODUCT_NAME) to connect to bluetooth devices" 16 | } 17 | ] 18 | ], 19 | "splash": { 20 | "image": "./assets/splash.png", 21 | "resizeMode": "contain", 22 | "backgroundColor": "#ffffff" 23 | }, 24 | "updates": { 25 | "fallbackToCacheTimeout": 0 26 | }, 27 | "assetBundlePatterns": ["**/*"], 28 | "ios": { 29 | "supportsTablet": true, 30 | "bundleIdentifier": "com.dfriyia2.expoblesample" 31 | }, 32 | "android": { 33 | "adaptiveIcon": { 34 | "foregroundImage": "./assets/adaptive-icon.png", 35 | "backgroundColor": "#FFFFFF" 36 | }, 37 | "permissions": [ 38 | "android.permission.BLUETOOTH", 39 | "android.permission.BLUETOOTH_ADMIN", 40 | "android.permission.BLUETOOTH_CONNECT" 41 | ], 42 | "package": "com.dfriyia2.expoblesample" 43 | }, 44 | "web": { 45 | "favicon": "./assets/favicon.png" 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.dfriyia2.expoblesample", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.dfriyia2.expoblesample", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /PulseIndicator.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import { 4 | Canvas, 5 | Circle, 6 | Image, 7 | useClockValue, 8 | useComputedValue, 9 | useImage, 10 | } from "@shopify/react-native-skia"; 11 | import { View } from "react-native"; 12 | 13 | export const PulseIndicator = () => { 14 | const clock1 = useClockValue(); 15 | const expo = useImage(require("./img/expo.png")); 16 | const heart = useImage(require("./img/heart.png")); 17 | 18 | const interval = 1250; 19 | 20 | const scale = useComputedValue(() => { 21 | return ((clock1.current % interval) / interval) * 130; 22 | }, [clock1]); 23 | 24 | const opacity = useComputedValue(() => { 25 | return 0.9 - (clock1.current % interval) / interval; 26 | }, [clock1]); 27 | 28 | const scale2 = useComputedValue(() => { 29 | return (((clock1.current + 400) % interval) / interval) * 130; 30 | }, [clock1]); 31 | 32 | const opacity2 = useComputedValue(() => { 33 | return 0.9 - ((clock1.current + 400) % interval) / interval; 34 | }, [clock1]); 35 | 36 | if (!expo || !heart) { 37 | return ; 38 | } 39 | 40 | return ( 41 | 42 | 43 | 44 | 45 | 53 | 54 | ); 55 | }; 56 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string &name, 26 | const std::shared_ptr &jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string &name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | const std::string &name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/dfriyia2/expoblesample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java: -------------------------------------------------------------------------------- 1 | package com.dfriyia2.expoblesample.newarchitecture.modules; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.soloader.SoLoader; 8 | import java.util.List; 9 | 10 | /** 11 | * Class responsible to load the TurboModules. This class has native methods and needs a 12 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 13 | * folder for you). 14 | * 15 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 16 | * `newArchEnabled` property). Is ignored otherwise. 17 | */ 18 | public class MainApplicationTurboModuleManagerDelegate 19 | extends ReactPackageTurboModuleManagerDelegate { 20 | 21 | private static volatile boolean sIsSoLibraryLoaded; 22 | 23 | protected MainApplicationTurboModuleManagerDelegate( 24 | ReactApplicationContext reactApplicationContext, List packages) { 25 | super(reactApplicationContext, packages); 26 | } 27 | 28 | protected native HybridData initHybrid(); 29 | 30 | native boolean canCreateTurboModule(String moduleName); 31 | 32 | public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { 33 | protected MainApplicationTurboModuleManagerDelegate build( 34 | ReactApplicationContext context, List packages) { 35 | return new MainApplicationTurboModuleManagerDelegate(context, packages); 36 | } 37 | } 38 | 39 | @Override 40 | protected synchronized void maybeLoadOtherSoLibraries() { 41 | if (!sIsSoLibraryLoaded) { 42 | // If you change the name of your application .so file in the Android.mk file, 43 | // make sure you update the name here as well. 44 | SoLoader.loadLibrary("expoblesample_appmodules"); 45 | sIsSoLibraryLoaded = true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | 25 | # Automatically convert third-party libraries to use AndroidX 26 | android.enableJetifier=true 27 | 28 | # Version of flipper SDK to use with React Native 29 | FLIPPER_VERSION=0.125.0 30 | 31 | # Use this property to specify which architecture you want to build. 32 | # You can also override it from the CLI using 33 | # ./gradlew -PreactNativeArchitectures=x86_64 34 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 35 | 36 | # Use this property to enable support to the new architecture. 37 | # This will allow you to use TurboModules and the Fabric render in 38 | # your application. You should enable this flag either if you want 39 | # to write custom TurboModules/Fabric components OR use libraries that 40 | # are providing them. 41 | newArchEnabled=false 42 | 43 | # The hosted JavaScript engine 44 | # Supported values: expo.jsEngine = "hermes" | "jsc" 45 | expo.jsEngine=jsc 46 | 47 | # Enable GIF support in React Native images (~200 B increase) 48 | expo.gif.enabled=true 49 | # Enable webp support in React Native images (~85 KB increase) 50 | expo.webp.enabled=true 51 | # Enable animated webp support (~3.4 MB increase) 52 | # Disabled by default because iOS doesn't support animated webp 53 | expo.webp.animated=false 54 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainComponentsRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "MainComponentsRegistry.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace facebook { 10 | namespace react { 11 | 12 | MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} 13 | 14 | std::shared_ptr 15 | MainComponentsRegistry::sharedProviderRegistry() { 16 | auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); 17 | 18 | // Autolinked providers registered by RN CLI 19 | rncli_registerProviders(providerRegistry); 20 | 21 | // Custom Fabric Components go here. You can register custom 22 | // components coming from your App or from 3rd party libraries here. 23 | // 24 | // providerRegistry->add(concreteComponentDescriptorProvider< 25 | // AocViewerComponentDescriptor>()); 26 | return providerRegistry; 27 | } 28 | 29 | jni::local_ref 30 | MainComponentsRegistry::initHybrid( 31 | jni::alias_ref, 32 | ComponentFactory *delegate) { 33 | auto instance = makeCxxInstance(delegate); 34 | 35 | auto buildRegistryFunction = 36 | [](EventDispatcher::Weak const &eventDispatcher, 37 | ContextContainer::Shared const &contextContainer) 38 | -> ComponentDescriptorRegistry::Shared { 39 | auto registry = MainComponentsRegistry::sharedProviderRegistry() 40 | ->createComponentDescriptorRegistry( 41 | {eventDispatcher, contextContainer}); 42 | 43 | auto mutableRegistry = 44 | std::const_pointer_cast(registry); 45 | 46 | mutableRegistry->setFallbackComponentDescriptor( 47 | std::make_shared( 48 | ComponentDescriptorParameters{ 49 | eventDispatcher, contextContainer, nullptr})); 50 | 51 | return registry; 52 | }; 53 | 54 | delegate->buildRegistryFunction = buildRegistryFunction; 55 | return instance; 56 | } 57 | 58 | void MainComponentsRegistry::registerNatives() { 59 | registerHybrid({ 60 | makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), 61 | }); 62 | } 63 | 64 | } // namespace react 65 | } // namespace facebook 66 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") 2 | require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods") 3 | require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules") 4 | 5 | require 'json' 6 | podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {} 7 | 8 | platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0' 9 | install! 'cocoapods', 10 | :deterministic_uuids => false 11 | 12 | target 'expoblesample' do 13 | use_expo_modules! 14 | config = use_native_modules! 15 | 16 | use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks'] 17 | 18 | # Flags change depending on the env values. 19 | flags = get_default_flags() 20 | 21 | use_react_native!( 22 | :path => config[:reactNativePath], 23 | :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes', 24 | :fabric_enabled => flags[:fabric_enabled], 25 | # An absolute path to your application root. 26 | :app_path => "#{Pod::Config.instance.installation_root}/..", 27 | # 28 | # Uncomment to opt-in to using Flipper 29 | # Note that if you have use_frameworks! enabled, Flipper will not work 30 | # :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled : FlipperConfiguration.disabled, 31 | ) 32 | 33 | post_install do |installer| 34 | react_native_post_install( 35 | installer, 36 | # Set `mac_catalyst_enabled` to `true` in order to apply patches 37 | # necessary for Mac Catalyst builds 38 | :mac_catalyst_enabled => false 39 | ) 40 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 41 | 42 | # This is necessary for Xcode 14, because it signs resource bundles by default 43 | # when building for devices. 44 | installer.target_installation_results.pod_target_installation_results 45 | .each do |pod_name, target_installation_result| 46 | target_installation_result.resource_bundle_targets.each do |resource_bundle_target| 47 | resource_bundle_target.build_configurations.each do |config| 48 | config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' 49 | end 50 | end 51 | end 52 | end 53 | 54 | post_integrate do |installer| 55 | begin 56 | expo_patch_react_imports!(installer) 57 | rescue => e 58 | Pod::UI.warn e 59 | end 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0' 6 | minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21') 7 | compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31') 8 | targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31') 9 | if (findProperty('android.kotlinVersion')) { 10 | kotlinVersion = findProperty('android.kotlinVersion') 11 | } 12 | frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0' 13 | 14 | if (System.properties['os.arch'] == 'aarch64') { 15 | // For M1 Users we need to use the NDK 24 which added support for aarch64 16 | ndkVersion = '24.0.8215888' 17 | } else { 18 | // Otherwise we default to the side-by-side NDK version from AGP. 19 | ndkVersion = '21.4.7075529' 20 | } 21 | } 22 | repositories { 23 | google() 24 | mavenCentral() 25 | } 26 | dependencies { 27 | classpath('com.android.tools.build:gradle:7.2.1') 28 | classpath('com.facebook.react:react-native-gradle-plugin') 29 | classpath('de.undercouch:gradle-download-task:5.0.1') 30 | // NOTE: Do not place your application dependencies here; they belong 31 | // in the individual module build.gradle files 32 | } 33 | } 34 | 35 | def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim()) 36 | 37 | allprojects { 38 | configurations.all { 39 | resolutionStrategy { 40 | force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION 41 | } 42 | } 43 | 44 | repositories { 45 | mavenLocal() 46 | maven { 47 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 48 | url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android')) 49 | } 50 | maven { 51 | // Android JSC is installed from npm 52 | url(new File(['node', '--print', "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), '../dist')) 53 | } 54 | 55 | google() 56 | mavenCentral { 57 | // We don't want to fetch react-native from Maven Central as there are 58 | // older versions over there. 59 | content { 60 | excludeGroup 'com.facebook.react' 61 | } 62 | } 63 | maven { url 'https://www.jitpack.io' } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /ios/expoblesample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | expo-ble-sample 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleURLTypes 24 | 25 | 26 | CFBundleURLSchemes 27 | 28 | com.dfriyia2.expoblesample 29 | 30 | 31 | 32 | CFBundleVersion 33 | 1 34 | LSRequiresIPhoneOS 35 | 36 | NSAppTransportSecurity 37 | 38 | NSAllowsArbitraryLoads 39 | 40 | NSExceptionDomains 41 | 42 | localhost 43 | 44 | NSExceptionAllowsInsecureHTTPLoads 45 | 46 | 47 | 48 | 49 | NSBluetoothAlwaysUsageDescription 50 | Allow $(PRODUCT_NAME) to connect to bluetooth devices 51 | UIBackgroundModes 52 | 53 | bluetooth-central 54 | bluetooth-peripheral 55 | 56 | UILaunchStoryboardName 57 | SplashScreen 58 | UIRequiredDeviceCapabilities 59 | 60 | armv7 61 | 62 | UIRequiresFullScreen 63 | 64 | UIStatusBarStyle 65 | UIStatusBarStyleDefault 66 | UISupportedInterfaceOrientations 67 | 68 | UIInterfaceOrientationPortrait 69 | UIInterfaceOrientationPortraitUpsideDown 70 | 71 | UISupportedInterfaceOrientations~ipad 72 | 73 | UIInterfaceOrientationPortrait 74 | UIInterfaceOrientationPortraitUpsideDown 75 | UIInterfaceOrientationLandscapeLeft 76 | UIInterfaceOrientationLandscapeRight 77 | 78 | UIUserInterfaceStyle 79 | Light 80 | UIViewControllerBasedStatusBarAppearance 81 | 82 | 83 | -------------------------------------------------------------------------------- /App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { 3 | SafeAreaView, 4 | StyleSheet, 5 | Text, 6 | TouchableOpacity, 7 | View, 8 | } from "react-native"; 9 | import DeviceModal from "./DeviceConnectionModal"; 10 | import { PulseIndicator } from "./PulseIndicator"; 11 | import useBLE from "./useBLE"; 12 | 13 | const App = () => { 14 | const { 15 | requestPermissions, 16 | scanForPeripherals, 17 | allDevices, 18 | connectToDevice, 19 | connectedDevice, 20 | heartRate, 21 | disconnectFromDevice, 22 | } = useBLE(); 23 | const [isModalVisible, setIsModalVisible] = useState(false); 24 | 25 | const scanForDevices = async () => { 26 | const isPermissionsEnabled = await requestPermissions(); 27 | if (isPermissionsEnabled) { 28 | scanForPeripherals(); 29 | } 30 | }; 31 | 32 | const hideModal = () => { 33 | setIsModalVisible(false); 34 | }; 35 | 36 | const openModal = async () => { 37 | scanForDevices(); 38 | setIsModalVisible(true); 39 | }; 40 | 41 | return ( 42 | 43 | 44 | {connectedDevice ? ( 45 | <> 46 | 47 | Your Heart Rate Is: 48 | {heartRate} bpm 49 | 50 | ) : ( 51 | 52 | Please Connect to a Heart Rate Monitor 53 | 54 | )} 55 | 56 | 60 | 61 | {connectedDevice ? "Disconnect" : "Connect"} 62 | 63 | 64 | 70 | 71 | ); 72 | }; 73 | 74 | const styles = StyleSheet.create({ 75 | container: { 76 | flex: 1, 77 | backgroundColor: "#f2f2f2", 78 | }, 79 | heartRateTitleWrapper: { 80 | flex: 1, 81 | justifyContent: "center", 82 | alignItems: "center", 83 | }, 84 | heartRateTitleText: { 85 | fontSize: 30, 86 | fontWeight: "bold", 87 | textAlign: "center", 88 | marginHorizontal: 20, 89 | color: "black", 90 | }, 91 | heartRateText: { 92 | fontSize: 25, 93 | marginTop: 15, 94 | }, 95 | ctaButton: { 96 | backgroundColor: "#FF6060", 97 | justifyContent: "center", 98 | alignItems: "center", 99 | height: 50, 100 | marginHorizontal: 20, 101 | marginBottom: 5, 102 | borderRadius: 8, 103 | }, 104 | ctaButtonText: { 105 | fontSize: 18, 106 | fontWeight: "bold", 107 | color: "white", 108 | }, 109 | }); 110 | 111 | export default App; 112 | -------------------------------------------------------------------------------- /ios/expoblesample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "iphone", 5 | "size": "20x20", 6 | "scale": "2x", 7 | "filename": "App-Icon-20x20@2x.png" 8 | }, 9 | { 10 | "idiom": "iphone", 11 | "size": "20x20", 12 | "scale": "3x", 13 | "filename": "App-Icon-20x20@3x.png" 14 | }, 15 | { 16 | "idiom": "iphone", 17 | "size": "29x29", 18 | "scale": "1x", 19 | "filename": "App-Icon-29x29@1x.png" 20 | }, 21 | { 22 | "idiom": "iphone", 23 | "size": "29x29", 24 | "scale": "2x", 25 | "filename": "App-Icon-29x29@2x.png" 26 | }, 27 | { 28 | "idiom": "iphone", 29 | "size": "29x29", 30 | "scale": "3x", 31 | "filename": "App-Icon-29x29@3x.png" 32 | }, 33 | { 34 | "idiom": "iphone", 35 | "size": "40x40", 36 | "scale": "2x", 37 | "filename": "App-Icon-40x40@2x.png" 38 | }, 39 | { 40 | "idiom": "iphone", 41 | "size": "40x40", 42 | "scale": "3x", 43 | "filename": "App-Icon-40x40@3x.png" 44 | }, 45 | { 46 | "idiom": "iphone", 47 | "size": "60x60", 48 | "scale": "2x", 49 | "filename": "App-Icon-60x60@2x.png" 50 | }, 51 | { 52 | "idiom": "iphone", 53 | "size": "60x60", 54 | "scale": "3x", 55 | "filename": "App-Icon-60x60@3x.png" 56 | }, 57 | { 58 | "idiom": "ipad", 59 | "size": "20x20", 60 | "scale": "1x", 61 | "filename": "App-Icon-20x20@1x.png" 62 | }, 63 | { 64 | "idiom": "ipad", 65 | "size": "20x20", 66 | "scale": "2x", 67 | "filename": "App-Icon-20x20@2x.png" 68 | }, 69 | { 70 | "idiom": "ipad", 71 | "size": "29x29", 72 | "scale": "1x", 73 | "filename": "App-Icon-29x29@1x.png" 74 | }, 75 | { 76 | "idiom": "ipad", 77 | "size": "29x29", 78 | "scale": "2x", 79 | "filename": "App-Icon-29x29@2x.png" 80 | }, 81 | { 82 | "idiom": "ipad", 83 | "size": "40x40", 84 | "scale": "1x", 85 | "filename": "App-Icon-40x40@1x.png" 86 | }, 87 | { 88 | "idiom": "ipad", 89 | "size": "40x40", 90 | "scale": "2x", 91 | "filename": "App-Icon-40x40@2x.png" 92 | }, 93 | { 94 | "idiom": "ipad", 95 | "size": "76x76", 96 | "scale": "1x", 97 | "filename": "App-Icon-76x76@1x.png" 98 | }, 99 | { 100 | "idiom": "ipad", 101 | "size": "76x76", 102 | "scale": "2x", 103 | "filename": "App-Icon-76x76@2x.png" 104 | }, 105 | { 106 | "idiom": "ipad", 107 | "size": "83.5x83.5", 108 | "scale": "2x", 109 | "filename": "App-Icon-83.5x83.5@2x.png" 110 | }, 111 | { 112 | "idiom": "ios-marketing", 113 | "size": "1024x1024", 114 | "scale": "1x", 115 | "filename": "ItunesArtwork@2x.png" 116 | } 117 | ], 118 | "info": { 119 | "version": 1, 120 | "author": "expo" 121 | } 122 | } -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if %ERRORLEVEL% equ 0 goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if %ERRORLEVEL% equ 0 goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | set EXIT_CODE=%ERRORLEVEL% 84 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 85 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 86 | exit /b %EXIT_CODE% 87 | 88 | :mainEnd 89 | if "%OS%"=="Windows_NT" endlocal 90 | 91 | :omega 92 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/dfriyia2/expoblesample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.dfriyia2.expoblesample; 2 | 3 | import android.os.Build; 4 | import android.os.Bundle; 5 | 6 | import com.facebook.react.ReactActivity; 7 | import com.facebook.react.ReactActivityDelegate; 8 | import com.facebook.react.ReactRootView; 9 | 10 | import expo.modules.ReactActivityDelegateWrapper; 11 | 12 | public class MainActivity extends ReactActivity { 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | // Set the theme to AppTheme BEFORE onCreate to support 16 | // coloring the background, status bar, and navigation bar. 17 | // This is required for expo-splash-screen. 18 | setTheme(R.style.AppTheme); 19 | super.onCreate(null); 20 | } 21 | 22 | /** 23 | * Returns the name of the main component registered from JavaScript. 24 | * This is used to schedule rendering of the component. 25 | */ 26 | @Override 27 | protected String getMainComponentName() { 28 | return "main"; 29 | } 30 | 31 | /** 32 | * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and 33 | * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer 34 | * (Paper). 35 | */ 36 | @Override 37 | protected ReactActivityDelegate createReactActivityDelegate() { 38 | return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, 39 | new MainActivityDelegate(this, getMainComponentName()) 40 | ); 41 | } 42 | 43 | /** 44 | * Align the back button behavior with Android S 45 | * where moving root activities to background instead of finishing activities. 46 | * @see onBackPressed 47 | */ 48 | @Override 49 | public void invokeDefaultOnBackPressed() { 50 | if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) { 51 | if (!moveTaskToBack(false)) { 52 | // For non-root activities, use the default implementation to finish them. 53 | super.invokeDefaultOnBackPressed(); 54 | } 55 | return; 56 | } 57 | 58 | // Use the default back button implementation on Android S 59 | // because it's doing more than {@link Activity#moveTaskToBack} in fact. 60 | super.invokeDefaultOnBackPressed(); 61 | } 62 | 63 | public static class MainActivityDelegate extends ReactActivityDelegate { 64 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) { 65 | super(activity, mainComponentName); 66 | } 67 | 68 | @Override 69 | protected ReactRootView createRootView() { 70 | ReactRootView reactRootView = new ReactRootView(getContext()); 71 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 72 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); 73 | return reactRootView; 74 | } 75 | 76 | @Override 77 | protected boolean isConcurrentRootEnabled() { 78 | // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). 79 | // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html 80 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /DeviceConnectionModal.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC, useCallback } from "react"; 2 | import { 3 | FlatList, 4 | ListRenderItemInfo, 5 | Modal, 6 | SafeAreaView, 7 | Text, 8 | StyleSheet, 9 | TouchableOpacity, 10 | } from "react-native"; 11 | import { Device } from "react-native-ble-plx"; 12 | 13 | type DeviceModalListItemProps = { 14 | item: ListRenderItemInfo; 15 | connectToPeripheral: (device: Device) => void; 16 | closeModal: () => void; 17 | }; 18 | 19 | type DeviceModalProps = { 20 | devices: Device[]; 21 | visible: boolean; 22 | connectToPeripheral: (device: Device) => void; 23 | closeModal: () => void; 24 | }; 25 | 26 | const DeviceModalListItem: FC = (props) => { 27 | const { item, connectToPeripheral, closeModal } = props; 28 | 29 | const connectAndCloseModal = useCallback(() => { 30 | connectToPeripheral(item.item); 31 | closeModal(); 32 | }, [closeModal, connectToPeripheral, item.item]); 33 | 34 | return ( 35 | 39 | {item.item.name} 40 | 41 | ); 42 | }; 43 | 44 | const DeviceModal: FC = (props) => { 45 | const { devices, visible, connectToPeripheral, closeModal } = props; 46 | 47 | const renderDeviceModalListItem = useCallback( 48 | (item: ListRenderItemInfo) => { 49 | return ( 50 | 55 | ); 56 | }, 57 | [closeModal, connectToPeripheral] 58 | ); 59 | 60 | return ( 61 | 67 | 68 | 69 | Tap on a device to connect 70 | 71 | 76 | 77 | 78 | ); 79 | }; 80 | 81 | const modalStyle = StyleSheet.create({ 82 | modalContainer: { 83 | flex: 1, 84 | backgroundColor: "#f2f2f2", 85 | }, 86 | modalFlatlistContiner: { 87 | flex: 1, 88 | justifyContent: "center", 89 | }, 90 | modalCellOutline: { 91 | borderWidth: 1, 92 | borderColor: "black", 93 | alignItems: "center", 94 | marginHorizontal: 20, 95 | paddingVertical: 15, 96 | borderRadius: 8, 97 | }, 98 | modalTitle: { 99 | flex: 1, 100 | backgroundColor: "#f2f2f2", 101 | }, 102 | modalTitleText: { 103 | marginTop: 40, 104 | fontSize: 30, 105 | fontWeight: "bold", 106 | marginHorizontal: 20, 107 | textAlign: "center", 108 | }, 109 | ctaButton: { 110 | backgroundColor: "#FF6060", 111 | justifyContent: "center", 112 | alignItems: "center", 113 | height: 50, 114 | marginHorizontal: 20, 115 | marginBottom: 5, 116 | borderRadius: 8, 117 | }, 118 | ctaButtonText: { 119 | fontSize: 18, 120 | fontWeight: "bold", 121 | color: "white", 122 | }, 123 | }); 124 | 125 | export default DeviceModal; 126 | -------------------------------------------------------------------------------- /android/app/src/debug/java/com/dfriyia2/expoblesample/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.dfriyia2.expoblesample; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 32 | client.addPlugin(new ReactFlipperPlugin()); 33 | client.addPlugin(new DatabasesFlipperPlugin(context)); 34 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 35 | client.addPlugin(CrashReporterPlugin.getInstance()); 36 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 37 | NetworkingModule.setCustomClientBuilder( 38 | new NetworkingModule.CustomClientBuilder() { 39 | @Override 40 | public void apply(OkHttpClient.Builder builder) { 41 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 42 | } 43 | }); 44 | client.addPlugin(networkFlipperPlugin); 45 | client.start(); 46 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 47 | // Hence we run if after all native modules have been initialized 48 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 49 | if (reactContext == null) { 50 | reactInstanceManager.addReactInstanceEventListener( 51 | new ReactInstanceManager.ReactInstanceEventListener() { 52 | @Override 53 | public void onReactContextInitialized(ReactContext reactContext) { 54 | reactInstanceManager.removeReactInstanceEventListener(this); 55 | reactContext.runOnNativeModulesQueueThread( 56 | new Runnable() { 57 | @Override 58 | public void run() { 59 | client.addPlugin(new FrescoFlipperPlugin()); 60 | } 61 | }); 62 | } 63 | }); 64 | } else { 65 | client.addPlugin(new FrescoFlipperPlugin()); 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /ios/expoblesample.xcodeproj/xcshareddata/xcschemes/expoblesample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/dfriyia2/expoblesample/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.dfriyia2.expoblesample; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import android.content.res.Configuration; 6 | import androidx.annotation.NonNull; 7 | 8 | import com.facebook.react.PackageList; 9 | import com.facebook.react.ReactApplication; 10 | import com.facebook.react.ReactInstanceManager; 11 | import com.facebook.react.ReactNativeHost; 12 | import com.facebook.react.ReactPackage; 13 | import com.facebook.react.config.ReactFeatureFlags; 14 | import com.facebook.soloader.SoLoader; 15 | import com.dfriyia2.expoblesample.newarchitecture.MainApplicationReactNativeHost; 16 | 17 | import expo.modules.ApplicationLifecycleDispatcher; 18 | import expo.modules.ReactNativeHostWrapper; 19 | 20 | import java.lang.reflect.InvocationTargetException; 21 | import java.util.List; 22 | 23 | public class MainApplication extends Application implements ReactApplication { 24 | private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper( 25 | this, 26 | new ReactNativeHost(this) { 27 | @Override 28 | public boolean getUseDeveloperSupport() { 29 | return BuildConfig.DEBUG; 30 | } 31 | 32 | @Override 33 | protected List getPackages() { 34 | @SuppressWarnings("UnnecessaryLocalVariable") 35 | List packages = new PackageList(this).getPackages(); 36 | // Packages that cannot be autolinked yet can be added manually here, for example: 37 | // packages.add(new MyReactNativePackage()); 38 | return packages; 39 | } 40 | 41 | @Override 42 | protected String getJSMainModuleName() { 43 | return "index"; 44 | } 45 | }); 46 | 47 | private final ReactNativeHost mNewArchitectureNativeHost = 48 | new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this)); 49 | 50 | @Override 51 | public ReactNativeHost getReactNativeHost() { 52 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 53 | return mNewArchitectureNativeHost; 54 | } else { 55 | return mReactNativeHost; 56 | } 57 | } 58 | 59 | @Override 60 | public void onCreate() { 61 | super.onCreate(); 62 | // If you opted-in for the New Architecture, we enable the TurboModule system 63 | ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 64 | SoLoader.init(this, /* native exopackage */ false); 65 | 66 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 67 | ApplicationLifecycleDispatcher.onApplicationCreate(this); 68 | } 69 | 70 | @Override 71 | public void onConfigurationChanged(@NonNull Configuration newConfig) { 72 | super.onConfigurationChanged(newConfig); 73 | ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig); 74 | } 75 | 76 | /** 77 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 78 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 79 | * 80 | * @param context 81 | * @param reactInstanceManager 82 | */ 83 | private static void initializeFlipper( 84 | Context context, ReactInstanceManager reactInstanceManager) { 85 | if (BuildConfig.DEBUG) { 86 | try { 87 | /* 88 | We use reflection here to pick up the class that initializes Flipper, 89 | since Flipper library is not available in release mode 90 | */ 91 | Class aClass = Class.forName("com.dfriyia2.expoblesample.ReactNativeFlipper"); 92 | aClass 93 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 94 | .invoke(null, context, reactInstanceManager); 95 | } catch (ClassNotFoundException e) { 96 | e.printStackTrace(); 97 | } catch (NoSuchMethodException e) { 98 | e.printStackTrace(); 99 | } catch (IllegalAccessException e) { 100 | e.printStackTrace(); 101 | } catch (InvocationTargetException e) { 102 | e.printStackTrace(); 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /ios/expoblesample/SplashScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/dfriyia2/expoblesample/newarchitecture/MainApplicationReactNativeHost.java: -------------------------------------------------------------------------------- 1 | package com.dfriyia2.expoblesample.newarchitecture; 2 | 3 | import android.app.Application; 4 | import androidx.annotation.NonNull; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactInstanceManager; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 10 | import com.facebook.react.bridge.JSIModulePackage; 11 | import com.facebook.react.bridge.JSIModuleProvider; 12 | import com.facebook.react.bridge.JSIModuleSpec; 13 | import com.facebook.react.bridge.JSIModuleType; 14 | import com.facebook.react.bridge.JavaScriptContextHolder; 15 | import com.facebook.react.bridge.ReactApplicationContext; 16 | import com.facebook.react.bridge.UIManager; 17 | import com.facebook.react.fabric.ComponentFactory; 18 | import com.facebook.react.fabric.CoreComponentsRegistry; 19 | import com.facebook.react.fabric.EmptyReactNativeConfig; 20 | import com.facebook.react.fabric.FabricJSIModuleProvider; 21 | import com.facebook.react.fabric.ReactNativeConfig; 22 | import com.facebook.react.uimanager.ViewManagerRegistry; 23 | import com.dfriyia2.expoblesample.BuildConfig; 24 | import com.dfriyia2.expoblesample.newarchitecture.components.MainComponentsRegistry; 25 | import com.dfriyia2.expoblesample.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; 26 | import java.util.ArrayList; 27 | import java.util.List; 28 | 29 | /** 30 | * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both 31 | * TurboModule delegates and the Fabric Renderer. 32 | * 33 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 34 | * `newArchEnabled` property). Is ignored otherwise. 35 | */ 36 | public class MainApplicationReactNativeHost extends ReactNativeHost { 37 | public MainApplicationReactNativeHost(Application application) { 38 | super(application); 39 | } 40 | 41 | @Override 42 | public boolean getUseDeveloperSupport() { 43 | return BuildConfig.DEBUG; 44 | } 45 | 46 | @Override 47 | protected List getPackages() { 48 | List packages = new PackageList(this).getPackages(); 49 | // Packages that cannot be autolinked yet can be added manually here, for example: 50 | // packages.add(new MyReactNativePackage()); 51 | // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: 52 | // packages.add(new TurboReactPackage() { ... }); 53 | // If you have custom Fabric Components, their ViewManagers should also be loaded here 54 | // inside a ReactPackage. 55 | return packages; 56 | } 57 | 58 | @Override 59 | protected String getJSMainModuleName() { 60 | return "index"; 61 | } 62 | 63 | @NonNull 64 | @Override 65 | protected ReactPackageTurboModuleManagerDelegate.Builder 66 | getReactPackageTurboModuleManagerDelegateBuilder() { 67 | // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary 68 | // for the new architecture and to use TurboModules correctly. 69 | return new MainApplicationTurboModuleManagerDelegate.Builder(); 70 | } 71 | 72 | @Override 73 | protected JSIModulePackage getJSIModulePackage() { 74 | return new JSIModulePackage() { 75 | @Override 76 | public List getJSIModules( 77 | final ReactApplicationContext reactApplicationContext, 78 | final JavaScriptContextHolder jsContext) { 79 | final List specs = new ArrayList<>(); 80 | 81 | // Here we provide a new JSIModuleSpec that will be responsible of providing the 82 | // custom Fabric Components. 83 | specs.add( 84 | new JSIModuleSpec() { 85 | @Override 86 | public JSIModuleType getJSIModuleType() { 87 | return JSIModuleType.UIManager; 88 | } 89 | 90 | @Override 91 | public JSIModuleProvider getJSIModuleProvider() { 92 | final ComponentFactory componentFactory = new ComponentFactory(); 93 | CoreComponentsRegistry.register(componentFactory); 94 | 95 | // Here we register a Components Registry. 96 | // The one that is generated with the template contains no components 97 | // and just provides you the one from React Native core. 98 | MainComponentsRegistry.register(componentFactory); 99 | 100 | final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); 101 | 102 | ViewManagerRegistry viewManagerRegistry = 103 | new ViewManagerRegistry( 104 | reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); 105 | 106 | return new FabricJSIModuleProvider( 107 | reactApplicationContext, 108 | componentFactory, 109 | ReactNativeConfig.DEFAULT_CONFIG, 110 | viewManagerRegistry); 111 | } 112 | }); 113 | return specs; 114 | } 115 | }; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /useBLE.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-bitwise */ 2 | import { useMemo, useState } from "react"; 3 | import { PermissionsAndroid, Platform } from "react-native"; 4 | import { 5 | BleError, 6 | BleManager, 7 | Characteristic, 8 | Device, 9 | } from "react-native-ble-plx"; 10 | 11 | import * as ExpoDevice from "expo-device"; 12 | 13 | import base64 from "react-native-base64"; 14 | 15 | const HEART_RATE_UUID = "0000180d-0000-1000-8000-00805f9b34fb"; 16 | const HEART_RATE_CHARACTERISTIC = "00002a37-0000-1000-8000-00805f9b34fb"; 17 | 18 | interface BluetoothLowEnergyApi { 19 | requestPermissions(): Promise; 20 | scanForPeripherals(): void; 21 | connectToDevice: (deviceId: Device) => Promise; 22 | disconnectFromDevice: () => void; 23 | connectedDevice: Device | null; 24 | allDevices: Device[]; 25 | heartRate: number; 26 | } 27 | 28 | function useBLE(): BluetoothLowEnergyApi { 29 | const bleManager = useMemo(() => new BleManager(), []); 30 | const [allDevices, setAllDevices] = useState([]); 31 | const [connectedDevice, setConnectedDevice] = useState(null); 32 | const [heartRate, setHeartRate] = useState(0); 33 | 34 | const requestAndroid31Permissions = async () => { 35 | const bluetoothScanPermission = await PermissionsAndroid.request( 36 | PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN, 37 | { 38 | title: "Location Permission", 39 | message: "Bluetooth Low Energy requires Location", 40 | buttonPositive: "OK", 41 | } 42 | ); 43 | const bluetoothConnectPermission = await PermissionsAndroid.request( 44 | PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT, 45 | { 46 | title: "Location Permission", 47 | message: "Bluetooth Low Energy requires Location", 48 | buttonPositive: "OK", 49 | } 50 | ); 51 | const fineLocationPermission = await PermissionsAndroid.request( 52 | PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, 53 | { 54 | title: "Location Permission", 55 | message: "Bluetooth Low Energy requires Location", 56 | buttonPositive: "OK", 57 | } 58 | ); 59 | 60 | return ( 61 | bluetoothScanPermission === "granted" && 62 | bluetoothConnectPermission === "granted" && 63 | fineLocationPermission === "granted" 64 | ); 65 | }; 66 | 67 | const requestPermissions = async () => { 68 | if (Platform.OS === "android") { 69 | if ((ExpoDevice.platformApiLevel ?? -1) < 31) { 70 | const granted = await PermissionsAndroid.request( 71 | PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, 72 | { 73 | title: "Location Permission", 74 | message: "Bluetooth Low Energy requires Location", 75 | buttonPositive: "OK", 76 | } 77 | ); 78 | return granted === PermissionsAndroid.RESULTS.GRANTED; 79 | } else { 80 | const isAndroid31PermissionsGranted = 81 | await requestAndroid31Permissions(); 82 | 83 | return isAndroid31PermissionsGranted; 84 | } 85 | } else { 86 | return true; 87 | } 88 | }; 89 | 90 | const isDuplicteDevice = (devices: Device[], nextDevice: Device) => 91 | devices.findIndex((device) => nextDevice.id === device.id) > -1; 92 | 93 | const scanForPeripherals = () => 94 | bleManager.startDeviceScan(null, null, (error, device) => { 95 | if (error) { 96 | console.log(error); 97 | } 98 | if (device && device.name?.includes("CorSense")) { 99 | setAllDevices((prevState: Device[]) => { 100 | if (!isDuplicteDevice(prevState, device)) { 101 | return [...prevState, device]; 102 | } 103 | return prevState; 104 | }); 105 | } 106 | }); 107 | 108 | const connectToDevice = async (device: Device) => { 109 | try { 110 | const deviceConnection = await bleManager.connectToDevice(device.id); 111 | setConnectedDevice(deviceConnection); 112 | await deviceConnection.discoverAllServicesAndCharacteristics(); 113 | bleManager.stopDeviceScan(); 114 | startStreamingData(deviceConnection); 115 | } catch (e) { 116 | console.log("FAILED TO CONNECT", e); 117 | } 118 | }; 119 | 120 | const disconnectFromDevice = () => { 121 | if (connectedDevice) { 122 | bleManager.cancelDeviceConnection(connectedDevice.id); 123 | setConnectedDevice(null); 124 | setHeartRate(0); 125 | } 126 | }; 127 | 128 | const onHeartRateUpdate = ( 129 | error: BleError | null, 130 | characteristic: Characteristic | null 131 | ) => { 132 | if (error) { 133 | console.log(error); 134 | return -1; 135 | } else if (!characteristic?.value) { 136 | console.log("No Data was recieved"); 137 | return -1; 138 | } 139 | 140 | const rawData = base64.decode(characteristic.value); 141 | let innerHeartRate: number = -1; 142 | 143 | const firstBitValue: number = Number(rawData) & 0x01; 144 | 145 | if (firstBitValue === 0) { 146 | innerHeartRate = rawData[1].charCodeAt(0); 147 | } else { 148 | innerHeartRate = 149 | Number(rawData[1].charCodeAt(0) << 8) + 150 | Number(rawData[2].charCodeAt(2)); 151 | } 152 | 153 | setHeartRate(innerHeartRate); 154 | }; 155 | 156 | const startStreamingData = async (device: Device) => { 157 | if (device) { 158 | device.monitorCharacteristicForService( 159 | HEART_RATE_UUID, 160 | HEART_RATE_CHARACTERISTIC, 161 | onHeartRateUpdate 162 | ); 163 | } else { 164 | console.log("No Device Connected"); 165 | } 166 | }; 167 | 168 | return { 169 | scanForPeripherals, 170 | requestPermissions, 171 | connectToDevice, 172 | allDevices, 173 | connectedDevice, 174 | disconnectFromDevice, 175 | heartRate, 176 | }; 177 | } 178 | 179 | export default useBLE; 180 | -------------------------------------------------------------------------------- /ios/expoblesample/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import 8 | 9 | #import 10 | 11 | #if RCT_NEW_ARCH_ENABLED 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | 19 | #import 20 | 21 | static NSString *const kRNConcurrentRoot = @"concurrentRoot"; 22 | 23 | @interface AppDelegate () { 24 | RCTTurboModuleManager *_turboModuleManager; 25 | RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; 26 | std::shared_ptr _reactNativeConfig; 27 | facebook::react::ContextContainer::Shared _contextContainer; 28 | } 29 | @end 30 | #endif 31 | 32 | @implementation AppDelegate 33 | 34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 35 | { 36 | RCTAppSetupPrepareApp(application); 37 | 38 | RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions]; 39 | 40 | #if RCT_NEW_ARCH_ENABLED 41 | _contextContainer = std::make_shared(); 42 | _reactNativeConfig = std::make_shared(); 43 | _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); 44 | _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; 45 | bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; 46 | #endif 47 | 48 | NSDictionary *initProps = [self prepareInitialProps]; 49 | UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"main" initialProperties:initProps]; 50 | 51 | rootView.backgroundColor = [UIColor whiteColor]; 52 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 53 | UIViewController *rootViewController = [self.reactDelegate createRootViewController]; 54 | rootViewController.view = rootView; 55 | self.window.rootViewController = rootViewController; 56 | [self.window makeKeyAndVisible]; 57 | 58 | [super application:application didFinishLaunchingWithOptions:launchOptions]; 59 | 60 | return YES; 61 | } 62 | 63 | - (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge 64 | { 65 | // If you'd like to export some custom RCTBridgeModules, add them here! 66 | return @[]; 67 | } 68 | 69 | /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. 70 | /// 71 | /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html 72 | /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). 73 | /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. 74 | - (BOOL)concurrentRootEnabled 75 | { 76 | // Switch this bool to turn on and off the concurrent root 77 | return true; 78 | } 79 | 80 | - (NSDictionary *)prepareInitialProps 81 | { 82 | NSMutableDictionary *initProps = [NSMutableDictionary new]; 83 | #if RCT_NEW_ARCH_ENABLED 84 | initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); 85 | #endif 86 | return initProps; 87 | } 88 | 89 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 90 | { 91 | #if DEBUG 92 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 93 | #else 94 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 95 | #endif 96 | } 97 | 98 | // Linking API 99 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options { 100 | return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options]; 101 | } 102 | 103 | // Universal Links 104 | - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray> * _Nullable))restorationHandler { 105 | BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; 106 | return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result; 107 | } 108 | 109 | // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries 110 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 111 | { 112 | return [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; 113 | } 114 | 115 | // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries 116 | - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error 117 | { 118 | return [super application:application didFailToRegisterForRemoteNotificationsWithError:error]; 119 | } 120 | 121 | // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries 122 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler 123 | { 124 | return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; 125 | } 126 | 127 | #if RCT_NEW_ARCH_ENABLED 128 | 129 | #pragma mark - RCTCxxBridgeDelegate 130 | 131 | - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge 132 | { 133 | _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge 134 | delegate:self 135 | jsInvoker:bridge.jsCallInvoker]; 136 | return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); 137 | } 138 | 139 | #pragma mark RCTTurboModuleManagerDelegate 140 | 141 | - (Class)getModuleClassFromName:(const char *)name 142 | { 143 | return RCTCoreModulesClassProvider(name); 144 | } 145 | 146 | - (std::shared_ptr)getTurboModule:(const std::string &)name 147 | jsInvoker:(std::shared_ptr)jsInvoker 148 | { 149 | return nullptr; 150 | } 151 | 152 | - (std::shared_ptr)getTurboModule:(const std::string &)name 153 | initParams: 154 | (const facebook::react::ObjCTurboModule::InitParams &)params 155 | { 156 | return nullptr; 157 | } 158 | 159 | - (id)getModuleInstanceFromClass:(Class)moduleClass 160 | { 161 | return RCTAppSetupDefaultModuleFromClass(moduleClass); 162 | } 163 | 164 | #endif 165 | 166 | @end 167 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Stop when "xargs" is not available. 209 | if ! command -v xargs >/dev/null 2>&1 210 | then 211 | die "xargs is not available" 212 | fi 213 | 214 | # Use "xargs" to parse quoted args. 215 | # 216 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 217 | # 218 | # In Bash we could simply go: 219 | # 220 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 221 | # set -- "${ARGS[@]}" "$@" 222 | # 223 | # but POSIX shell has neither arrays nor command substitution, so instead we 224 | # post-process each arg (as a line of input to sed) to backslash-escape any 225 | # character that might be a shell metacharacter, then use eval to reverse 226 | # that process (while maintaining the separation between arguments), and wrap 227 | # the whole thing up as a single "set" statement. 228 | # 229 | # This will of course break if any of these variables contains a newline or 230 | # an unmatched quote. 231 | # 232 | 233 | eval "set -- $( 234 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 235 | xargs -n1 | 236 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 237 | tr '\n' ' ' 238 | )" '"$@"' 239 | 240 | exec "$JAVACMD" "$@" 241 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath() 81 | 82 | def reactNativeRoot = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() 83 | 84 | project.ext.react = [ 85 | entryFile: ["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android"].execute(null, rootDir).text.trim(), 86 | enableHermes: (findProperty('expo.jsEngine') ?: "jsc") == "hermes", 87 | hermesCommand: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc", 88 | cliPath: "${reactNativeRoot}/cli.js", 89 | composeSourceMapsPath: "${reactNativeRoot}/scripts/compose-source-maps.js", 90 | ] 91 | 92 | apply from: new File(reactNativeRoot, "react.gradle") 93 | 94 | /** 95 | * Set this to true to create two separate APKs instead of one: 96 | * - An APK that only works on ARM devices 97 | * - An APK that only works on x86 devices 98 | * The advantage is the size of the APK is reduced by about 4MB. 99 | * Upload all the APKs to the Play Store and people will download 100 | * the correct one based on the CPU architecture of their device. 101 | */ 102 | def enableSeparateBuildPerCPUArchitecture = false 103 | 104 | /** 105 | * Run Proguard to shrink the Java bytecode in release builds. 106 | */ 107 | def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean() 108 | 109 | /** 110 | * The preferred build flavor of JavaScriptCore. 111 | * 112 | * For example, to use the international variant, you can use: 113 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 114 | * 115 | * The international variant includes ICU i18n library and necessary data 116 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 117 | * give correct results when using with locales other than en-US. Note that 118 | * this variant is about 6MiB larger per architecture than default. 119 | */ 120 | def jscFlavor = 'org.webkit:android-jsc:+' 121 | 122 | /** 123 | * Whether to enable the Hermes VM. 124 | * 125 | * This should be set on project.ext.react and that value will be read here. If it is not set 126 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 127 | * and the benefits of using Hermes will therefore be sharply reduced. 128 | */ 129 | def enableHermes = project.ext.react.get("enableHermes", false); 130 | 131 | /** 132 | * Architectures to build native code for. 133 | */ 134 | def reactNativeArchitectures() { 135 | def value = project.getProperties().get("reactNativeArchitectures") 136 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] 137 | } 138 | 139 | android { 140 | ndkVersion rootProject.ext.ndkVersion 141 | 142 | compileSdkVersion rootProject.ext.compileSdkVersion 143 | 144 | defaultConfig { 145 | applicationId 'com.dfriyia2.expoblesample' 146 | minSdkVersion rootProject.ext.minSdkVersion 147 | targetSdkVersion rootProject.ext.targetSdkVersion 148 | versionCode 1 149 | versionName "1.0.0" 150 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 151 | 152 | if (isNewArchitectureEnabled()) { 153 | // We configure the CMake build only if you decide to opt-in for the New Architecture. 154 | externalNativeBuild { 155 | cmake { 156 | arguments "-DPROJECT_BUILD_DIR=$buildDir", 157 | "-DREACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid", 158 | "-DREACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build", 159 | "-DNODE_MODULES_DIR=$rootDir/../node_modules", 160 | "-DANDROID_STL=c++_shared" 161 | } 162 | } 163 | if (!enableSeparateBuildPerCPUArchitecture) { 164 | ndk { 165 | abiFilters (*reactNativeArchitectures()) 166 | } 167 | } 168 | } 169 | } 170 | 171 | if (isNewArchitectureEnabled()) { 172 | // We configure the CMake build only if you decide to opt-in for the New Architecture. 173 | externalNativeBuild { 174 | cmake { 175 | path "$projectDir/src/main/jni/CMakeLists.txt" 176 | } 177 | } 178 | def reactAndroidProjectDir = project(':ReactAndroid').projectDir 179 | def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { 180 | dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") 181 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 182 | into("$buildDir/react-ndk/exported") 183 | } 184 | def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { 185 | dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") 186 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 187 | into("$buildDir/react-ndk/exported") 188 | } 189 | afterEvaluate { 190 | // If you wish to add a custom TurboModule or component locally, 191 | // you should uncomment this line. 192 | // preBuild.dependsOn("generateCodegenArtifactsFromSchema") 193 | preDebugBuild.dependsOn(packageReactNdkDebugLibs) 194 | preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) 195 | 196 | // Due to a bug inside AGP, we have to explicitly set a dependency 197 | // between configureCMakeDebug* tasks and the preBuild tasks. 198 | // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 199 | configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild) 200 | configureCMakeDebug.dependsOn(preDebugBuild) 201 | reactNativeArchitectures().each { architecture -> 202 | tasks.findByName("configureCMakeDebug[${architecture}]")?.configure { 203 | dependsOn("preDebugBuild") 204 | } 205 | tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure { 206 | dependsOn("preReleaseBuild") 207 | } 208 | } 209 | } 210 | } 211 | 212 | splits { 213 | abi { 214 | reset() 215 | enable enableSeparateBuildPerCPUArchitecture 216 | universalApk false // If true, also generate a universal APK 217 | include (*reactNativeArchitectures()) 218 | } 219 | } 220 | signingConfigs { 221 | debug { 222 | storeFile file('debug.keystore') 223 | storePassword 'android' 224 | keyAlias 'androiddebugkey' 225 | keyPassword 'android' 226 | } 227 | } 228 | buildTypes { 229 | debug { 230 | signingConfig signingConfigs.debug 231 | } 232 | release { 233 | // Caution! In production, you need to generate your own keystore file. 234 | // see https://reactnative.dev/docs/signed-apk-android. 235 | signingConfig signingConfigs.debug 236 | minifyEnabled enableProguardInReleaseBuilds 237 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 238 | } 239 | } 240 | 241 | // applicationVariants are e.g. debug, release 242 | applicationVariants.all { variant -> 243 | variant.outputs.each { output -> 244 | // For each separate APK per architecture, set a unique version code as described here: 245 | // https://developer.android.com/studio/build/configure-apk-splits.html 246 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 247 | def abi = output.getFilter(OutputFile.ABI) 248 | if (abi != null) { // null for the universal-debug, universal-release variants 249 | output.versionCodeOverride = 250 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 251 | } 252 | 253 | } 254 | } 255 | } 256 | 257 | // Apply static values from `gradle.properties` to the `android.packagingOptions` 258 | // Accepts values in comma delimited lists, example: 259 | // android.packagingOptions.pickFirsts=/LICENSE,**/picasa.ini 260 | ["pickFirsts", "excludes", "merges", "doNotStrip"].each { prop -> 261 | // Split option: 'foo,bar' -> ['foo', 'bar'] 262 | def options = (findProperty("android.packagingOptions.$prop") ?: "").split(","); 263 | // Trim all elements in place. 264 | for (i in 0.. 0) { 269 | println "android.packagingOptions.$prop += $options ($options.length)" 270 | // Ex: android.packagingOptions.pickFirsts += '**/SCCS/**' 271 | options.each { 272 | android.packagingOptions[prop] += it 273 | } 274 | } 275 | } 276 | 277 | dependencies { 278 | implementation fileTree(dir: "libs", include: ["*.jar"]) 279 | 280 | //noinspection GradleDynamicVersion 281 | implementation "com.facebook.react:react-native:+" // From node_modules 282 | 283 | def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true"; 284 | def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true"; 285 | def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true"; 286 | def frescoVersion = rootProject.ext.frescoVersion 287 | 288 | // If your app supports Android versions before Ice Cream Sandwich (API level 14) 289 | if (isGifEnabled || isWebpEnabled) { 290 | implementation "com.facebook.fresco:fresco:${frescoVersion}" 291 | implementation "com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}" 292 | } 293 | 294 | if (isGifEnabled) { 295 | // For animated gif support 296 | implementation "com.facebook.fresco:animated-gif:${frescoVersion}" 297 | } 298 | 299 | if (isWebpEnabled) { 300 | // For webp support 301 | implementation "com.facebook.fresco:webpsupport:${frescoVersion}" 302 | if (isWebpAnimatedEnabled) { 303 | // Animated webp support 304 | implementation "com.facebook.fresco:animated-webp:${frescoVersion}" 305 | } 306 | } 307 | 308 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 309 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 310 | exclude group:'com.facebook.fbjni' 311 | } 312 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 313 | exclude group:'com.facebook.flipper' 314 | exclude group:'com.squareup.okhttp3', module:'okhttp' 315 | } 316 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 317 | exclude group:'com.facebook.flipper' 318 | } 319 | 320 | if (enableHermes) { 321 | //noinspection GradleDynamicVersion 322 | implementation("com.facebook.react:hermes-engine:+") { // From node_modules 323 | exclude group:'com.facebook.fbjni' 324 | } 325 | } else { 326 | implementation jscFlavor 327 | } 328 | } 329 | 330 | if (isNewArchitectureEnabled()) { 331 | // If new architecture is enabled, we let you build RN from source 332 | // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. 333 | // This will be applied to all the imported transtitive dependency. 334 | configurations.all { 335 | resolutionStrategy.dependencySubstitution { 336 | substitute(module("com.facebook.react:react-native")) 337 | .using(project(":ReactAndroid")) 338 | .because("On New Architecture we're building React Native from source") 339 | substitute(module("com.facebook.react:hermes-engine")) 340 | .using(project(":ReactAndroid:hermes-engine")) 341 | .because("On New Architecture we're building Hermes from source") 342 | } 343 | } 344 | } 345 | 346 | // Run this once to be able to run the application with BUCK 347 | // puts all compile dependencies into folder libs for BUCK to use 348 | task copyDownloadableDepsToLibs(type: Copy) { 349 | from configurations.implementation 350 | into 'libs' 351 | } 352 | 353 | apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle"); 354 | applyNativeModulesAppBuildGradle(project) 355 | 356 | def isNewArchitectureEnabled() { 357 | // To opt-in for the New Architecture, you can either: 358 | // - Set `newArchEnabled` to true inside the `gradle.properties` file 359 | // - Invoke gradle with `-newArchEnabled=true` 360 | // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` 361 | return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" 362 | } 363 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost (1.76.0) 3 | - DoubleConversion (1.1.6) 4 | - EXApplication (5.0.1): 5 | - ExpoModulesCore 6 | - EXConstants (14.0.2): 7 | - ExpoModulesCore 8 | - EXFileSystem (15.1.1): 9 | - ExpoModulesCore 10 | - EXFont (11.0.1): 11 | - ExpoModulesCore 12 | - Expo (47.0.13): 13 | - ExpoModulesCore 14 | - ExpoKeepAwake (11.0.1): 15 | - ExpoModulesCore 16 | - ExpoModulesCore (1.1.1): 17 | - React-Core 18 | - ReactCommon/turbomodule/core 19 | - EXSplashScreen (0.17.5): 20 | - ExpoModulesCore 21 | - React-Core 22 | - FBLazyVector (0.70.5) 23 | - FBReactNativeSpec (0.70.5): 24 | - RCT-Folly (= 2021.07.22.00) 25 | - RCTRequired (= 0.70.5) 26 | - RCTTypeSafety (= 0.70.5) 27 | - React-Core (= 0.70.5) 28 | - React-jsi (= 0.70.5) 29 | - ReactCommon/turbomodule/core (= 0.70.5) 30 | - fmt (6.2.1) 31 | - glog (0.3.5) 32 | - MultiplatformBleAdapter (0.1.9) 33 | - RCT-Folly (2021.07.22.00): 34 | - boost 35 | - DoubleConversion 36 | - fmt (~> 6.2.1) 37 | - glog 38 | - RCT-Folly/Default (= 2021.07.22.00) 39 | - RCT-Folly/Default (2021.07.22.00): 40 | - boost 41 | - DoubleConversion 42 | - fmt (~> 6.2.1) 43 | - glog 44 | - RCTRequired (0.70.5) 45 | - RCTTypeSafety (0.70.5): 46 | - FBLazyVector (= 0.70.5) 47 | - RCTRequired (= 0.70.5) 48 | - React-Core (= 0.70.5) 49 | - React (0.70.5): 50 | - React-Core (= 0.70.5) 51 | - React-Core/DevSupport (= 0.70.5) 52 | - React-Core/RCTWebSocket (= 0.70.5) 53 | - React-RCTActionSheet (= 0.70.5) 54 | - React-RCTAnimation (= 0.70.5) 55 | - React-RCTBlob (= 0.70.5) 56 | - React-RCTImage (= 0.70.5) 57 | - React-RCTLinking (= 0.70.5) 58 | - React-RCTNetwork (= 0.70.5) 59 | - React-RCTSettings (= 0.70.5) 60 | - React-RCTText (= 0.70.5) 61 | - React-RCTVibration (= 0.70.5) 62 | - React-bridging (0.70.5): 63 | - RCT-Folly (= 2021.07.22.00) 64 | - React-jsi (= 0.70.5) 65 | - React-callinvoker (0.70.5) 66 | - React-Codegen (0.70.5): 67 | - FBReactNativeSpec (= 0.70.5) 68 | - RCT-Folly (= 2021.07.22.00) 69 | - RCTRequired (= 0.70.5) 70 | - RCTTypeSafety (= 0.70.5) 71 | - React-Core (= 0.70.5) 72 | - React-jsi (= 0.70.5) 73 | - React-jsiexecutor (= 0.70.5) 74 | - ReactCommon/turbomodule/core (= 0.70.5) 75 | - React-Core (0.70.5): 76 | - glog 77 | - RCT-Folly (= 2021.07.22.00) 78 | - React-Core/Default (= 0.70.5) 79 | - React-cxxreact (= 0.70.5) 80 | - React-jsi (= 0.70.5) 81 | - React-jsiexecutor (= 0.70.5) 82 | - React-perflogger (= 0.70.5) 83 | - Yoga 84 | - React-Core/CoreModulesHeaders (0.70.5): 85 | - glog 86 | - RCT-Folly (= 2021.07.22.00) 87 | - React-Core/Default 88 | - React-cxxreact (= 0.70.5) 89 | - React-jsi (= 0.70.5) 90 | - React-jsiexecutor (= 0.70.5) 91 | - React-perflogger (= 0.70.5) 92 | - Yoga 93 | - React-Core/Default (0.70.5): 94 | - glog 95 | - RCT-Folly (= 2021.07.22.00) 96 | - React-cxxreact (= 0.70.5) 97 | - React-jsi (= 0.70.5) 98 | - React-jsiexecutor (= 0.70.5) 99 | - React-perflogger (= 0.70.5) 100 | - Yoga 101 | - React-Core/DevSupport (0.70.5): 102 | - glog 103 | - RCT-Folly (= 2021.07.22.00) 104 | - React-Core/Default (= 0.70.5) 105 | - React-Core/RCTWebSocket (= 0.70.5) 106 | - React-cxxreact (= 0.70.5) 107 | - React-jsi (= 0.70.5) 108 | - React-jsiexecutor (= 0.70.5) 109 | - React-jsinspector (= 0.70.5) 110 | - React-perflogger (= 0.70.5) 111 | - Yoga 112 | - React-Core/RCTActionSheetHeaders (0.70.5): 113 | - glog 114 | - RCT-Folly (= 2021.07.22.00) 115 | - React-Core/Default 116 | - React-cxxreact (= 0.70.5) 117 | - React-jsi (= 0.70.5) 118 | - React-jsiexecutor (= 0.70.5) 119 | - React-perflogger (= 0.70.5) 120 | - Yoga 121 | - React-Core/RCTAnimationHeaders (0.70.5): 122 | - glog 123 | - RCT-Folly (= 2021.07.22.00) 124 | - React-Core/Default 125 | - React-cxxreact (= 0.70.5) 126 | - React-jsi (= 0.70.5) 127 | - React-jsiexecutor (= 0.70.5) 128 | - React-perflogger (= 0.70.5) 129 | - Yoga 130 | - React-Core/RCTBlobHeaders (0.70.5): 131 | - glog 132 | - RCT-Folly (= 2021.07.22.00) 133 | - React-Core/Default 134 | - React-cxxreact (= 0.70.5) 135 | - React-jsi (= 0.70.5) 136 | - React-jsiexecutor (= 0.70.5) 137 | - React-perflogger (= 0.70.5) 138 | - Yoga 139 | - React-Core/RCTImageHeaders (0.70.5): 140 | - glog 141 | - RCT-Folly (= 2021.07.22.00) 142 | - React-Core/Default 143 | - React-cxxreact (= 0.70.5) 144 | - React-jsi (= 0.70.5) 145 | - React-jsiexecutor (= 0.70.5) 146 | - React-perflogger (= 0.70.5) 147 | - Yoga 148 | - React-Core/RCTLinkingHeaders (0.70.5): 149 | - glog 150 | - RCT-Folly (= 2021.07.22.00) 151 | - React-Core/Default 152 | - React-cxxreact (= 0.70.5) 153 | - React-jsi (= 0.70.5) 154 | - React-jsiexecutor (= 0.70.5) 155 | - React-perflogger (= 0.70.5) 156 | - Yoga 157 | - React-Core/RCTNetworkHeaders (0.70.5): 158 | - glog 159 | - RCT-Folly (= 2021.07.22.00) 160 | - React-Core/Default 161 | - React-cxxreact (= 0.70.5) 162 | - React-jsi (= 0.70.5) 163 | - React-jsiexecutor (= 0.70.5) 164 | - React-perflogger (= 0.70.5) 165 | - Yoga 166 | - React-Core/RCTSettingsHeaders (0.70.5): 167 | - glog 168 | - RCT-Folly (= 2021.07.22.00) 169 | - React-Core/Default 170 | - React-cxxreact (= 0.70.5) 171 | - React-jsi (= 0.70.5) 172 | - React-jsiexecutor (= 0.70.5) 173 | - React-perflogger (= 0.70.5) 174 | - Yoga 175 | - React-Core/RCTTextHeaders (0.70.5): 176 | - glog 177 | - RCT-Folly (= 2021.07.22.00) 178 | - React-Core/Default 179 | - React-cxxreact (= 0.70.5) 180 | - React-jsi (= 0.70.5) 181 | - React-jsiexecutor (= 0.70.5) 182 | - React-perflogger (= 0.70.5) 183 | - Yoga 184 | - React-Core/RCTVibrationHeaders (0.70.5): 185 | - glog 186 | - RCT-Folly (= 2021.07.22.00) 187 | - React-Core/Default 188 | - React-cxxreact (= 0.70.5) 189 | - React-jsi (= 0.70.5) 190 | - React-jsiexecutor (= 0.70.5) 191 | - React-perflogger (= 0.70.5) 192 | - Yoga 193 | - React-Core/RCTWebSocket (0.70.5): 194 | - glog 195 | - RCT-Folly (= 2021.07.22.00) 196 | - React-Core/Default (= 0.70.5) 197 | - React-cxxreact (= 0.70.5) 198 | - React-jsi (= 0.70.5) 199 | - React-jsiexecutor (= 0.70.5) 200 | - React-perflogger (= 0.70.5) 201 | - Yoga 202 | - React-CoreModules (0.70.5): 203 | - RCT-Folly (= 2021.07.22.00) 204 | - RCTTypeSafety (= 0.70.5) 205 | - React-Codegen (= 0.70.5) 206 | - React-Core/CoreModulesHeaders (= 0.70.5) 207 | - React-jsi (= 0.70.5) 208 | - React-RCTImage (= 0.70.5) 209 | - ReactCommon/turbomodule/core (= 0.70.5) 210 | - React-cxxreact (0.70.5): 211 | - boost (= 1.76.0) 212 | - DoubleConversion 213 | - glog 214 | - RCT-Folly (= 2021.07.22.00) 215 | - React-callinvoker (= 0.70.5) 216 | - React-jsi (= 0.70.5) 217 | - React-jsinspector (= 0.70.5) 218 | - React-logger (= 0.70.5) 219 | - React-perflogger (= 0.70.5) 220 | - React-runtimeexecutor (= 0.70.5) 221 | - React-jsi (0.70.5): 222 | - boost (= 1.76.0) 223 | - DoubleConversion 224 | - glog 225 | - RCT-Folly (= 2021.07.22.00) 226 | - React-jsi/Default (= 0.70.5) 227 | - React-jsi/Default (0.70.5): 228 | - boost (= 1.76.0) 229 | - DoubleConversion 230 | - glog 231 | - RCT-Folly (= 2021.07.22.00) 232 | - React-jsiexecutor (0.70.5): 233 | - DoubleConversion 234 | - glog 235 | - RCT-Folly (= 2021.07.22.00) 236 | - React-cxxreact (= 0.70.5) 237 | - React-jsi (= 0.70.5) 238 | - React-perflogger (= 0.70.5) 239 | - React-jsinspector (0.70.5) 240 | - React-logger (0.70.5): 241 | - glog 242 | - react-native-ble-plx (2.0.3): 243 | - MultiplatformBleAdapter (= 0.1.9) 244 | - React-Core 245 | - react-native-skia (0.1.157): 246 | - React 247 | - React-callinvoker 248 | - React-Core 249 | - react-native-skia/Api (= 0.1.157) 250 | - react-native-skia/Jsi (= 0.1.157) 251 | - react-native-skia/RNSkia (= 0.1.157) 252 | - react-native-skia/SkiaHeaders (= 0.1.157) 253 | - react-native-skia/Utils (= 0.1.157) 254 | - react-native-skia/Api (0.1.157): 255 | - React 256 | - React-callinvoker 257 | - React-Core 258 | - react-native-skia/Jsi (0.1.157): 259 | - React 260 | - React-callinvoker 261 | - React-Core 262 | - react-native-skia/RNSkia (0.1.157): 263 | - React 264 | - React-callinvoker 265 | - React-Core 266 | - react-native-skia/SkiaHeaders (0.1.157): 267 | - React 268 | - React-callinvoker 269 | - React-Core 270 | - react-native-skia/Utils (0.1.157): 271 | - React 272 | - React-callinvoker 273 | - React-Core 274 | - React-perflogger (0.70.5) 275 | - React-RCTActionSheet (0.70.5): 276 | - React-Core/RCTActionSheetHeaders (= 0.70.5) 277 | - React-RCTAnimation (0.70.5): 278 | - RCT-Folly (= 2021.07.22.00) 279 | - RCTTypeSafety (= 0.70.5) 280 | - React-Codegen (= 0.70.5) 281 | - React-Core/RCTAnimationHeaders (= 0.70.5) 282 | - React-jsi (= 0.70.5) 283 | - ReactCommon/turbomodule/core (= 0.70.5) 284 | - React-RCTBlob (0.70.5): 285 | - RCT-Folly (= 2021.07.22.00) 286 | - React-Codegen (= 0.70.5) 287 | - React-Core/RCTBlobHeaders (= 0.70.5) 288 | - React-Core/RCTWebSocket (= 0.70.5) 289 | - React-jsi (= 0.70.5) 290 | - React-RCTNetwork (= 0.70.5) 291 | - ReactCommon/turbomodule/core (= 0.70.5) 292 | - React-RCTImage (0.70.5): 293 | - RCT-Folly (= 2021.07.22.00) 294 | - RCTTypeSafety (= 0.70.5) 295 | - React-Codegen (= 0.70.5) 296 | - React-Core/RCTImageHeaders (= 0.70.5) 297 | - React-jsi (= 0.70.5) 298 | - React-RCTNetwork (= 0.70.5) 299 | - ReactCommon/turbomodule/core (= 0.70.5) 300 | - React-RCTLinking (0.70.5): 301 | - React-Codegen (= 0.70.5) 302 | - React-Core/RCTLinkingHeaders (= 0.70.5) 303 | - React-jsi (= 0.70.5) 304 | - ReactCommon/turbomodule/core (= 0.70.5) 305 | - React-RCTNetwork (0.70.5): 306 | - RCT-Folly (= 2021.07.22.00) 307 | - RCTTypeSafety (= 0.70.5) 308 | - React-Codegen (= 0.70.5) 309 | - React-Core/RCTNetworkHeaders (= 0.70.5) 310 | - React-jsi (= 0.70.5) 311 | - ReactCommon/turbomodule/core (= 0.70.5) 312 | - React-RCTSettings (0.70.5): 313 | - RCT-Folly (= 2021.07.22.00) 314 | - RCTTypeSafety (= 0.70.5) 315 | - React-Codegen (= 0.70.5) 316 | - React-Core/RCTSettingsHeaders (= 0.70.5) 317 | - React-jsi (= 0.70.5) 318 | - ReactCommon/turbomodule/core (= 0.70.5) 319 | - React-RCTText (0.70.5): 320 | - React-Core/RCTTextHeaders (= 0.70.5) 321 | - React-RCTVibration (0.70.5): 322 | - RCT-Folly (= 2021.07.22.00) 323 | - React-Codegen (= 0.70.5) 324 | - React-Core/RCTVibrationHeaders (= 0.70.5) 325 | - React-jsi (= 0.70.5) 326 | - ReactCommon/turbomodule/core (= 0.70.5) 327 | - React-runtimeexecutor (0.70.5): 328 | - React-jsi (= 0.70.5) 329 | - ReactCommon/turbomodule/core (0.70.5): 330 | - DoubleConversion 331 | - glog 332 | - RCT-Folly (= 2021.07.22.00) 333 | - React-bridging (= 0.70.5) 334 | - React-callinvoker (= 0.70.5) 335 | - React-Core (= 0.70.5) 336 | - React-cxxreact (= 0.70.5) 337 | - React-jsi (= 0.70.5) 338 | - React-logger (= 0.70.5) 339 | - React-perflogger (= 0.70.5) 340 | - Yoga (1.14.0) 341 | 342 | DEPENDENCIES: 343 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) 344 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 345 | - EXApplication (from `../node_modules/expo-application/ios`) 346 | - EXConstants (from `../node_modules/expo-constants/ios`) 347 | - EXFileSystem (from `../node_modules/expo-file-system/ios`) 348 | - EXFont (from `../node_modules/expo-font/ios`) 349 | - Expo (from `../node_modules/expo`) 350 | - ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`) 351 | - ExpoModulesCore (from `../node_modules/expo-modules-core`) 352 | - EXSplashScreen (from `../node_modules/expo-splash-screen/ios`) 353 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 354 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 355 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 356 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 357 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 358 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 359 | - React (from `../node_modules/react-native/`) 360 | - React-bridging (from `../node_modules/react-native/ReactCommon`) 361 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 362 | - React-Codegen (from `build/generated/ios`) 363 | - React-Core (from `../node_modules/react-native/`) 364 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 365 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 366 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 367 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 368 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 369 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 370 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`) 371 | - react-native-ble-plx (from `../node_modules/react-native-ble-plx`) 372 | - "react-native-skia (from `../node_modules/@shopify/react-native-skia`)" 373 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 374 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 375 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 376 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 377 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 378 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 379 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 380 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 381 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 382 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 383 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 384 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 385 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 386 | 387 | SPEC REPOS: 388 | trunk: 389 | - fmt 390 | - MultiplatformBleAdapter 391 | 392 | EXTERNAL SOURCES: 393 | boost: 394 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" 395 | DoubleConversion: 396 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 397 | EXApplication: 398 | :path: "../node_modules/expo-application/ios" 399 | EXConstants: 400 | :path: "../node_modules/expo-constants/ios" 401 | EXFileSystem: 402 | :path: "../node_modules/expo-file-system/ios" 403 | EXFont: 404 | :path: "../node_modules/expo-font/ios" 405 | Expo: 406 | :path: "../node_modules/expo" 407 | ExpoKeepAwake: 408 | :path: "../node_modules/expo-keep-awake/ios" 409 | ExpoModulesCore: 410 | :path: "../node_modules/expo-modules-core" 411 | EXSplashScreen: 412 | :path: "../node_modules/expo-splash-screen/ios" 413 | FBLazyVector: 414 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 415 | FBReactNativeSpec: 416 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 417 | glog: 418 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 419 | RCT-Folly: 420 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 421 | RCTRequired: 422 | :path: "../node_modules/react-native/Libraries/RCTRequired" 423 | RCTTypeSafety: 424 | :path: "../node_modules/react-native/Libraries/TypeSafety" 425 | React: 426 | :path: "../node_modules/react-native/" 427 | React-bridging: 428 | :path: "../node_modules/react-native/ReactCommon" 429 | React-callinvoker: 430 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 431 | React-Codegen: 432 | :path: build/generated/ios 433 | React-Core: 434 | :path: "../node_modules/react-native/" 435 | React-CoreModules: 436 | :path: "../node_modules/react-native/React/CoreModules" 437 | React-cxxreact: 438 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 439 | React-jsi: 440 | :path: "../node_modules/react-native/ReactCommon/jsi" 441 | React-jsiexecutor: 442 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 443 | React-jsinspector: 444 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 445 | React-logger: 446 | :path: "../node_modules/react-native/ReactCommon/logger" 447 | react-native-ble-plx: 448 | :path: "../node_modules/react-native-ble-plx" 449 | react-native-skia: 450 | :path: "../node_modules/@shopify/react-native-skia" 451 | React-perflogger: 452 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 453 | React-RCTActionSheet: 454 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 455 | React-RCTAnimation: 456 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 457 | React-RCTBlob: 458 | :path: "../node_modules/react-native/Libraries/Blob" 459 | React-RCTImage: 460 | :path: "../node_modules/react-native/Libraries/Image" 461 | React-RCTLinking: 462 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 463 | React-RCTNetwork: 464 | :path: "../node_modules/react-native/Libraries/Network" 465 | React-RCTSettings: 466 | :path: "../node_modules/react-native/Libraries/Settings" 467 | React-RCTText: 468 | :path: "../node_modules/react-native/Libraries/Text" 469 | React-RCTVibration: 470 | :path: "../node_modules/react-native/Libraries/Vibration" 471 | React-runtimeexecutor: 472 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 473 | ReactCommon: 474 | :path: "../node_modules/react-native/ReactCommon" 475 | Yoga: 476 | :path: "../node_modules/react-native/ReactCommon/yoga" 477 | 478 | SPEC CHECKSUMS: 479 | boost: a7c83b31436843459a1961bfd74b96033dc77234 480 | DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 481 | EXApplication: 034b1c40a8e9fe1bff76a1e511ee90dff64ad834 482 | EXConstants: 3c86653c422dd77e40d10cbbabb3025003977415 483 | EXFileSystem: 60602b6eefa6873f97172c684b7537c9760b50d6 484 | EXFont: 319606bfe48c33b5b5063fb0994afdc496befe80 485 | Expo: b9fa98bf260992312ee3c424400819fb9beadafe 486 | ExpoKeepAwake: 69b59d0a8d2b24de9f82759c39b3821fec030318 487 | ExpoModulesCore: 485dff3a59b036a33b6050c0a5aea3cf1037fdd1 488 | EXSplashScreen: 3e989924f61a8dd07ee4ea584c6ba14be9b51949 489 | FBLazyVector: affa4ba1bfdaac110a789192f4d452b053a86624 490 | FBReactNativeSpec: fe8b5f1429cfe83a8d72dc8ed61dc7704cac8745 491 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 492 | glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b 493 | MultiplatformBleAdapter: 5a6a897b006764392f9cef785e4360f54fb9477d 494 | RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda 495 | RCTRequired: 21229f84411088e5d8538f21212de49e46cc83e2 496 | RCTTypeSafety: 62eed57a32924b09edaaf170a548d1fc96223086 497 | React: f0254ccddeeef1defe66c6b1bb9133a4f040792b 498 | React-bridging: e46911666b7ec19538a620a221d6396cd293d687 499 | React-callinvoker: 66b62e2c34546546b2f21ab0b7670346410a2b53 500 | React-Codegen: b6999435966df3bdf82afa3f319ba0d6f9a8532a 501 | React-Core: dabbc9d1fe0a11d884e6ee1599789cf8eb1058a5 502 | React-CoreModules: 5b6b7668f156f73a56420df9ec68ca2ec8f2e818 503 | React-cxxreact: c7ca2baee46db22a30fce9e639277add3c3f6ad1 504 | React-jsi: a565dcb49130ed20877a9bb1105ffeecbb93d02d 505 | React-jsiexecutor: 31564fa6912459921568e8b0e49024285a4d584b 506 | React-jsinspector: badd81696361249893a80477983e697aab3c1a34 507 | React-logger: fdda34dd285bdb0232e059b19d9606fa0ec3bb9c 508 | react-native-ble-plx: f10240444452dfb2d2a13a0e4f58d7783e92d76e 509 | react-native-skia: 7f9a3bd36c4247005e87005d912dcf6db76a6289 510 | React-perflogger: e68d3795cf5d247a0379735cbac7309adf2fb931 511 | React-RCTActionSheet: 05452c3b281edb27850253db13ecd4c5a65bc247 512 | React-RCTAnimation: 578eebac706428e68466118e84aeacf3a282b4da 513 | React-RCTBlob: f47a0aa61e7d1fb1a0e13da832b0da934939d71a 514 | React-RCTImage: 60f54b66eed65d86b6dffaf4733d09161d44929d 515 | React-RCTLinking: 91073205aeec4b29450ca79b709277319368ac9e 516 | React-RCTNetwork: ca91f2c9465a7e335c8a5fae731fd7f10572213b 517 | React-RCTSettings: 1a9a5d01337d55c18168c1abe0f4a589167d134a 518 | React-RCTText: c591e8bd9347a294d8416357ca12d779afec01d5 519 | React-RCTVibration: 8e5c8c5d17af641f306d7380d8d0fe9b3c142c48 520 | React-runtimeexecutor: 7401c4a40f8728fd89df4a56104541b760876117 521 | ReactCommon: c9246996e73bf75a2c6c3ff15f1e16707cdc2da9 522 | Yoga: eca980a5771bf114c41a754098cd85e6e0d90ed7 523 | 524 | PODFILE CHECKSUM: 64065283ea548937528126d1d39d9c91d0fbfcc8 525 | 526 | COCOAPODS: 1.11.3 527 | -------------------------------------------------------------------------------- /ios/expoblesample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 11 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 12 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 13 | 1BB3CA6DCC8848A9BE569C10 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = C36C5CAA90DC4C259E07150E /* noop-file.swift */; }; 14 | 3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; }; 15 | 96905EF65AED1B983A6B3ABC /* libPods-expoblesample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-expoblesample.a */; }; 16 | B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; }; 17 | BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 22 | 13B07F961A680F5B00A75B9A /* expoblesample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = expoblesample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = expoblesample/AppDelegate.h; sourceTree = ""; }; 24 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = expoblesample/AppDelegate.mm; sourceTree = ""; }; 25 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = expoblesample/Images.xcassets; sourceTree = ""; }; 26 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = expoblesample/Info.plist; sourceTree = ""; }; 27 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = expoblesample/main.m; sourceTree = ""; }; 28 | 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-expoblesample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-expoblesample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 6C2E3173556A471DD304B334 /* Pods-expoblesample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-expoblesample.debug.xcconfig"; path = "Target Support Files/Pods-expoblesample/Pods-expoblesample.debug.xcconfig"; sourceTree = ""; }; 30 | 7A4D352CD337FB3A3BF06240 /* Pods-expoblesample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-expoblesample.release.xcconfig"; path = "Target Support Files/Pods-expoblesample/Pods-expoblesample.release.xcconfig"; sourceTree = ""; }; 31 | AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = expoblesample/SplashScreen.storyboard; sourceTree = ""; }; 32 | BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = ""; }; 33 | C36C5CAA90DC4C259E07150E /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "expoblesample/noop-file.swift"; sourceTree = ""; }; 34 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 35 | FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-expoblesample/ExpoModulesProvider.swift"; sourceTree = ""; }; 36 | /* End PBXFileReference section */ 37 | 38 | /* Begin PBXFrameworksBuildPhase section */ 39 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 40 | isa = PBXFrameworksBuildPhase; 41 | buildActionMask = 2147483647; 42 | files = ( 43 | 96905EF65AED1B983A6B3ABC /* libPods-expoblesample.a in Frameworks */, 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 13B07FAE1A68108700A75B9A /* expoblesample */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | BB2F792B24A3F905000567C9 /* Supporting */, 54 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 55 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 56 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 57 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 58 | 13B07FB61A68108700A75B9A /* Info.plist */, 59 | 13B07FB71A68108700A75B9A /* main.m */, 60 | AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */, 61 | C36C5CAA90DC4C259E07150E /* noop-file.swift */, 62 | ); 63 | name = expoblesample; 64 | sourceTree = ""; 65 | }; 66 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 70 | 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-expoblesample.a */, 71 | ); 72 | name = Frameworks; 73 | sourceTree = ""; 74 | }; 75 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | ); 79 | name = Libraries; 80 | sourceTree = ""; 81 | }; 82 | 83CBB9F61A601CBA00E9B192 = { 83 | isa = PBXGroup; 84 | children = ( 85 | 13B07FAE1A68108700A75B9A /* expoblesample */, 86 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 87 | 83CBBA001A601CBA00E9B192 /* Products */, 88 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 89 | D65327D7A22EEC0BE12398D9 /* Pods */, 90 | D7E4C46ADA2E9064B798F356 /* ExpoModulesProviders */, 91 | ); 92 | indentWidth = 2; 93 | sourceTree = ""; 94 | tabWidth = 2; 95 | usesTabs = 0; 96 | }; 97 | 83CBBA001A601CBA00E9B192 /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 13B07F961A680F5B00A75B9A /* expoblesample.app */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 92DBD88DE9BF7D494EA9DA96 /* expoblesample */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */, 109 | ); 110 | name = expoblesample; 111 | sourceTree = ""; 112 | }; 113 | BB2F792B24A3F905000567C9 /* Supporting */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | BB2F792C24A3F905000567C9 /* Expo.plist */, 117 | ); 118 | name = Supporting; 119 | path = expoblesample/Supporting; 120 | sourceTree = ""; 121 | }; 122 | D65327D7A22EEC0BE12398D9 /* Pods */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 6C2E3173556A471DD304B334 /* Pods-expoblesample.debug.xcconfig */, 126 | 7A4D352CD337FB3A3BF06240 /* Pods-expoblesample.release.xcconfig */, 127 | ); 128 | path = Pods; 129 | sourceTree = ""; 130 | }; 131 | D7E4C46ADA2E9064B798F356 /* ExpoModulesProviders */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 92DBD88DE9BF7D494EA9DA96 /* expoblesample */, 135 | ); 136 | name = ExpoModulesProviders; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 13B07F861A680F5B00A75B9A /* expoblesample */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "expoblesample" */; 145 | buildPhases = ( 146 | 08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */, 147 | FD10A7F022414F080027D42C /* Start Packager */, 148 | 13B07F871A680F5B00A75B9A /* Sources */, 149 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 150 | 13B07F8E1A680F5B00A75B9A /* Resources */, 151 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 152 | 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | ); 158 | name = expoblesample; 159 | productName = expoblesample; 160 | productReference = 13B07F961A680F5B00A75B9A /* expoblesample.app */; 161 | productType = "com.apple.product-type.application"; 162 | }; 163 | /* End PBXNativeTarget section */ 164 | 165 | /* Begin PBXProject section */ 166 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 167 | isa = PBXProject; 168 | attributes = { 169 | LastUpgradeCheck = 1130; 170 | TargetAttributes = { 171 | 13B07F861A680F5B00A75B9A = { 172 | LastSwiftMigration = 1250; 173 | }; 174 | }; 175 | }; 176 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "expoblesample" */; 177 | compatibilityVersion = "Xcode 3.2"; 178 | developmentRegion = en; 179 | hasScannedForEncodings = 0; 180 | knownRegions = ( 181 | en, 182 | Base, 183 | ); 184 | mainGroup = 83CBB9F61A601CBA00E9B192; 185 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 186 | projectDirPath = ""; 187 | projectRoot = ""; 188 | targets = ( 189 | 13B07F861A680F5B00A75B9A /* expoblesample */, 190 | ); 191 | }; 192 | /* End PBXProject section */ 193 | 194 | /* Begin PBXResourcesBuildPhase section */ 195 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 196 | isa = PBXResourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | BB2F792D24A3F905000567C9 /* Expo.plist in Resources */, 200 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 201 | 3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */, 202 | ); 203 | runOnlyForDeploymentPostprocessing = 0; 204 | }; 205 | /* End PBXResourcesBuildPhase section */ 206 | 207 | /* Begin PBXShellScriptBuildPhase section */ 208 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 209 | isa = PBXShellScriptBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | inputPaths = ( 214 | ); 215 | name = "Bundle React Native code and images"; 216 | outputPaths = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" $PROJECT_ROOT ios relative | tail -n 1)\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n"; 221 | }; 222 | 08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = { 223 | isa = PBXShellScriptBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | inputFileListPaths = ( 228 | ); 229 | inputPaths = ( 230 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 231 | "${PODS_ROOT}/Manifest.lock", 232 | ); 233 | name = "[CP] Check Pods Manifest.lock"; 234 | outputFileListPaths = ( 235 | ); 236 | outputPaths = ( 237 | "$(DERIVED_FILE_DIR)/Pods-expoblesample-checkManifestLockResult.txt", 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | shellPath = /bin/sh; 241 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 242 | showEnvVarsInLog = 0; 243 | }; 244 | 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = { 245 | isa = PBXShellScriptBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | ); 249 | inputPaths = ( 250 | "${PODS_ROOT}/Target Support Files/Pods-expoblesample/Pods-expoblesample-resources.sh", 251 | "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle", 252 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", 253 | ); 254 | name = "[CP] Copy Pods Resources"; 255 | outputPaths = ( 256 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle", 257 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | shellPath = /bin/sh; 261 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-expoblesample/Pods-expoblesample-resources.sh\"\n"; 262 | showEnvVarsInLog = 0; 263 | }; 264 | FD10A7F022414F080027D42C /* Start Packager */ = { 265 | isa = PBXShellScriptBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | ); 269 | inputFileListPaths = ( 270 | ); 271 | inputPaths = ( 272 | ); 273 | name = "Start Packager"; 274 | outputFileListPaths = ( 275 | ); 276 | outputPaths = ( 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | shellPath = /bin/sh; 280 | shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > `$NODE_BINARY --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\"`\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open `$NODE_BINARY --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\"` || echo \"Can't start packager automatically\"\n fi\nfi\n"; 281 | showEnvVarsInLog = 0; 282 | }; 283 | /* End PBXShellScriptBuildPhase section */ 284 | 285 | /* Begin PBXSourcesBuildPhase section */ 286 | 13B07F871A680F5B00A75B9A /* Sources */ = { 287 | isa = PBXSourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 291 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 292 | B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */, 293 | 1BB3CA6DCC8848A9BE569C10 /* noop-file.swift in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXSourcesBuildPhase section */ 298 | 299 | /* Begin XCBuildConfiguration section */ 300 | 13B07F941A680F5B00A75B9A /* Debug */ = { 301 | isa = XCBuildConfiguration; 302 | baseConfigurationReference = 6C2E3173556A471DD304B334 /* Pods-expoblesample.debug.xcconfig */; 303 | buildSettings = { 304 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 305 | CLANG_ENABLE_MODULES = YES; 306 | CODE_SIGN_ENTITLEMENTS = expoblesample/expoblesample.entitlements; 307 | CURRENT_PROJECT_VERSION = 1; 308 | ENABLE_BITCODE = NO; 309 | GCC_PREPROCESSOR_DEFINITIONS = ( 310 | "$(inherited)", 311 | "FB_SONARKIT_ENABLED=1", 312 | ); 313 | INFOPLIST_FILE = expoblesample/Info.plist; 314 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 315 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 316 | OTHER_LDFLAGS = ( 317 | "$(inherited)", 318 | "-ObjC", 319 | "-lc++", 320 | ); 321 | OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; 322 | PRODUCT_BUNDLE_IDENTIFIER = com.dfriyia2.expoblesample; 323 | PRODUCT_NAME = expoblesample; 324 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 325 | SWIFT_VERSION = 5.0; 326 | TARGETED_DEVICE_FAMILY = "1,2"; 327 | VERSIONING_SYSTEM = "apple-generic"; 328 | }; 329 | name = Debug; 330 | }; 331 | 13B07F951A680F5B00A75B9A /* Release */ = { 332 | isa = XCBuildConfiguration; 333 | baseConfigurationReference = 7A4D352CD337FB3A3BF06240 /* Pods-expoblesample.release.xcconfig */; 334 | buildSettings = { 335 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 336 | CLANG_ENABLE_MODULES = YES; 337 | CODE_SIGN_ENTITLEMENTS = expoblesample/expoblesample.entitlements; 338 | CURRENT_PROJECT_VERSION = 1; 339 | INFOPLIST_FILE = expoblesample/Info.plist; 340 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 341 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 342 | OTHER_LDFLAGS = ( 343 | "$(inherited)", 344 | "-ObjC", 345 | "-lc++", 346 | ); 347 | OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; 348 | PRODUCT_BUNDLE_IDENTIFIER = com.dfriyia2.expoblesample; 349 | PRODUCT_NAME = expoblesample; 350 | SWIFT_VERSION = 5.0; 351 | TARGETED_DEVICE_FAMILY = "1,2"; 352 | VERSIONING_SYSTEM = "apple-generic"; 353 | }; 354 | name = Release; 355 | }; 356 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ALWAYS_SEARCH_USER_PATHS = NO; 360 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 361 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 362 | CLANG_CXX_LIBRARY = "libc++"; 363 | CLANG_ENABLE_MODULES = YES; 364 | CLANG_ENABLE_OBJC_ARC = YES; 365 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 366 | CLANG_WARN_BOOL_CONVERSION = YES; 367 | CLANG_WARN_COMMA = YES; 368 | CLANG_WARN_CONSTANT_CONVERSION = YES; 369 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 370 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 371 | CLANG_WARN_EMPTY_BODY = YES; 372 | CLANG_WARN_ENUM_CONVERSION = YES; 373 | CLANG_WARN_INFINITE_RECURSION = YES; 374 | CLANG_WARN_INT_CONVERSION = YES; 375 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 376 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 377 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 378 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 379 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 380 | CLANG_WARN_STRICT_PROTOTYPES = YES; 381 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 382 | CLANG_WARN_UNREACHABLE_CODE = YES; 383 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 384 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 385 | COPY_PHASE_STRIP = NO; 386 | ENABLE_STRICT_OBJC_MSGSEND = YES; 387 | ENABLE_TESTABILITY = YES; 388 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 389 | GCC_C_LANGUAGE_STANDARD = gnu99; 390 | GCC_DYNAMIC_NO_PIC = NO; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_OPTIMIZATION_LEVEL = 0; 393 | GCC_PREPROCESSOR_DEFINITIONS = ( 394 | "DEBUG=1", 395 | "$(inherited)", 396 | ); 397 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 398 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 399 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 400 | GCC_WARN_UNDECLARED_SELECTOR = YES; 401 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 402 | GCC_WARN_UNUSED_FUNCTION = YES; 403 | GCC_WARN_UNUSED_VARIABLE = YES; 404 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 405 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 406 | LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; 407 | MTL_ENABLE_DEBUG_INFO = YES; 408 | ONLY_ACTIVE_ARCH = YES; 409 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 410 | SDKROOT = iphoneos; 411 | }; 412 | name = Debug; 413 | }; 414 | 83CBBA211A601CBA00E9B192 /* Release */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | ALWAYS_SEARCH_USER_PATHS = NO; 418 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 419 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 420 | CLANG_CXX_LIBRARY = "libc++"; 421 | CLANG_ENABLE_MODULES = YES; 422 | CLANG_ENABLE_OBJC_ARC = YES; 423 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 424 | CLANG_WARN_BOOL_CONVERSION = YES; 425 | CLANG_WARN_COMMA = YES; 426 | CLANG_WARN_CONSTANT_CONVERSION = YES; 427 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 428 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 429 | CLANG_WARN_EMPTY_BODY = YES; 430 | CLANG_WARN_ENUM_CONVERSION = YES; 431 | CLANG_WARN_INFINITE_RECURSION = YES; 432 | CLANG_WARN_INT_CONVERSION = YES; 433 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 434 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 435 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 436 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 437 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 438 | CLANG_WARN_STRICT_PROTOTYPES = YES; 439 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 440 | CLANG_WARN_UNREACHABLE_CODE = YES; 441 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 442 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 443 | COPY_PHASE_STRIP = YES; 444 | ENABLE_NS_ASSERTIONS = NO; 445 | ENABLE_STRICT_OBJC_MSGSEND = YES; 446 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 447 | GCC_C_LANGUAGE_STANDARD = gnu99; 448 | GCC_NO_COMMON_BLOCKS = YES; 449 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 450 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 451 | GCC_WARN_UNDECLARED_SELECTOR = YES; 452 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 453 | GCC_WARN_UNUSED_FUNCTION = YES; 454 | GCC_WARN_UNUSED_VARIABLE = YES; 455 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 456 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 457 | LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; 458 | MTL_ENABLE_DEBUG_INFO = NO; 459 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 460 | SDKROOT = iphoneos; 461 | VALIDATE_PRODUCT = YES; 462 | }; 463 | name = Release; 464 | }; 465 | /* End XCBuildConfiguration section */ 466 | 467 | /* Begin XCConfigurationList section */ 468 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "expoblesample" */ = { 469 | isa = XCConfigurationList; 470 | buildConfigurations = ( 471 | 13B07F941A680F5B00A75B9A /* Debug */, 472 | 13B07F951A680F5B00A75B9A /* Release */, 473 | ); 474 | defaultConfigurationIsVisible = 0; 475 | defaultConfigurationName = Release; 476 | }; 477 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "expoblesample" */ = { 478 | isa = XCConfigurationList; 479 | buildConfigurations = ( 480 | 83CBBA201A601CBA00E9B192 /* Debug */, 481 | 83CBBA211A601CBA00E9B192 /* Release */, 482 | ); 483 | defaultConfigurationIsVisible = 0; 484 | defaultConfigurationName = Release; 485 | }; 486 | /* End XCConfigurationList section */ 487 | }; 488 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 489 | } 490 | --------------------------------------------------------------------------------