We are doing and R & D on smart watch support using React Native. R & D scope is like connect to a smart watch through phone then trigger/vibrate the watch when event comes from socket in phone. So at that time we will be sending some particular message from phone to smart watch to initiate the vibration.
When searching for the same we came across this SO Question which says RN doesn't support smart watch(remember the post is from 2016)
In the same post it mention about ReactNative Vanilla which I totally don't understand
Then I came across this GitHub but this involves native side coding.
If anybody can give any insight into the same it would be helpful Thanks in advance
Tried searching for the same and couldn't find anything useful
Mobile device sends the message
import { sendMessage } from 'react-native-wear-connectivity';
sendMessage({ text: 'Hello watch!' });
WearOS device receives the message
import { watchEvents } from 'react-native-wear-connectivity';
const unsubscribe = watchEvents.on('message', (message) => {
console.log('received message from watch', message);
});
Vibration.vibrate()
React Native API to vibrate the wearOS device:https://reactnative.dev/docs/vibration
Vibration.vibrate()
This is the RN Implementation of the Vibration Module https://github.com/facebook/react-native/blob/aff06a4f8542f13ea2ea18fde0ec73a99fef577b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/vibration/VibrationModule.java#L14