feat(watch-connectivity): add WearOS support alongside Apple Watch
This commit is contained in:
@@ -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 () => {},
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user