Push Notification Deep Link not working
Closed this issue · 1 comments
Dear Marketo,
I'm Michael, iOS Developer. I have implemented Market Push Notification and the notification works. I have one Issue that I want to ask.
I put custom link (my app deep link) on push notification. I've already set the URL Type on Info section in X-Code with format mkto-AppSecretKey (Please find the screenshot below).However when I click the notification, I get Log from MarketoSDK.
"MarketoSDK-Deep link received but mkto url scheme not found."
Could you help me with the issue ?
Regards,
Hi Michael,
The mkto- deeplink functionality is intended to be used for adding test devices from the Marketo subscription portal. To handle a custom deeplink (ex. http://dominos) there is more implementation required on the developer side. Mainly checking the scheme to see if the link is from Marketo or Dominos, then just branch off accordingly. The implementation would be similar to this:
- (BOOL)handleURL:(NSURL *)url application:(UIApplication *)application {
if([url.scheme containsString:@"mkto"]){
// goes through adding test device flow, if this link starts with anything but mkto-<secret-key> then you will see the dialog listed above.
return [[Marketo sharedInstance] application:application openURL:url sourceApplication:nil annotation:nil];
} else if([url.scheme containsString:@"dominos"]){
// load targeted view controller
NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
NSURL *reletiveURL = [NSURL fileURLWithPath: bundlePath];
NSString *urlString = [NSString stringWithFormat:@"www/deeplink.html?deeplink=%@",
url.absoluteString];
NSURL *fileURL = [NSURL URLWithString: urlString relativeToURL: reletiveURL];
NSURLRequest *request = [NSURLRequest requestWithURL: fileURL];
[self.viewController.webViewEngine loadRequest:request];
}
return YES;
}
This example shows the deeplink loading a webView for PhoneGap application but should be very similar to loading a native viewController.