๐Ÿ”œBeta SDK Deeplink

Beta SDK is currently in the production phase and will be released soon. We are working diligently to finalize it and make it available for you to use.

Deep Linking

When you send a push notification with custom action buttons, you can redirect users to any custom page or view in your app by specifying deep links as custom action button URLs. To do this, you first need to create a URL scheme (your_deeplink_scheme://) in your project.

Using Xcode, edit your Info.plist file:

  • Add a new key, "URL types." Xcode will automatically create an array containing a dictionary called Item 0.

  • Within Item 0, add a key, "URL identifier," and set the value to your custom scheme.

  • Within Item 0, add a key, "URL Schemes." This will automatically be an array containing a string called Item 0.

  • Set "URL Schemes ยป Item 0" to your custom scheme.

Once you are done, you can confirm that your new URL scheme has been added to your app's Info.plist file.

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
	print("openUrl: \(url)")
	return true
}

To detect the universal link provided by Netmera push actions, usually taking the form of https://your_domain/scheme?query, you need to implement a custom handler in your iOS app.

Specifically, add the following code to your didFinishLaunchingWithOptions method and ensure that your AppDelegate conforms to the NetmeraPushDelegate protocol:

//in didFinishLaunchingWithOptions
// Implement NetmeraPushDelegate in your AppDelegate
Netmera.setPushDelegate(self)

Next, you can handle the universal link by implementing the following two delegate methods:

func shouldHandleOpenURL(_ url: URL, for pushObject: NetmeraBasePush) -> Bool {
	if url.host == "your_domain" {
		return true
	}
	return false
}

func handleOpenURL(_ url: URL, for pushObject: NetmeraBasePush) {
	print("openUrl \(url)")
}

In the shouldHandleOpenURL method, check the given URL to determine whether you want to take action. Return true if you intend to handle it.

Subsequently, the handleOpenURL method is invoked when the URL is triggered by Netmera push actions, allowing you to perform the necessary action based on the URL's contents.

Last updated