Skip to content

Commit 4641d23

Browse files
Merge pull request #8 from celestifyhq/changeset-release/main
chore: version packages
2 parents 460b0f3 + fd3293a commit 4641d23

File tree

3 files changed

+60
-52
lines changed

3 files changed

+60
-52
lines changed

.changeset/eleven-kiwis-yell.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# fcm-cloudflare-workers
2+
3+
## 2.0.0
4+
5+
### Major Changes
6+
7+
- dbe2a39: BREAKING CHANGES:
8+
9+
- Deprecated `sendMulticast` method in favor of new targeting options
10+
- Added new message targeting options: topic and condition-based messaging
11+
- Introduced platform-specific configuration options for iOS and Android
12+
13+
WHY:
14+
15+
- Enhanced flexibility in message targeting to support broader use cases
16+
- Better control over platform-specific notification features
17+
- Improved alignment with Firebase Cloud Messaging's full capabilities
18+
- Simplified API by consolidating message targeting methods
19+
20+
HOW TO UPDATE:
21+
22+
1. Replace `sendMulticast` calls with the new targeting methods:
23+
24+
```typescript
25+
// Old way (deprecated)
26+
await fcm.sendMulticast(tokens, { notification });
27+
28+
// New way
29+
await fcm.sendToTokens(tokens, { notification });
30+
```
31+
32+
2. Message targeting now supports three modes:
33+
- Token-based (using `sendToTokens`)
34+
- Topic-based (new)
35+
- Condition-based (new)
36+
3. Platform configurations can now be specified separately for iOS and Android
37+
4. Update your message payload structure to use the new targeting options if needed
38+
39+
Example of new features:
40+
41+
```typescript
42+
// Token-based messaging (replaces sendMulticast)
43+
await fcm.sendToTokens(["token1", "token2"], {
44+
notification: { title: "Update", body: "New message!" },
45+
});
46+
47+
// Topic messaging
48+
await fcm.sendToTopic("news", {
49+
notification: { title: "News Update", body: "Check out the latest news!" },
50+
});
51+
52+
// Condition-based messaging
53+
await fcm.sendToCondition(
54+
"'sports' in topics && ('game' in topics || 'match' in topics)",
55+
{
56+
notification: { title: "Sports Update", body: "New game results!" },
57+
}
58+
);
59+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fcm-cloudflare-workers",
3-
"version": "1.2.0",
3+
"version": "2.0.0",
44
"description": "Send multicast notifications through the FCM HTTP v1 API on Cloudflare Workers.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)