Repository navigation
How to use library only for IOS? #775
Description
Activity
just delete the
androidfolder and any code and scripts referencing androidi've tried to delete android folder, also removed references to android here
package.json"codegenConfig": { "name": "RNAppleHealthKitSpec", "type": "modules", "jsSrcsDir": "src", "outputDir": { "ios": "ios/generated", "android": "android/generated" }, "android": { "javaPackageName": "com.applehealthkit" }, "includesGeneratedCode": true },still could not build example app for android, also android folder was created again after
yarn installin root folder.
i'd be really grateful if you check this and add more details what i need to delete (link to repo)as a temporary solution to this error (same error 4 times for all methods i defined in spec file)
e: file:///Users/andrei/dev/react-native-apple-health-kit/android/src/main/java/com/applehealthkit/AppleHealthKitModule.kt:7:1 Class 'AppleHealthKitModule' is not abstract and does not implement abstract base class member 'requestHealthKitPermissions'.i just created placeholders with rejects for all methods
package com.applehealthkit import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.module.annotations.ReactModule @ReactModule(name = AppleHealthKitModule.NAME) class AppleHealthKitModule(reactContext: ReactApplicationContext) : NativeAppleHealthKitSpec(reactContext) { override fun getName(): String { return NAME } // Placeholder for requestHealthKitPermissions override fun requestHealthKitPermissions(promise: Promise) { promise.reject("Unsupported", "HealthKit is not supported on Android.") } // Placeholder for getSteps override fun getSteps(daysBefore: Double, promise: Promise) { promise.reject("Unsupported", "HealthKit is not supported on Android.") } // Placeholder for getHeartRate override fun getHeartRate(daysBefore: Double, promise: Promise) { promise.reject("Unsupported", "HealthKit is not supported on Android.") } // Placeholder for getMeasurement override fun getMeasurement(promise: Promise) { promise.reject("Unsupported", "HealthKit is not supported on Android.") } // Placeholder for getAppleMoveTime override fun getAppleMoveTime(daysBefore: Double, promise: Promise) { promise.reject("Unsupported", "HealthKit is not supported on Android.") } companion object { const val NAME = "AppleHealthKit" } }I hope there is a better solution
seems like i found the solution, could you (@satya164) verify it?

FYI converting this into a discussion
- locked and limited conversation to collaborators
on Feb 24, 2025
Hey guys, i created Turbo module using
npx create-react-native-librarywithKotlin & Obj-cbut the thing is that i want to use this module only for IOS since i created library to manage some IOS native things.Sorry if i'm not that descriptive.