MarketingCloudSDKURLHandlingDelegate
Objective-C
@protocol MarketingCloudSDKURLHandlingDelegate <NSObject>
Swift
protocol MarketingCloudSDKURLHandlingDelegate : NSObjectProtocol
Supporting Protocol for handling URL’s passed to the SDK.
-
This method, if implemented, can be called when a Alert+CloudPage, Alert+OpenDirect, Alert+Inbox or Inbox message is processed by the SDK. Implementing this method allows the application to handle the URL from Marketing Cloud data.
Prior to the MobilePush SDK version 6.0.0, the SDK would automatically handle these URLs and present them using a SFSafariViewController.
Given security risks inherent in URLs and web pages (Open Redirect vulnerabilities, especially), the responsibility of processing the URL shall be held by the application implementing the MobilePush SDK. This reduces risk to the application by affording full control over processing, presentation and security to the application code itself.
Declaration
Objective-C
- (void)sfmc_handleURL:(NSURL *_Nonnull)url type:(NSString *_Nonnull)type;
Swift
func sfmc_handle(_ url: URL, type: String)
Parameters
url
value NSURL sent with the Location, CloudPage, OpenDirect or Inbox message
type
value NSString constant of the MobilePush source type of this URL