Push Notification Setup

Push Notification Setup

Guides an AI agent to implement push notifications on iOS and Android with Firebase Cloud Messaging and APNs, including handling, deep links and backend integration.

Skill files7 files

references/

scripts/

templates/

SKILL.md103 lines
1
---
2
name: push-notification-setup
3
description: >
4
Implement push notifications for iOS and Android. Covers Firebase Cloud
5
Messaging, Apple Push Notification service, handling notifications, and
6
backend integration.
7
---
8
9
# Push Notification Setup
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement comprehensive push notification systems for iOS and Android applications using Firebase Cloud Messaging and native platform services.
22
23
## When to Use
24
25
- Sending real-time notifications to users
26
- Implementing user engagement features
27
- Deep linking from notifications to specific screens
28
- Handling silent/background notifications
29
- Tracking notification analytics
30
31
## Quick Start
32
33
Minimal working example:
34
35
```javascript
36
import messaging from "@react-native-firebase/messaging";
37
import { Platform } from "react-native";
38
39
export async function initializeFirebase() {
40
try {
41
if (Platform.OS === "ios") {
42
const permission = await messaging().requestPermission();
43
if (permission === messaging.AuthorizationStatus.AUTHORIZED) {
44
console.log("iOS notification permission granted");
45
}
46
}
47
48
const token = await messaging().getToken();
49
console.log("FCM Token:", token);
50
await saveTokenToBackend(token);
51
52
messaging().onTokenRefresh(async (newToken) => {
53
await saveTokenToBackend(newToken);
54
});
55
56
messaging().onMessage(async (remoteMessage) => {
57
console.log("Notification received:", remoteMessage);
58
showLocalNotification(remoteMessage);
59
});
60
61
// ... (see reference guides for full implementation)
62
```
63
64
## Reference Guides
65
66
Detailed implementations in the `references/` directory:
67
68
| Guide | Contents |
69
|---|---|
70
| [Firebase Cloud Messaging Setup](references/firebase-cloud-messaging-setup.md) | Firebase Cloud Messaging Setup |
71
| [iOS Native Setup with Swift](references/ios-native-setup-with-swift.md) | iOS Native Setup with Swift |
72
| [Android Setup with Kotlin](references/android-setup-with-kotlin.md) | Android Setup with Kotlin |
73
| [Flutter Implementation](references/flutter-implementation.md) | Flutter Implementation |
74
75
## Best Practices
76
77
### ✅ DO
78
79
- Request permission before sending notifications
80
- Implement token refresh handling
81
- Use different notification channels by priority
82
- Validate tokens regularly
83
- Track notification delivery
84
- Implement deep linking
85
- Handle notifications in all app states
86
- Use silent notifications for data sync
87
- Store tokens securely on backend
88
- Provide user notification preferences
89
- Test on real devices
90
91
### ❌ DON'T
92
93
- Send excessive notifications
94
- Send without permission
95
- Store tokens insecurely
96
- Ignore notification failures
97
- Send sensitive data in payload
98
- Use notifications for spam
99
- Forget to handle background notifications
100
- Make blocking calls in handlers
101
- Send duplicate notifications
102
- Ignore user preferences
103

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…