Deep-linking is a type of action that can be triggered when the user open the push notification. It provides the ability to open a specific page within the app.
This document describes how to handling deep links with push notifications. For information on deep linking with In-App, see Inbox and In-App Action Handling for Android (Mapp Cloud)
Deep Linking functionality has been updated with direct calling to the a method based on the delegate class provided to Appoxee iOS SDK. In our examples mentioned before, the delegate method will reside in AppDelegate.m
Deep linking can be sent using the following:
- apx_dpl is supplied as an extra field key, with a valid URL scheme value
- Sending a push action with a deep link action. Field can be sent in the payload of notification using apx_dpl key.
Example on how to use the sent key in Appoxee iOS SDK is mentioned below:
Objective-C
- (void)openURL:(NSURL*)url options:(NSDictionary<NSString *, id> *)options completionHandler:(void (^ __nullable)(BOOL success))completion { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%@", url] message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alert show]; }
Swift
func open(_ url: URL, options: [String : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil) { var alert: UIAlertView? = nil if let anUrl = url { alert = UIAlertView(title: "\(anUrl)", message: "", delegate: nil, cancelButtonTitle: "OK", otherButtonTitles: "") } alert?.show() }