silent-pushes-setup
Skill20 starsChanged 2 months agoMITView on GitHub
Set up, audit, or diagnose iOS background (silent) notifications end to end: signed entitlements, APNs registration and environment, provider headers and payload, throttling, Simulator and device testing, and Apple delivery diagnostics. Use for content-available pushes or missing background delivery; not for visible alerts, Live Activities, PushKit, or provider-specific SDK setup.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- code-reviewSkill
- gemini-files-apiSkill
- harness-engineeringSkill
- hint-overlay-visual-verificationSkill
- ios-xcodegenSkill
- lifecycle-and-side-effects-correctnessSkill
- local-model-servingSkill
- mechanism-auditSkill
- meeting-transcriptionSkill
- public-source-release-auditSkill
- spec-creation-updatingSkill
- swift-testingSkill
- swiftui-view-refactorSkill
- xcode-buildSkill
- xcode-cloudSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Use this skill for an iOS or iPadOS app that receives apns-push-type: background notifications.
- Distinctive: line 24
Do not use background push for urgent, guaranteed, or periodic execution.
- Very specific: line 50
Call registerForRemoteNotifications() on each launch.
- Very specific: line 94
Do not add alert, sound, or badge.
- Very specific: line 99
Use an .apns file with simctl push to test local app handling.
- Distinctive: line 104
Use Apple's Push Notifications Console to send a development test before blaming provider code.
- Distinctive: line 107
Test the production environment on a physical device with a production token.
- Distinctive: line 119
Use Console Metrics for aggregated, rounded delivered, stored, and discarded states.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
iOS Background Push Setup And Diagnosis
Apple calls these background notifications. "Silent push" is the common name for an APNs device notification that wakes the app without an alert, sound, or badge.
Scope
Use this skill for an iOS or iPadOS app that receives
apns-push-type: background notifications. Keep these adjacent concerns out of
scope:
- visible alerts, local notifications, notification service extensions, and authorization UX;
- Live Activity, PushKit, VoIP, File Provider, and broadcast push types;
- Firebase, other provider SDKs, provider credential provisioning, and widget refresh policy.
Do not use background push for urgent, guaranteed, or periodic execution. The app must reconcile current server state when it next runs because delivery may be delayed, coalesced, throttled, or dropped.
Audit Workflow
1. Establish The Signed Environment
Record the app bundle ID, signed aps-environment value, device-token source,
and provider endpoint. Do not infer the APNs environment from a scheme or
configuration name.
developmentusesapi.sandbox.push.apple.com.production, including prerelease and beta distribution, usesapi.push.apple.com.- Xcode derives
aps-environmentfrom the provisioning profile. Verify the signed app, not only the source entitlement file or Xcode UI.
2. Verify Capabilities And Registration
The app target needs both:
- Push Notifications, which adds the iOS
aps-environmententitlement; - Background Modes > Remote notifications, which permits background notification handling.
Call registerForRemoteNotifications() on each launch. Handle both registration
callbacks and forward every successful token callback to the provider. Treat
the token as opaque and variable-length; do not cache it locally as truth or
assume a fixed size. Bind provider records to the token, topic, and APNs
environment.
Alert authorization is separate. registerForRemoteNotifications() can obtain
a token for background delivery without first requesting permission for alerts,
sounds, or badges.
3. Verify The Background Handler
Implement
application(_:didReceiveRemoteNotification:fetchCompletionHandler:). Perform
bounded, idempotent reconciliation and call the completion handler exactly once
with .newData, .noData, or .failed. iOS gives the app up to 30 seconds for
this work; a push is a signal to fetch current state, not the state itself.
4. Verify The APNs Request
For a strictly background notification, use:
| Field | Required value or rule |
| Host | Match the token's signed aps-environment |
apns-push-type | background |
apns-priority | 5; priority 10 is invalid for this push type |
apns-topic | The receiving app's bundle ID |
apns-expiration | Choose explicitly from the update's useful lifetime |
apns-collapse-id | Optional; use only when a newer update supersedes an older one |
The payload's aps dictionary contains only content-available. Put small
custom routing data beside aps, not inside it, and keep the whole payload at
or below 4 KB.
{
"aps": {
"content-available": 1
},
"revision": "opaque-server-revision"
}Do not add alert, sound, or badge; that is no longer a strictly background
notification and requires a different push-type decision.
5. Test In Layers
- Use an
.apnsfile withsimctl pushto test local app handling. This bypasses provider authentication and APNs delivery. - On a compatible Simulator, remote APNs registration uses the sandbox only. Simulator tokens are valid for that Simulator and Mac combination and may differ in length from device tokens.
- Use Apple's Push Notifications Console to send a development test before blaming provider code. It can validate tokens and JWTs and generate a cURL request without requiring a custom test sender.
- Test the production environment on a physical device with a production token. Never commit or paste provider keys, JWTs, or complete production tokens into logs or review evidence.
6. Separate Acceptance From Delivery
An APNs HTTP 200 means APNs accepted the request; it does not prove delivery
or app execution. Record the response status, error reason, apns-id, and, in
development, apns-unique-id.
- Query a development delivery log in Push Notifications Console with
apns-unique-id; development logs are available for up to seven days. - Use Console Metrics for aggregated, rounded delivered, stored, and discarded states. Metrics are trend evidence, not a per-device receipt.
- Confirm the app callback and its completion result separately.
7. Apply Apple's Delivery Limits
Background notifications are low priority and never guaranteed. Apple says the allowance varies with current conditions and advises not trying to send more than two or three per hour. Device power state, connectivity, app state, and Background App Refresh settings affect delivery. Testing from Xcode disables some silent-push limits, so a development success is not production frequency proof.
APNs or the device may hold only the newest update, and a held notification is discarded if the app is killed. Design the next app launch or foreground refresh to recover all missed state.
Exit Criteria
- Signed entitlements and provisioning profile agree on
aps-environment. - Registration succeeds and the provider stores the current token with topic and environment.
- Payload, push type, priority, topic, endpoint, and expiration semantics agree.
- APNs acceptance evidence is not reported as delivery evidence.
- A development delivery log or app callback isolates the failing layer.
- Product behavior remains correct when notifications are delayed or dropped.
References
- Apple source map and verified claims:
references/apple-docs.md. - Commands and layered triage:
references/troubleshooting.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

