philipheinser / react-native-user-activity

NSUserActivity for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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'
  });
}

About

NSUserActivity for React Native

License:MIT License


Languages

Language:Objective-C 62.1%Language:JavaScript 27.9%Language:Ruby 10.0%