This is an example of a Native Module to control the iOS Live Activities.
npm install react-native-live-activity
import {
startActivity,
listAllActivities,
endActivity,
updateActivity,
} from 'react-native-live-activity';
await startActivity("Packing", "Jhon", "12 PM")
await updateActivity(activity.id, "Driving", "Jhon", "12 PM");
await endActivity(activity.id);
const [activities, setActivities] = React.useState<any[]>([]);
listAllActivities().then(setActivities);
Run
$ yarn install
Then
$ open ./example/ios/LiveActivityExample.xcworkspace
After that build the xCode project.
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2022-09-28.at.10.20.58.mp4
MIT
Made with create-react-native-library