Silent push and the Notification Service Extension: how to modify a notification before it is shown?
The gist
There are two ways to run code on a push. A background (silent) push — "content-available": 1 without an alert: it shows nothing and wakes the app briefly to fetch data. A Notification Service Extension (NSE) — with "mutable-content": 1 the system launches your extension before showing the banner, and it modifies the content: decrypts text, downloads an image, replaces the title. The first is a "there is new data" hint with no guarantees, the second processes every visible notification.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep