craft-coder/mobile/push-notifications/SKILL.md
Firebase Cloud Messaging and Apple Push Notification Service setup.
npx skillsauth add timequity/plugins push-notificationsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
npx expo install expo-notifications expo-device
import * as Notifications from 'expo-notifications';
import * as Device from 'expo-device';
// Configure
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: true,
shouldSetBadge: true,
}),
});
// Request permission
async function registerForPushNotifications() {
if (!Device.isDevice) return null;
const { status: existingStatus } = await Notifications.getPermissionsAsync();
let finalStatus = existingStatus;
if (existingStatus !== 'granted') {
const { status } = await Notifications.requestPermissionsAsync();
finalStatus = status;
}
if (finalStatus !== 'granted') return null;
const token = await Notifications.getExpoPushTokenAsync({
projectId: 'your-project-id',
});
return token.data;
}
// Foreground
useEffect(() => {
const subscription = Notifications.addNotificationReceivedListener(
(notification) => {
console.log('Received:', notification);
}
);
return () => subscription.remove();
}, []);
// Tap response
useEffect(() => {
const subscription = Notifications.addNotificationResponseReceivedListener(
(response) => {
const data = response.notification.request.content.data;
// Navigate based on data
navigation.navigate(data.screen, data.params);
}
);
return () => subscription.remove();
}, []);
// Send from server
await fetch('https://exp.host/--/api/v2/push/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
to: expoPushToken,
title: 'New message',
body: 'You have a new message',
data: { screen: 'Chat', chatId: '123' },
}),
});
import messaging from '@react-native-firebase/messaging';
// Get FCM token
const fcmToken = await messaging().getToken();
// Background handler
messaging().setBackgroundMessageHandler(async (message) => {
console.log('Background message:', message);
});
tools
Backup strategies, disaster recovery planning, and business continuity.
devops
Cloud cost management, rightsizing, and FinOps practices.
testing
CI/CD pipeline design with GitHub Actions, GitLab CI, and best practices.
development
Validate idea and create detailed PRD. Saves docs/PRD.md to project. Use when: user describes an app idea, wants to create something new. Triggers: "I want to build", "create app", "make website", "build MVP", "хочу создать", "сделать приложение".