iOS — AppRouter -DeepLinking, Push Notifications (with User State Management)

  1. In App Routing — Routing based on various events in App
  2. Universal URLs / URL Schemes — WebPages / SMS (Messages) / Browser / Notes etc
  3. Push Notifications
  4. Shortcuts / Quick Actions
  5. Maintaining User Auth Flow, if user has not logged in

Universal Links / URL Schemes -

App should be launched from any url, which is adhered by app, and open up required feature screen to perform quick actions.

  • URL Schemes -
  • These are specific to OS viz iOS or Android.
  • If app is not installed then link will land in browser with 404 — not found.
  • No backend required.
  • Link will show popup to confirm whether user wants to launch app
  • Universal Links -
  • These are universal to OS viz iOS or Android.
  • SSL verified backend needed.
  • If app is not installed then link can be configured to have fallback page which can have links to install app.
  • Link clicks will directly launch apps.
  • Link can be copied and used in device browser directly. Webpage will show banner that this link can be opened in app.

Push Notifications

  • Notification when app is in background or inactive
  • This scenario is handled by OS itself and notifications are always shown in Notification Curtain
  • User have default options to cancel or view
  • Notification when app is in foreground
  • In this scenario app has the control whether app should show notficiation in pop-up to confirm from user whether he wants to cancel/ view or directly take user to that required action.

Shortcuts / Quick Actions

  • Both iOS and Android provides support for shortcuts / quick actions from device home / menu screen.
  • When user long presses (3d-touch) any app icon then it shows configured shortcuts of that app.
  • Users can select any of that shortcut option to reach that screen with minimum events.

Maintaining User Auth

App Router

AppRouter — Registration

static let rechargeHostPath = “/recharge”
AppRouter.Builder(path: Router.rechargeHostPath) { (_) in// Add your own Navigation Logic hereRechargeRouter.sharedInstance().initialize(navCont: Router.sharedInstance.getNavigationStack())}.build()

AppRouter — Routing

AppRouter.sharedInstance.route(urlPath: Router.rechargeHostPath)
func application(_ app: UIApplication, open url: URL,options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {AppRouter.sharedInstance.route(urlPath: url.description)return true}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping(UIBackgroundFetchResult) -> Void) {if let aps = userInfo[“aps”] as? [AnyHashable: Any], let target = aps[“path”] as? String {AppRouter.sharedInstance.route(urlPath: target, payload: aps)}}

AppRouter — Maintaining User Auth

AppRouter.sharedInstance.isAuthenticated = true
AppRouter.Builder(path: Router.cashInHostPath) { (_) in// Add your own Navigation Logic hereRechargeRouter.sharedInstance().initialize(navCont: Router.sharedInstance.getNavigationStack())}.isAuthRequired(isRequired: false).build()

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store