Skip to content

Commit 5b23def

Browse files
committed
update metadata, readme
1 parent 12b6547 commit 5b23def

File tree

5 files changed

+168
-10
lines changed

5 files changed

+168
-10
lines changed

.changeset/afraid-wings-admire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@kingstinct/react-native-activity-kit": patch
3+
---
4+
5+
update readme

README.md

Lines changed: 158 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,168 @@
1-
# react-native-activity-kit
1+
# @kingstinct/react-native-activity-kit
22

3-
To install dependencies:
3+
A powerful React Native library for iOS Live Activities using ActivityKit, built with Nitro Modules for optimal performance.
4+
5+
## 📱 Features
6+
7+
- **iOS Live Activities**: Create and manage live activities that appear on the lock screen and Dynamic Island
8+
- **Real-time Updates**: Update activity content in real-time with push notifications or local updates
9+
- **TypeScript Support**: Fully typed API for enhanced developer experience
10+
- **Nitro Modules**: Built on Nitro for high-performance native interactions
11+
- **Expo Compatible**: Easy integration with Expo projects via plugin
12+
13+
## 🚀 Installation
14+
15+
```bash
16+
# npm
17+
npm install @kingstinct/react-native-activity-kit
18+
19+
# yarn
20+
yarn add @kingstinct/react-native-activity-kit
21+
22+
# bun
23+
bun install @kingstinct/react-native-activity-kit
24+
```
25+
26+
## ⚙️ Configuration
27+
28+
### Expo Setup
29+
30+
Add the plugin to your `app.json` or `app.config.js`:
31+
32+
```json
33+
{
34+
"expo": {
35+
"plugins": [
36+
"@kingstinct/react-native-activity-kit"
37+
]
38+
}
39+
}
40+
```
41+
42+
The plugin automatically enables Live Activities support in your iOS Info.plist.
43+
44+
### Manual Setup
45+
46+
For non-Expo projects, add this to your iOS `Info.plist`:
47+
48+
```xml
49+
<key>NSSupportsLiveActivities</key>
50+
<true/>
51+
```
52+
53+
## 📖 Usage
54+
55+
```typescript
56+
import { ActivityKit } from '@kingstinct/react-native-activity-kit';
57+
58+
// Check if Live Activities are available
59+
if (ActivityKit.isAvailable) {
60+
// Start a new activity
61+
const activity = ActivityKit.startActivity(
62+
// Attributes (static data)
63+
{
64+
title: "Pizza Order",
65+
orderId: "12345"
66+
},
67+
// State (dynamic data)
68+
{
69+
status: "preparing",
70+
estimatedTime: 15
71+
},
72+
// Options
73+
{
74+
staleDate: new Date(Date.now() + 30 * 60 * 1000), // 30 minutes
75+
relevanceScore: 0.8
76+
}
77+
);
78+
79+
// Update the activity
80+
activity.update({
81+
status: "ready",
82+
estimatedTime: 0
83+
});
84+
85+
// End the activity
86+
activity.end({
87+
status: "completed"
88+
});
89+
}
90+
```
91+
92+
### Listening to Updates
93+
94+
```typescript
95+
// Subscribe to activity updates
96+
ActivityKit.subscribeToActivityUpdates((activity) => {
97+
console.log('Activity updated:', activity.id, activity.activityState);
98+
});
99+
100+
// Subscribe to enablement changes
101+
ActivityKit.subscribeToActivityEnablementUpdates((enabled) => {
102+
console.log('Live Activities enabled:', enabled);
103+
});
104+
```
105+
106+
## 🏗️ Development
107+
108+
This is a monorepo containing:
109+
110+
- `packages/react-native-activity-kit/`: The main library
111+
- `apps/activity-kit-example/`: Example Expo app demonstrating usage
112+
113+
### Setup
4114

5115
```bash
6116
bun install
7117
```
8118

9-
To run:
119+
### Development Commands
10120

11121
```bash
12-
bun run index.ts
122+
# Build the library
123+
bun run codegen
124+
125+
# Lint code
126+
bun run lint
127+
128+
# Type checking
129+
bun run typecheck
130+
131+
# Clean build artifacts
132+
bun run clean:node_modules
133+
134+
# Create a changeset for versioning
135+
bun run create-changeset
13136
```
14137

15-
This project was created using `bun init` in bun v1.2.19. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
138+
## 🛠️ Architecture
139+
140+
Built on [Nitro Modules](https://github.com/mrousavy/nitro) for:
141+
- **High Performance**: Direct Swift/Kotlin bindings
142+
- **Type Safety**: Full TypeScript support
143+
- **Modern Architecture**: Uses the latest React Native architecture
144+
145+
## 📱 Platform Support
146+
147+
- ✅ iOS 16.1+ (Live Activities requirement)
148+
- ❌ Android (Live Activities are iOS-only)
149+
150+
## 🤝 Contributing
151+
152+
1. Fork the repository
153+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
154+
3. Make your changes
155+
4. Run tests and linting (`bun run lint && bun run typecheck`)
156+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
157+
6. Push to the branch (`git push origin feature/amazing-feature`)
158+
7. Open a Pull Request
159+
160+
## 📄 License
161+
162+
MIT License - see [LICENSE](LICENSE) for details.
163+
164+
## 🔗 Links
165+
166+
- [GitHub Repository](https://github.com/kingstinct/react-native-activity-kit)
167+
- [npm Package](https://www.npmjs.com/package/@kingstinct/react-native-activity-kit)
168+
- [iOS ActivityKit Documentation](https://developer.apple.com/documentation/activitykit)

packages/react-native-activity-kit/NitroActivityKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
1111
s.authors = package["author"]
1212

1313
s.platforms = { :ios => min_ios_version_supported }
14-
s.source = { :git => "https://github.com/mrousavy/nitro.git", :tag => "#{s.version}" }
14+
s.source = { :git => "https://github.com/kingstinct/react-native-activity-kit.git", :tag => "#{s.version}" }
1515

1616
s.source_files = [
1717
# Implementation (Swift)

packages/react-native-activity-kit/NitroActivityKitCore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
1111
s.authors = package["author"]
1212

1313
s.platforms = { :ios => min_ios_version_supported }
14-
s.source = { :git => "https://github.com/mrousavy/nitro.git", :tag => "#{s.version}" }
14+
s.source = { :git => "https://github.com/kingstinct/react-native-activity-kit.git", :tag => "#{s.version}" }
1515

1616
# Only include the essential files for App Extensions
1717
s.source_files = [

packages/react-native-activity-kit/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
],
4141
"repository": {
4242
"type": "git",
43-
"url": "git+https://github.com/mrousavy/nitro.git"
43+
"url": "git+https://github.com/kingstinct/react-native-activity-kit.git"
4444
},
4545
"author": "Marc Rousavy <me@mrousavy.com> (https://github.com/mrousavy)",
4646
"license": "MIT",
4747
"bugs": {
48-
"url": "https://github.com/mrousavy/nitro/issues"
48+
"url": "https://github.com/kingstinct/react-native-activity-kit/issues"
4949
},
50-
"homepage": "https://github.com/mrousavy/nitro#readme",
50+
"homepage": "https://github.com/kingstinct/react-native-activity-kit#readme",
5151
"publishConfig": {
5252
"registry": "https://registry.npmjs.org/"
5353
},

0 commit comments

Comments
 (0)