react-native-user-activity

0.1.14 • Public • Published

react-native-user-activity

Setup iOS NSUserActivity object.

Setup

Install module locally.

$ npm install --save react-native-user-activity

Link using react-native cli.

$ react-native link react-native-user-activity

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

Sample usage

import UserActivity from 'react-native-user-activity';
 
...
 
componentDidMount() {
  UserActivity.createActivity({
    activityType: 'com.sample.proactive',
    webpageURL: 'http://...',
    eligibleForSearch: true,
    eligibleForPublicIndexing: false,
    eligibleForHandoff: false,
    title: 'Random Place',
    userInfo: {},
    locationInfo: {
      lat: 39.637737,
      lon: 22.417769
    },
    supportsNavigation: true,
    supportsPhoneCall: true,
    phoneNumber: '...',
    description: 'sample description that is not necessary',
    thumbnailURL: 'thumbnail url that is not necessary',
    identifier: 'identifier that is not necessary'
  });
}

/react-native-user-activity/

    Package Sidebar

    Install

    npm i react-native-user-activity

    Weekly Downloads

    2

    Version

    0.1.14

    License

    MIT

    Unpacked Size

    74.8 kB

    Total Files

    13

    Last publish

    Collaborators

    • philipheinser