Skip to main content

Command Palette

Search for a command to run...

Push notifications and deeplinks

Published
1 min readView as Markdown

Deeplinks

These can be triggered in three ways

  • WITHIN the app. E.g. if you have a notifications feed
  • OUTSIDE the app, via a push notification
  • OUTSIDE the app, by tapping on link in Safari, e.g. your-app://somedeeplink

Deeplinks always have an associated URL? that Swift will need to handle, in order to open the deeplink and send the user to the correct place.

Push notifications

Push notifications are ALWAYS deeplinks.

Swift will first handle push notifications via the app delegate function and populating the userInfo: [AnyHashable: Any]:

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)

This will open the app.

Once the app is open, then it is time to handle the deeplink's url, in order to send the user to the right place inside the app.

9 views

More from this blog

CoderLyn's developer journey

136 posts

I'm an iOS developer, helping millennials with their finances through US neo-bank, Empower.

Before making the switch to development, I was a strategist and GM in the tech space.