react-native-siri-shortcuts

NSUserActivity for React Native

Usage no npm install needed!

<script type="module">
  import reactNativeSiriShortcuts from 'https://cdn.skypack.dev/react-native-siri-shortcuts';
</script>

README

React Native Siri Shortcuts · npm version

NSUserActivity for React Native


Setup

Install module locally.

$ npm install --save react-native-siri-shortcuts

Link using react-native cli.

$ react-native link react-native-siri-shortcuts

Declare the activity types that your app supports by including the NSUserActivityTypes key in its Info.plist file.

Sample usage

import RNSiriShortcuts from 'react-native-siri-shortcuts';

...

componentDidMount() {
  RNSiriShortcuts.createActivity({
    activityType: 'com.company.app.activity',
    eligibleForSearch: true,
    eligibleForPrediction: true,
    title: 'Title of Activity',
  });
}

License

React Native is MIT licensed.

React Native documentation is Creative Commons licensed.