Skip to main content

Claude/ChatGPT Prompt to Set Up Mobile Push Notifications End-to-End

Wire push notifications across iOS and Android: permissions, token registration, topics, segmentation, rich payloads, deep links, analytics.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt

                                

What this prompt does

This prompt has the AI act as a senior mobile engineer and return working server and client code for the full push notification flow, not a high-level overview. You provide the [platform], the [service], the [backend] stack, and the primary [use_case], and it returns server code, client code, and an example payload, each in its own fenced block.

The five deliverables span every layer where push breaks at once: iOS and Android permission requests with a sensible opt-in UX and a re-ask path after a soft deny; device-token registration to your backend with refresh and de-duplication so one user does not collect stale tokens; topic subscription and user segmentation plus both scheduled and event-triggered sends for your [use_case]; rich payloads with images and action buttons and deep linking that routes correctly from cold start and background; and delivery and open-rate analytics with guidance on testing the whole loop on a real device. The structure works because push fails silently at the token, payload, deep link, and cold-start layers, and the prompt forces each one to be handled.

When to use it

  • You are adding push notifications and need both the backend send logic and the client handling.
  • You keep collecting stale device tokens and need refresh and de-duplication.
  • You want topic-based segmentation plus scheduled and event-triggered sends.
  • You need deep links that route correctly when the app is tapped from a killed state.
  • You want delivery and open-rate analytics rather than fire-and-forget sends.

Example output

You get three fenced blocks: server code that registers and de-duplicates device tokens and sends scheduled and event-triggered notifications through your [service], client code handling permissions, the re-ask path, and deep-link routing from cold and background states, and an example rich payload with an image, action buttons, and the deep-link target for your [use_case].

Pro tips

  • Always test the tap-from-killed-app path; it routes differently from a backgrounded app and breaks silently in production.
  • Get token refresh and de-duplication right early - stale tokens are why a user's notifications quietly stop arriving.
  • Match [service] to your real provider so the send code and payload format are correct as written.
  • Set [use_case] specifically (order updates, re-engagement) so the segmentation and trigger logic fit your actual sends.
  • Design the soft-deny re-ask path deliberately; if you burn the OS permission prompt, you cannot ask again natively.
  • Match [backend] to your stack so the token-registration endpoint and send worker drop into your codebase.
  • Verify deep links route correctly from a backgrounded app too, not only cold start; the two paths hit different lifecycle hooks and one often works while the other does not.
  • Track open rate alongside delivery, since a payload that delivers but never gets tapped usually means the copy or timing is wrong, not the plumbing.

Frequently Asked Questions

Why is the tap-from-killed-app deep link singled out?
When the app is fully killed, a notification tap launches it cold, and the deep-link routing happens before the navigation stack is ready - which differs from a backgrounded app. This path breaks silently in production, so the prompt and these tips push you to test it explicitly.
How does it stop a user from collecting stale device tokens?
The token-registration deliverable includes refresh and de-duplication, so when a device issues a new token the old one is replaced rather than accumulated. Without this, sends fan out to dead tokens and delivery silently degrades.
Can it handle both scheduled and triggered notifications?
Yes - the prompt asks for topic subscription and segmentation plus both scheduled and event-triggered sends for your `[use_case]`. That covers timed campaigns as well as real-time events like an order status change.
Does it cover the permission re-ask after a user declines?
It asks for a sensible opt-in UX with a re-ask path after a soft deny. Note that once the native OS prompt is denied you generally cannot show it again, so the re-ask path typically routes users to settings rather than re-prompting directly.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Mobile App Development Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support