Repository navigation
Everything in this release is additive and opt-in: an app that upgrades without touching its code
compiles unchanged and behaves exactly as it did on 5.2.1.
Added
-
RelevaClient.handleNotificationResponse(_:), the SDK's tap entry point for an app that
keeps its ownUNUserNotificationCenterDelegate, or that calls
enablePushEngagementTracking()afterapplication(_:didFinishLaunchingWithOptions:)has
returned. iOS delivers a tap that launched a terminated app to whichever delegate is installed
by the time that method returns, so an SDK started later — inside arequestAuthorization
completion, say — never saw the tap: it was not tracked and its navigation never happened.
Hand the response over and the SDK runs the same handling its own delegate does: engagement
tracking (.opened, or.clickedfor the action button), navigation routing and
onNotificationTapped. It returns whether the notification was Releva's, so an app can route
its own pushes onfalse. A response handed over before tracking is enabled is kept and
processed byenablePushEngagementTracking()— a cold-launch tap is no longer lost. A tap is
tracked and routed once: the SDK forwards Releva taps to the host's delegate, and a host
that then hands the same tap back finds it already handled (the key is the notification
request's identifier and the action identifier). -
RelevaConfig.requestsNotificationAuthorization(defaulttrue) and
RelevaClient.requestPushAuthorization(options:). With the flag set tofalse,
enablePushEngagementTracking()no longer asks for notification permission, so an app can ask
itself — with options the SDK's own request does not include, such as
.providesAppNotificationSettings, or at a moment of its choosing — instead of racing the
SDK's prompt. Everything else about enabling tracking is unchanged: the SDK still takes the
delegate slot and registers its categories.requestPushAuthorization(options:)makes the
request and registers for remote notifications when it is granted, whether or not tracking is
enabled. Left at its default, the SDK asks exactly as it did on 5.2.1. -
RelevaClient.urlHandler, called first for a push whose target is a URL, for every scheme
including http/https. Returningtruemeans the app handled it and the SDK does nothing more.
This is what keeps a universal link inside the app: iOS routes an app's own universal link to
Safari when that app is the one opening it, so the https links the SDK opened itself left the
app. With no handler, or one that returnsfalse, the 5.2.1 behaviour is unchanged — a custom
scheme postsRelevaNavigateToURL, an http/https URL is opened externally. -
RelevaClient.onNavigationand theRelevaNavigationenum (.screen(name:parameters:),
.url(_:),.inbox(messageId:)): every push navigation, typed, on the main thread, in
addition to theRelevaNavigateToScreen/RelevaNavigateToURL/RelevaNavigateToInbox
posts andconsumePendingNavigation(), which are all unchanged. Assigning a handler replays
the pending navigation and consumes it, so a handler installed after a cold-launch tap still
receives it; a navigation a handler already received is not replayed to the next one. An http/https URL the SDK opens externally is not reported, as it is not
posted either, and neither is oneurlHandlerclaims..inbox(messageId:)reads the id the
backend sends as a string ("13") as well as a number. -
StoryPresenter, the UIKit counterpart of the.storyDisplay(client:onLinkTap:)modifier,
alongsideBannerPresenterandNpsPresenter.StoryPresenter(host:client:onLinkTap:),
bracketed bystart()/stop()in the host's appearance callbacks, presents the same
StoryViewerViewfull screen and queues stories one at a time through the same
StoryDisplayViewModel, so impressions, slide views, slide clicks, completion and close are
reported identically on both paths — a UIKit host no longer has to drive
StoryDisplayControllerand report impressions itself. As withBannerPresenter,stop()does
not run ondeinit: bracket it with the host's appearance callbacks.