@@ -111,6 +111,12 @@ final class TracebackSDKImpl {
111111 }
112112
113113 func getCampaignLink( from url: URL ) async -> TracebackSDK . Result {
114+
115+ guard isTracebackURL ( url) else {
116+ logger. info ( " The provided url is not a traceback url, ignoring " )
117+ return . empty
118+ }
119+
114120 do {
115121 logger. info ( " Get campaign link " )
116122
@@ -126,13 +132,22 @@ final class TracebackSDKImpl {
126132
127133 // 3. If no campaign, process locally
128134 guard let campaign else {
129- logger. info ( " The link does not have a campaign, treat locally as intent " )
130- let deeplink = try ? extractLink ( from: url)
135+ logger. info ( " The link does not have a campaign, treat locally " )
136+
137+ guard let deeplink = extractLink ( from: url) else {
138+ logger. info ( " No deeplink found in the url, returning empty result " )
139+ return . empty
140+ }
141+
142+ logger. info ( " Deeplink found in the url, returning intent result " )
143+ logger. debug ( " Deeplink extracted from url: \( deeplink. absoluteString) " )
131144
132145 return TracebackSDK . Result (
133146 url: deeplink,
134147 matchType: . intent,
135- analytics: [ ]
148+ analytics: [
149+ . campaignResolvedLocally( deeplink)
150+ ]
136151 )
137152 }
138153
@@ -183,9 +198,9 @@ final class TracebackSDKImpl {
183198 /// defining the content is not allways plain visible in the url which opened the app, since we need to build
184199 /// a url that is valid for all platforms, and for installation path. This method extracts the real url to be
185200 /// opened.
186- private func extractLink( from url: URL ) throws -> URL ? {
201+ private func extractLink( from url: URL ) -> URL ? {
187202 guard let components = URLComponents ( url: url, resolvingAgainstBaseURL: false ) else {
188- throw TracebackError . ExtractLink . invalidURL
203+ return nil
189204 }
190205
191206 for queryItem in components. queryItems ?? [ ] {
0 commit comments