Customizing UX for Destination URLs

When Responsys Link Tracking is used on calls-to-action in Rich Push and In-app message creatives, mobile app users are bounced off the browser and taken to the destination URL when they click the calls-to-action. This results in a poor user experience for the mobile app users.

The new feature "Customized User Experience for Links and Calls-to-action in Rich Push, In-app Messages" gives Mobile App Developers more control of how these links are handled. For example, if you want these links (including HTTP web links) to all be displayed within the mobile app, you can now do so. You can also fix the user experience of being bounced off a browser before being taken to a destination URL.

The instructions in this section tell you how to implement this feature in your mobile apps.

Before you begin: To use this feature, you must build your app with the Mobile App SDK for iOS, version 6.35 (when available) or greater.

Customizing user experience for links and calls-to-action in Rich Push and In-app messages

Step 1: Enable link tracking

Enable link tracking by calling the setExecuteRsysWebURL: method. This lets the SDK know if the application should be notified with resolved destination URLs. It's better to enable link tracking in application:didFinishLaunchingWithOptions:.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[PushIOManager sharedInstance] setExecuteRsysWebURL:YES];
}						
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
    PushIOManager.sharedInstance().executeRsysWebURL = true
}				

Step 2: Add the Destination URLs Notification Receiver

The SDK broadcasts the PIORsysWebURLResolvedNotification notification to let the application access the destination URLs. Your application needs to listen to the notification PIORsysWebURLResolvedNotification and use the resolved destination URLs. Your application should add the notification listener no later than the application:didFinishLaunchingWithOptions: method.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resolvedURL:) name:PIORsysWebURLResolvedNotification object:nil];
}

-(void)resolvedURL:(NSNotification *)notification{
        NSString *deeplinkURL = notification.userInfo[PIOResolvedDeeplinkURL];
        NSString *weblinkURL = notification.userInfo[PIOResolvedWeblinkURL];
        NSString *requestURL = notification.userInfo[PIORequestedWebURL];
        BOOL isPubwebURLType = [notification.userInfo[PIORequestedWebURLIsPubWebType] boolValue];
        NSError *error = notification.userInfo[PIOErrorResolveWebURL];
}						
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
        NotificationCenter.default.addObserver(self, selector: #selector(self.resolvedURL), name:NSNotification.Name.PIORsysWebURLResolved, object: nil)
}

func resolvedURL(notification:Notification)-> Void{
        if let userInfo = notification.userInfo{
            let deepLink = userInfo[PIOResolvedDeeplinkURL]
            let weblinkURL = userInfo[PIOResolvedWeblinkURL]
            let requestURL = userInfo[PIORequestedWebURL]
            let isPubwebURLType = userInfo[PIORequestedWebURLIsPubWebType]
            let error = userInfo[PIOErrorResolveWebURL]
        }
}