重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
push-notification-setup by secondsky/claude-skills
npx skills add https://github.com/secondsky/claude-skills --skill push-notification-setup在移动端和网页端平台实现推送通知功能。
import messaging from '@react-native-firebase/messaging';
// 请求权限
async function requestPermission() {
const status = await messaging().requestPermission();
if (status === messaging.AuthorizationStatus.AUTHORIZED) {
const token = await messaging().getToken();
await sendTokenToServer(token);
}
}
// 处理前台消息
messaging().onMessage(async message => {
console.log('Foreground message:', message);
showLocalNotification(message);
});
// 处理后台/退出状态消息
messaging().setBackgroundMessageHandler(async message => {
console.log('Background message:', message);
});
// 处理令牌刷新
messaging().onTokenRefresh(token => {
sendTokenToServer(token);
});
import UserNotifications
func requestAuthorization() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in
if granted {
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
}
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
sendTokenToServer(token)
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
class MyFirebaseService : FirebaseMessagingService() {
override fun onNewToken(token: String) {
sendTokenToServer(token)
}
override fun onMessageReceived(message: RemoteMessage) {
message.notification?.let {
showNotification(it.title, it.body)
}
}
private fun showNotification(title: String?, body: String?) {
val channelId = "default"
val notification = NotificationCompat.Builder(this, channelId)
.setContentTitle(title)
.setContentText(body)
.setSmallIcon(R.drawable.ic_notification)
.build()
NotificationManagerCompat.from(this).notify(0, notification)
}
}
每周安装量
65
代码仓库
GitHub 星标数
90
首次出现时间
2026年1月25日
安全审计
已安装于
claude-code57
codex51
gemini-cli50
opencode49
cursor49
github-copilot47
Implement push notifications across mobile and web platforms.
import messaging from '@react-native-firebase/messaging';
// Request permission
async function requestPermission() {
const status = await messaging().requestPermission();
if (status === messaging.AuthorizationStatus.AUTHORIZED) {
const token = await messaging().getToken();
await sendTokenToServer(token);
}
}
// Handle foreground messages
messaging().onMessage(async message => {
console.log('Foreground message:', message);
showLocalNotification(message);
});
// Handle background/quit messages
messaging().setBackgroundMessageHandler(async message => {
console.log('Background message:', message);
});
// Handle token refresh
messaging().onTokenRefresh(token => {
sendTokenToServer(token);
});
import UserNotifications
func requestAuthorization() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in
if granted {
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
}
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
sendTokenToServer(token)
}
class MyFirebaseService : FirebaseMessagingService() {
override fun onNewToken(token: String) {
sendTokenToServer(token)
}
override fun onMessageReceived(message: RemoteMessage) {
message.notification?.let {
showNotification(it.title, it.body)
}
}
private fun showNotification(title: String?, body: String?) {
val channelId = "default"
val notification = NotificationCompat.Builder(this, channelId)
.setContentTitle(title)
.setContentText(body)
.setSmallIcon(R.drawable.ic_notification)
.build()
NotificationManagerCompat.from(this).notify(0, notification)
}
}
Weekly Installs
65
Repository
GitHub Stars
90
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code57
codex51
gemini-cli50
opencode49
cursor49
github-copilot47
TanStack Query v5 完全指南:React 数据管理、乐观更新、离线支持
2,500 周安装
OpenClaw 指挥中心 - AI 工作团队任务控制面板,实时监控会话与系统状态
75 周安装
OpenZeppelin Stylus 合约设置指南:Rust 智能合约开发与部署教程
74 周安装
Notion自动化指南:通过Rube MCP与Composio实现页面、数据库与内容管理
72 周安装
Vercel自动化部署与监控指南 - 通过Rube MCP实现项目自动化管理
71 周安装
技术债务可视化工具 - 识别高息技术债务,优化代码重构优先级
78 周安装
Salesforce B2C Commerce 元数据开发指南:自定义属性、对象与站点偏好设置
71 周安装