feat(watch-connectivity): add WearOS support alongside Apple Watch

This commit is contained in:
2026-08-08 12:00:02 +02:00
parent 2211b8ebe4
commit 831ec6b836
52 changed files with 2278 additions and 62 deletions
+1
View File
@@ -9,6 +9,7 @@ WatchConnectivity = requireOptionalNativeModule("WatchConnectivity") ?? {
isReachable: async () => false,
sendWorkoutPlan: async () => ({ error: "WatchConnectivity native module not available" }),
sendWorkoutCompletion: async () => ({ error: "WatchConnectivity native module not available" }),
pollEvents: async () => [],
getApplicationContext: async () => null,
updateApplicationContext: async () => {},
};
+17
View File
@@ -0,0 +1,17 @@
import { requireOptionalNativeModule, Platform } from "expo-modules-core";
const WearConnectivityNative = Platform.select({
android: () => requireOptionalNativeModule("WearConnectivity"),
default: () => null,
})();
const WearConnectivity = WearConnectivityNative ?? {
isSupported: async () => false,
isPaired: async () => false,
isReachable: async () => false,
sendWorkoutPlan: async () => ({ error: "WearOS native module not available" }),
sendWorkoutCompletion: async () => ({ error: "WearOS native module not available" }),
pollEvents: async () => [],
};
export default WearConnectivity;