{"id":84,"date":"2025-08-10T11:47:51","date_gmt":"2025-08-10T11:47:51","guid":{"rendered":"https:\/\/www.nme.mobi\/blog\/?p=84"},"modified":"2025-08-10T13:01:29","modified_gmt":"2025-08-10T13:01:29","slug":"nativephp-firebase-cloud-messaging-and-the-deep-link","status":"publish","type":"post","link":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/","title":{"rendered":"NativePHP Firebase Cloud Messaging and the deep link"},"content":{"rendered":"<p data-start=\"226\" data-end=\"577\">Push notifications are a powerful tool to engage users \u2014 and opening a specific screen within your app from a notification can dramatically enhance the user experience.<\/p>\n<p data-start=\"226\" data-end=\"577\">Lately, I have been working with FCM and nativePHP. My use case was straightforward: to notify a callee of an incoming call via push notifications. Upon pressing the notification, a deep link to the callee interface was required.<br data-start=\"484\" data-end=\"487\" \/>For the record, I have zero experience with mobile app development, so bear with me.<\/p>\n<h2 data-start=\"226\" data-end=\"577\">What do I wanna achieve<\/h2>\n<p>NativePHP supports deep linking. <a href=\"https:\/\/nativephp.com\/docs\/mobile\/1\/concepts\/deep-links\">Deeplinks<\/a>. This works great when sending for example an email and use your deeplink inside of an email. But here are 2 scenario&#8217;s<\/p>\n<ul>\n<li>Receiving a APN from FCM is not opening a deeplink, tapping it will open the app on the main page.<\/li>\n<li>When the app is in the foreground APN are not shown send from FCM.<\/li>\n<\/ul>\n<h2>TLDR<\/h2>\n<div style=\"width: 580px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-84-1\" width=\"580\" height=\"326\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/IMG_5388.mp4?_=1\" \/><a href=\"https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/IMG_5388.mp4\">https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/IMG_5388.mp4<\/a><\/video><\/div>\n<h2 data-start=\"226\" data-end=\"577\">What did I change to make this work<\/h2>\n<p>First of all we need to create a payload key that has the deeplink value<\/p>\n<pre style=\"width:auto; overflow-x: auto;\">{\r\n  \"token\": \"fbC1hM1erEHmhm8PzeRKkp:APA91bGUlro5G91OY\",\r\n  \"title\" =&gt; 'Deep link test FCM',\r\n  \"body\" =&gt; 'Opens a deeplink in app for the callee',\r\n  \"data\": {\r\n    \"deeplink\": \"mysuperapp:\/\/asterisk\/agent-endpoint\"\r\n  },\r\n  \"androidConfig\": {\r\n    \"priority\": \"high\",\r\n    \"notification\": {\r\n      \"sound\": \"default\"\r\n    }\r\n  },\r\n  \"apnsConfig\": {\r\n    \"headers\": {\r\n      \"apns-priority\": \"10\"\r\n    },\r\n    \"payload\": {\r\n      \"aps\": {\r\n        \"sound\": \"incoming-call.caf\"\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n<\/pre>\n<p>The next part is adding some extra code to the nativephp\/ios\/AppDelegate.swift file<\/p>\n<pre style=\"width:auto; overflow-x: auto;\">\r\nimport SwiftUI\r\nimport AVFoundation\r\nimport UserNotifications\r\nimport FirebaseMessaging\r\n\r\nclass AppDelegate: NSObject, UIApplicationDelegate, MessagingDelegate, UNUserNotificationCenterDelegate {\r\n    static let shared = AppDelegate()\r\n\r\n    \/\/ Called when the app is launched\r\n    func application(\r\n        _ application: UIApplication,\r\n        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil\r\n    ) -&gt; Bool {\r\n        \/\/ Set self as the delegate for the Messaging instance\r\n        if FirebaseManager.shared.isConfigured {\r\n            Messaging.messaging().delegate = self\r\n        }\r\n\r\n        \/\/ Check if the app was launched from a URL (custom scheme)\r\n        if let url = launchOptions?[UIApplication.LaunchOptionsKey.url] as? URL {\r\n            DebugLogger.shared.log(\"\ud83d\udcf1 AppDelegate: Cold start with custom scheme URL: \\(url)\")\r\n            \/\/ Pass the URL to the DeepLinkRouter\r\n            DeepLinkRouter.shared.handle(url: url)\r\n        }\r\n\r\n        \/\/ Check if the app was launched from a Universal Link\r\n        if let userActivityDictionary = launchOptions?[UIApplication.LaunchOptionsKey.userActivityDictionary] as? [String: Any],\r\n           let userActivity = userActivityDictionary[\"UIApplicationLaunchOptionsUserActivityKey\"] as? NSUserActivity,\r\n           userActivity.activityType == NSUserActivityTypeBrowsingWeb,\r\n           let url = userActivity.webpageURL {\r\n            DebugLogger.shared.log(\"\ud83d\udcf1 AppDelegate: Cold start with Universal Link: \\(url)\")\r\n            \/\/ Pass the URL to the DeepLinkRouter\r\n            DeepLinkRouter.shared.handle(url: url)\r\n        }\r\n\r\n        <strong>\/\/ &lt;-- ADDED: Set notification center delegate to self<\/strong>\r\n<strong>        UNUserNotificationCenter.current().delegate = self<\/strong>\r\n\r\n        return true\r\n    }\r\n\r\n    \/\/ Called for Universal Links\r\n    func application(\r\n        _ application: UIApplication,\r\n        continue userActivity: NSUserActivity,\r\n        restorationHandler: @escaping ([UIUserActivityRestoring]?) -&gt; Void\r\n    ) -&gt; Bool {\r\n        \/\/ Check if this is a Universal Link\r\n        if userActivity.activityType == NSUserActivityTypeBrowsingWeb,\r\n           let url = userActivity.webpageURL {\r\n            \/\/ Pass the URL to the DeepLinkRouter\r\n            DeepLinkRouter.shared.handle(url: url)\r\n            return true\r\n        }\r\n\r\n        return false\r\n    }\r\n\r\n    \/\/ Called when the user grants (or revokes) notification permissions\r\n    func application(\r\n        _ application: UIApplication,\r\n        didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data\r\n    ) {\r\n        \/\/ Put the token in PHP's memory so the developer can fetch it manually\r\n        let tokenString = deviceToken.map { String(format: \"%02x\", $0) }.joined()\r\n        NativePHPSetPushTokenC(tokenString)\r\n\r\n        if FirebaseManager.shared.isConfigured {\r\n            \/\/ Pass to Firebase\r\n            Messaging.messaging().deleteToken { error in\r\n                Messaging.messaging().apnsToken = deviceToken\r\n            }\r\n        } else {\r\n            \/\/ Fire TokenGenerated event\r\n            LaravelBridge.shared.send?(\r\n                \"Native\\\\Mobile\\\\Events\\\\PushNotification\\\\TokenGenerated\",\r\n                [\"token\": tokenString]\r\n            )\r\n        }\r\n    }\r\n\r\n    func application(\r\n        _ application: UIApplication,\r\n        didFailToRegisterForRemoteNotificationsWithError error: Error\r\n    ) {\r\n        print(\"Failed to register for remote notifications:\", error.localizedDescription)\r\n    }\r\n\r\n    \/\/ Handle deeplinks\r\n    func application(\r\n        _ app: UIApplication,\r\n        open url: URL,\r\n        options: [UIApplication.OpenURLOptionsKey: Any] = [:]\r\n    ) -&gt; Bool {\r\n        \/\/ Pass the URL to the DeepLinkRouter\r\n        DeepLinkRouter.shared.handle(url: url)\r\n        return true\r\n    }\r\n\r\n    func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {\r\n        guard let fcmToken = fcmToken else { return }\r\n\r\n        LaravelBridge.shared.send?(\r\n            \"Native\\\\Mobile\\\\Events\\\\PushNotification\\\\TokenGenerated\",\r\n            [\"token\": fcmToken]\r\n        )\r\n    }\r\n\r\n    <strong>\/\/ &lt;-- ADDED: Handle notification tap and extract deeplink URL from payload<\/strong>\r\n<strong>    func userNotificationCenter(_ center: UNUserNotificationCenter,<\/strong>\r\n<strong>                                didReceive response: UNNotificationResponse,<\/strong>\r\n<strong>                                withCompletionHandler completionHandler: @escaping () -&gt; Void) {<\/strong>\r\n<strong>        let userInfo = response.notification.request.content.userInfo<\/strong>\r\n\r\n\r\n<strong>        if let deeplinkString = userInfo[\"deeplink\"] as? String,<\/strong>\r\n<strong>           let deeplinkURL = URL(string: deeplinkString) {<\/strong>\r\n<strong>            DeepLinkRouter.shared.handle(url: deeplinkURL)<\/strong>\r\n<strong>        }<\/strong>\r\n<strong>        completionHandler()<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    \/\/ &lt;-- ADDED: Show notifications even when app is in foreground (optional)<\/strong>\r\n<strong>    func userNotificationCenter(_ center: UNUserNotificationCenter,<\/strong>\r\n<strong>                                willPresent notification: UNNotification,<\/strong>\r\n<strong>                                withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -&gt; Void) {<\/strong>\r\n<strong>        completionHandler([.banner, .sound]) \/\/<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Push notifications are a powerful tool to engage users \u2014 and opening a specific screen within your app from a notification can dramatically enhance the user experience. Lately, I have been working with FCM and nativePHP. My use case was straightforward: to notify a callee of an incoming call via push notifications. Upon pressing the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":105,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-84","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nativephp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>NativePHP Firebase Cloud Messaging and the deep link - New Media Entertainment<\/title>\n<meta name=\"description\" content=\"I\u2019ve been working with FCM and NativePHP to solve a tricky problem: getting push notifications to open a specific screen in my app using deep links. In this guide, I share how I customized the notification payload and tweaked the iOS AppDelegate.swift to handle deep links properly\u2014even when the app is in the foreground. Perfect if you want to improve your app\u2019s user experience without deep mobile coding knowledge!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NativePHP Firebase Cloud Messaging and the deep link - New Media Entertainment\" \/>\n<meta property=\"og:description\" content=\"I\u2019ve been working with FCM and NativePHP to solve a tricky problem: getting push notifications to open a specific screen in my app using deep links. In this guide, I share how I customized the notification payload and tweaked the iOS AppDelegate.swift to handle deep links properly\u2014even when the app is in the foreground. Perfect if you want to improve your app\u2019s user experience without deep mobile coding knowledge!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/\" \/>\n<meta property=\"og:site_name\" content=\"New Media Entertainment\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T11:47:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-10T13:01:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/pexels-goumbik-574071-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1695\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/#\\\/schema\\\/person\\\/af3e0d852abc6918b3b8fd617643536d\"},\"headline\":\"NativePHP Firebase Cloud Messaging and the deep link\",\"datePublished\":\"2025-08-10T11:47:51+00:00\",\"dateModified\":\"2025-08-10T13:01:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/\"},\"wordCount\":204,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/pexels-goumbik-574071-scaled.jpg\",\"articleSection\":[\"nativePHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/\",\"url\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/\",\"name\":\"NativePHP Firebase Cloud Messaging and the deep link - New Media Entertainment\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/pexels-goumbik-574071-scaled.jpg\",\"datePublished\":\"2025-08-10T11:47:51+00:00\",\"dateModified\":\"2025-08-10T13:01:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/#\\\/schema\\\/person\\\/af3e0d852abc6918b3b8fd617643536d\"},\"description\":\"I\u2019ve been working with FCM and NativePHP to solve a tricky problem: getting push notifications to open a specific screen in my app using deep links. In this guide, I share how I customized the notification payload and tweaked the iOS AppDelegate.swift to handle deep links properly\u2014even when the app is in the foreground. Perfect if you want to improve your app\u2019s user experience without deep mobile coding knowledge!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/pexels-goumbik-574071-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/pexels-goumbik-574071-scaled.jpg\",\"width\":2560,\"height\":1695},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/nativephp-firebase-cloud-messaging-and-the-deep-link\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"NativePHP Firebase Cloud Messaging and the deep link\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/\",\"name\":\"New Media Entertainment\",\"description\":\"Solutions for THAT problem\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.nme.mobi\\\/blog\\\/#\\\/schema\\\/person\\\/af3e0d852abc6918b3b8fd617643536d\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afd881acea40fb7d25b7d8485bfd177ba674c7193d777e38f1cf61ffc50b5d83?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afd881acea40fb7d25b7d8485bfd177ba674c7193d777e38f1cf61ffc50b5d83?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afd881acea40fb7d25b7d8485bfd177ba674c7193d777e38f1cf61ffc50b5d83?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/www.nme.one\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"NativePHP Firebase Cloud Messaging and the deep link - New Media Entertainment","description":"I\u2019ve been working with FCM and NativePHP to solve a tricky problem: getting push notifications to open a specific screen in my app using deep links. In this guide, I share how I customized the notification payload and tweaked the iOS AppDelegate.swift to handle deep links properly\u2014even when the app is in the foreground. Perfect if you want to improve your app\u2019s user experience without deep mobile coding knowledge!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/","og_locale":"en_US","og_type":"article","og_title":"NativePHP Firebase Cloud Messaging and the deep link - New Media Entertainment","og_description":"I\u2019ve been working with FCM and NativePHP to solve a tricky problem: getting push notifications to open a specific screen in my app using deep links. In this guide, I share how I customized the notification payload and tweaked the iOS AppDelegate.swift to handle deep links properly\u2014even when the app is in the foreground. Perfect if you want to improve your app\u2019s user experience without deep mobile coding knowledge!","og_url":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/","og_site_name":"New Media Entertainment","article_published_time":"2025-08-10T11:47:51+00:00","article_modified_time":"2025-08-10T13:01:29+00:00","og_image":[{"width":2560,"height":1695,"url":"https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/pexels-goumbik-574071-scaled.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/#article","isPartOf":{"@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/"},"author":{"name":"admin","@id":"https:\/\/www.nme.mobi\/blog\/#\/schema\/person\/af3e0d852abc6918b3b8fd617643536d"},"headline":"NativePHP Firebase Cloud Messaging and the deep link","datePublished":"2025-08-10T11:47:51+00:00","dateModified":"2025-08-10T13:01:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/"},"wordCount":204,"commentCount":0,"image":{"@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/#primaryimage"},"thumbnailUrl":"https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/pexels-goumbik-574071-scaled.jpg","articleSection":["nativePHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/","url":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/","name":"NativePHP Firebase Cloud Messaging and the deep link - New Media Entertainment","isPartOf":{"@id":"https:\/\/www.nme.mobi\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/#primaryimage"},"image":{"@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/#primaryimage"},"thumbnailUrl":"https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/pexels-goumbik-574071-scaled.jpg","datePublished":"2025-08-10T11:47:51+00:00","dateModified":"2025-08-10T13:01:29+00:00","author":{"@id":"https:\/\/www.nme.mobi\/blog\/#\/schema\/person\/af3e0d852abc6918b3b8fd617643536d"},"description":"I\u2019ve been working with FCM and NativePHP to solve a tricky problem: getting push notifications to open a specific screen in my app using deep links. In this guide, I share how I customized the notification payload and tweaked the iOS AppDelegate.swift to handle deep links properly\u2014even when the app is in the foreground. Perfect if you want to improve your app\u2019s user experience without deep mobile coding knowledge!","breadcrumb":{"@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/#primaryimage","url":"https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/pexels-goumbik-574071-scaled.jpg","contentUrl":"https:\/\/www.nme.mobi\/blog\/wp-content\/uploads\/2025\/08\/pexels-goumbik-574071-scaled.jpg","width":2560,"height":1695},{"@type":"BreadcrumbList","@id":"https:\/\/www.nme.mobi\/blog\/nativephp-firebase-cloud-messaging-and-the-deep-link\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.nme.mobi\/blog\/"},{"@type":"ListItem","position":2,"name":"NativePHP Firebase Cloud Messaging and the deep link"}]},{"@type":"WebSite","@id":"https:\/\/www.nme.mobi\/blog\/#website","url":"https:\/\/www.nme.mobi\/blog\/","name":"New Media Entertainment","description":"Solutions for THAT problem","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.nme.mobi\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.nme.mobi\/blog\/#\/schema\/person\/af3e0d852abc6918b3b8fd617643536d","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/afd881acea40fb7d25b7d8485bfd177ba674c7193d777e38f1cf61ffc50b5d83?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/afd881acea40fb7d25b7d8485bfd177ba674c7193d777e38f1cf61ffc50b5d83?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afd881acea40fb7d25b7d8485bfd177ba674c7193d777e38f1cf61ffc50b5d83?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/www.nme.one\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/posts\/84","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":41,"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":132,"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/posts\/84\/revisions\/132"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/media\/105"}],"wp:attachment":[{"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/media?parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/categories?post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nme.mobi\/blog\/wp-json\/wp\/v2\/tags?post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}