MΓ³dulo 18 Β· Push & Background Work β LecciΓ³n 2 de 4 Β· ~9 min
Enriching a push
Foreground vs. background presentation
When a push arrives while PawWalk is in the foreground, iOS doesn't automatically show a banner β your app gets first say. The UNUserNotificationCenterDelegate method userNotificationCenter(_:willPresent:withCompletionHandler:) fires, and you call its completionHandler with the presentation options you want (.banner, .sound, .badge, or [] for none). Skip this delegate method and foreground pushes are silent by default β a common "why isn't my push showing" bug.
When the app is backgrounded or not running, the system shows the banner itself β no delegate call needed for that part.