[BREAKGLASS] Append-only mirror of github.com/bluewallet/react-native-live-activity
Go to file
2022-09-28 10:37:22 +01:00
android chore: initial commit 2022-09-19 10:13:24 +01:00
example update readme 2022-09-28 10:19:25 +01:00
ios update path 2022-09-28 10:33:56 +01:00
scripts chore: initial commit 2022-09-19 10:13:24 +01:00
src add code 2022-09-19 15:36:31 +01:00
.editorconfig chore: initial commit 2022-09-19 10:13:24 +01:00
.gitattributes chore: initial commit 2022-09-19 10:13:24 +01:00
.gitignore chore: initial commit 2022-09-19 10:13:24 +01:00
.watchmanconfig chore: initial commit 2022-09-19 10:13:24 +01:00
.yarnrc chore: initial commit 2022-09-19 10:13:24 +01:00
babel.config.js chore: initial commit 2022-09-19 10:13:24 +01:00
CONTRIBUTING.md chore: initial commit 2022-09-19 10:13:24 +01:00
LICENSE chore: initial commit 2022-09-19 10:13:24 +01:00
package.json chore: initial commit 2022-09-19 10:13:24 +01:00
react-native-live-activity.podspec chore: initial commit 2022-09-19 10:13:24 +01:00
README.md Update README.md 2022-09-28 10:21:39 +01:00
tsconfig.build.json chore: initial commit 2022-09-19 10:13:24 +01:00
tsconfig.json chore: initial commit 2022-09-19 10:13:24 +01:00
yarn.lock add code 2022-09-19 15:36:31 +01:00

react-native-live-activity

This is an example of a Native Module to control the iOS Live Activities.

Installation


npm install react-native-live-activity

Usage

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

Example

Run

$ yarn install

Then

$ open ./example/ios/LiveActivityExample.xcworkspace

After that build the xCode project.

https://user-images.githubusercontent.com/3778297/192741742-9d3a9bc5-e26a-4197-b152-5f60796736eb.mp4

License

MIT


Made with create-react-native-library