Handle Messages with a URL
The SDK doesn’t automatically present URLs from these sources.
- CloudPage URLs from push notifications
- OpenDirect URLs from push notifications
- CloudPage URLs from inbox messages using the built-in
UITableView
delegate
To handle URLs from these sources, follow these instructions.
- Implement the
MarketingCloudSDKURLHandlingDelegate
protocol in your app. - Use the
sfmc_setURLHandlingDelegate:
method to set a delegate for this protocol.
If you implement the
sfmc_handleURL:type:
protocol method and setMarketingCloudSDKURLHandlingDelegate
, the SDK calls thesfmc_setURLHandlingDelegate:
method. The SDK passes to your implementation ofsfmc_handleURL:type:
an NSURL value. This value contains the data of the push notification or inbox message, including the URL. A type value also reflects the source of the URL, eitherSFMCURLTypeCloudPage
orSFMCURLTypeOpenDirect
.
See
MarketingCloudSDK+URLHandling.h
for more information.