feat: WatchOS Quick Replies#6957
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| @interface RCT_EXTERN_MODULE(WatchBridge, NSObject) | ||
|
|
||
| RCT_EXTERN_METHOD( |
There was a problem hiding this comment.
We should not write old arch anymore.
Please migrate it to turbo modules.
| import WatchConnectivity | ||
|
|
||
| @objc(WatchBridge) | ||
| final class WatchBridge: NSObject { |
There was a problem hiding this comment.
I think you can make it more simple than this.
Instead of relying on this native module, we rename this one to WatchModule.
Also, everything is going to be done relying on MMKV.
Similar to WatchModule.getCertificate, you'll create WatchModule.getQuickReplies to read from MMKV.
On WatchConnection, you'll create a new method getQuickReplies as well.
WatchConnection.getQuickReplies will be read on the Watch app for the composer.
When a quick reply is tapped, it should send the message automatically.
| } | ||
|
|
||
| const UserPreferencesView = ({ navigation }: IUserPreferencesViewProps): JSX.Element => { | ||
| const [quickreplies, setQuickreplies] = useUserPreferences<string[]>(WATCHOS_QUICKREPLIES, []); |
There was a problem hiding this comment.
| const [quickreplies, setQuickreplies] = useUserPreferences<string[]>(WATCHOS_QUICKREPLIES, []); | |
| const [quickReplies, setQuickReplies] = useUserPreferences<string[]>(WATCHOS_QUICKREPLIES, []); |
| } | ||
|
|
||
| const UserPreferencesView = ({ navigation }: IUserPreferencesViewProps): JSX.Element => { | ||
| const [quickreplies, setQuickreplies] = useUserPreferences<string[]>(WATCHOS_QUICKREPLIES, []); |
There was a problem hiding this comment.
Create a setting on Admin/Mobile like ScreenLock section.
Admin should look like this:
- Apple Watch
- Quick actions: string
The string should be comma separated and the default ones should be:
- OK
- Yes
- No
- On my way
- Will follow up shortly
Proposed changes
Issue(s)
How to test or reproduce
Screenshots
watchos.quick.replies.mp4
Types of changes
Checklist
Further comments