Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I was playing around with the Vibration feature of React-native to play Shave and a Haircut

        <VibrateButton title="Shave and a Haircut" pattern={[
          0, // no gap
          200, // shave
          400,
          100, // and
          100,
          100, // a
          200,
          400, // hair
          200,
          300, // cut
          1000, // long pause
          400, // two
          200,
          400 // bits
        ]} />

works well on Android, but doesn't work on iOS.

So I did a quick research and there is likely a way of doing it using CHHapticPattern.advancedPlayer.

That got me to thinking is there a way of getting around of switching to the macOS and I recall NativeScript can do native calls. So I was thinking what if Expo just had a bridge to call NativeScript somehow, I presume it would be a config-plugin and likely needs to be "compiled" separately

You must be logged in to vote

Replies: 2 comments

Comment options

I made a proof of concept of calling NativeScript from an Expo app. Here's an Expo template for it.

Unfortunately, it's limited to Expo SDK 50, React Native v0.72.4 for now (as that's the newest version of React Native that our fork of Hermes Windows works with). I won't be able to update these forks for newer versions of React Native and Expo as it's beyond my expertise. However, I'm hoping in the next year that Node-API support will land in Hermes core and we'll no longer need any of this boilerplate to make this possible.

You must be logged in to vote
0 replies
Comment options

Using what @shirakaba describes, I was able to use it with Expo as well; worked nicely:
https://x.com/wwwalkerrun/status/1783503392771547474?s=46&t=xO7ZRuPOKvNVkUfT7PjvTQ

Looking forward to the Hermes PR linked above landing to help make it broadly available.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.