Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philipheinser/react-native-user-activity
NSUserActivity for React Native
https://github.com/philipheinser/react-native-user-activity
ios react-native user-activity
Last synced: 2 months ago
JSON representation
NSUserActivity for React Native
- Host: GitHub
- URL: https://github.com/philipheinser/react-native-user-activity
- Owner: philipheinser
- License: mit
- Created: 2016-05-06T20:40:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-27T06:06:40.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T16:15:17.769Z (3 months ago)
- Topics: ios, react-native, user-activity
- Language: Objective-C
- Size: 45.9 KB
- Stars: 12
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-user-activity
Setup iOS `NSUserActivity` object.
# Setup
Install module locally.
```sh
$ npm install --save react-native-user-activity
```Link using react-native [cli](https://www.npmjs.com/package/react-native-cli).
```sh
$ react-native link react-native-user-activity
```Declare the activity types that your app supports by including the [NSUserActivityTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW28) key in its Info.plist file.
# Sample usage
```js
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'
});
}
```