Setup iOS NSUserActivity
object.
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.
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'
});
}