Deep Linking
Deep Linking
To redirect users to a specific page or view in your app via push notifications with custom action buttons, you can use deep links. Follow these steps to set up deep linking in your app:
Set Up a URL Scheme In your Xcode project, define a custom URL scheme (
your_deeplink_scheme://
).Configure Info.plist
Open your Info.plist file.
Add a new key:
URL types
. Xcode will create an array with a dictionary calledItem 0
.Inside
Item 0
, add:URL identifier
> Set it to your custom scheme.URL Schemes
>This creates an array.Item 0
insideURL Schemes
> Set it to your custom scheme.
Handle the Deep Link
Implement the following method in your AppDelegate.swift
to handle deep links:
Universal Links
To handle universal links from Netmera push actions (e.g., https://your_domain/scheme?query
):
Set Netmera Push Delegate
In didFinishLaunchingWithOptions
, add:
Ensure that your AppDelegate
conforms to the NetmeraPushDelegate
protocol.
Implement Universal Link Handlers
Add the following methods to handle universal links:
shouldHandleOpenURL
: Checks if the URL should be handled. Returntrue
to process it.handleOpenURL
: Executes when the URL is triggered by a Netmera push action.
Last updated
Was this helpful?