push-notification

push-notification is a skill for Claude Code, Codex from wangjianqi/AppStore. It costs 36 tokens per session (2,679 once invoked), scanned A, original, MIT.

An iOS guide for push notifications and background work using Apple services such as APNs. It covers permission requests, device-token management, silent and rich notifications, notification extensions, background refresh, and downloads.

In plain words
What is it for?
Use it when adding alerts, badges, sounds, silent updates, rich notification content, background tasks, or background downloads to an iOS app.
Why use it?
It helps apps request permission at an appropriate moment, handle denied access, and manage notification and background states correctly.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/wangjianqi/appstore/12-push-notification
Any agent
npx skills add wangjianqi/AppStore --skill 12-push-notification
Clone the repo
git clone --depth 1 https://github.com/wangjianqi/AppStore

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for push-notification

README.md
[![agentmods](https://agentmods.dev/badge/skills/wangjianqi/appstore/12-push-notification.svg)](https://agentmods.dev/skills/wangjianqi/appstore/12-push-notification)
Your own site
<a href="https://agentmods.dev/skills/wangjianqi/appstore/12-push-notification"><img src="https://agentmods.dev/badge/skills/wangjianqi/appstore/12-push-notification.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,679 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.02679
Opus 5 $0.00018 $0.01340
Sonnet 5 $0.00007 $0.00536
Haiku 4.5 $0.00004 $0.00268

Measured 6d ago against content hash ddbd84c91006, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

push-notification scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

ios-claude-skills/12-push-notification/SKILL.md · 392 lines

How it starts

The opening of the file, as written. The whole thing — 392 lines — stays where its author put it; the contents beside it link to each section on GitHub.

推送通知与后台任务

通知权限

请求时机

  • 禁止在 App 启动时立即请求通知权限,应在用户触发相关操作后请求(如完成注册、关注内容后)
  • 只请求一次,被拒绝后禁止反复弹窗,引导用户去系统设置开启

权限请求

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in
    DispatchQueue.main.async {
        if granted {
            UIApplication.shared.registerForRemoteNotifications()
        }
    }
}

权限检查与引导

func checkNotificationAuthorization() async -> Bool {
    let settings = await UNUserNotificationCenter.current().notificationSettings()
    if settings.authorizationStatus == .denied {
        showSettingsAlert(message: "请在系统设置中开启通知权限")
        return false
    }
    return settings.authorizationStatus == .authorized
}

func showSettingsAlert(message: String) {
    guard let url = URL(string: UIApplication.openSettingsURLString) else { return }
    if UIApplication.shared.canOpenURL(url) {
        UIApplication.shared.open(url)
    }
}

APNs 注册与 Token 管理

注册

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    let token = deviceToken.map { String(format: "%02x", $0) }.joined()
    TokenStorage.shared.saveAPNsToken(token)
    Task { await sendTokenToBackend(token) }
}

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
    Logger.error("APNs 注册失败: \(error)")
}

Token 管理

  • Token 每次安装和系统更新都可能变化,每次启动都必须注册
  • Token 发送到后端后本地缓存,下次对比是否变化,变化则重新上报
  • 模拟器无法获取 APNs Token,Debug 时需跳过或使用测试 Token

本地通知

基本发送

func scheduleLocalNotification(title: String, body: String, in seconds: TimeInterval) {
    let content = UNMutableNotificationContent()
    content.title = title
    content.body = body
    content.sound = .default
    content.badge = NSNumber(value: UIApplication.shared.applicationIconBadgeNumber + 1)

    let trigger = UNTimeIntervalNotificationTrigger(timeInterval: seconds, repeats: false)
    let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)

    UNUserNotificationCenter.current().add(request)
}

Read the full file on GitHub · 392 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 392 lines · 36 tokens per session scan A ddbd84c91006

Subscribe to this mod's changes

push-notification is a skill published in the GitHub repository wangjianqi/AppStore (11 stars, last pushed 3mo ago), licensed MIT. It adds 36 tokens to every session and 2,679 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ipaship-audit

Use when auditing iOS/Android app submissions for compliance with Apple App Store Review Guidelines or Google Play Developer Policies. Scan .ipa, .apk, or .zip files against official store policies, generate structured compliance reports, and identify violations with remediation steps.

atharvnaik1/ipaship-audit · 57 tokens

view-specifications

Guide for writing view specification documents and a starter template for SwiftUI and cross-platform views.

jpavley/meta-loop-ios · 21 tokens

project-structure

Directory layout, file responsibilities, and Xcode integration for meta-loop projects.

jpavley/meta-loop-ios · 18 tokens

analyzing-ios-app-security-with-objection

Runtime iOS app security testing with Objection (Frida): inspect keychain and filesystem data, explore app internals at runtime, and validate/bypass client-side protections during authorized mobile assessments.

mukul975/Anthropic-Cybersecurity-Skills · 49 tokens

argent-react-native-optimization

Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup. Delegates to argent-react-native-profiler for measurement.

software-mansion/argent · 71 tokens

argent-tv-interact

Control and inspect TV apps via argent — Apple TV (tvOS), Android TV (leanback), and Amazon Fire TV (Vega). Boot the target, read focus, navigate with the D-pad remote, type, screenshot, and on Vega debug the JS runtime (evaluate, console logs, network inspector). Use when a task targets a TV (runtimeKind "tv", or…

software-mansion/argent · 107 tokens