Skip to content

Commit cfce7ff

Browse files
committed
copilot review fixes
1 parent b51eb5d commit cfce7ff

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Sources/ShortIOSDK/ShortIOSDK.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public class ShortIOSDK {
155155
}
156156

157157
@available(iOS 13.0.0, *)
158-
public func handleOpen(_ url: URL,completion: @escaping (_ components: URLComponents?,_ redirectedURL: String?, _ error: String?) -> Void) async {
158+
public func handleOpen(_ url: URL, completion: @escaping (_ components: URLComponents?, _ redirectedURL: String?, _ error: String?) -> Void) async {
159159
guard var components = URLComponents(url: url, resolvingAgainstBaseURL: true),
160160
let scheme = components.scheme,
161161
["http", "https"].contains(scheme) else {
@@ -197,9 +197,6 @@ public class ShortIOSDK {
197197
let components = URLComponents(url: redirectedURL, resolvingAgainstBaseURL: false),
198198
let clid = components.queryItems?.first(where: { $0.name == "clid" })?.value {
199199

200-
print("clid =", clid)
201-
print("Redirected URL: \(redirectedURLString)")
202-
203200
ConversionTrackingMethods.trackConversion(
204201
originalURL: originalURLString,
205202
clid: clid
@@ -245,7 +242,7 @@ extension ShortIOError: LocalizedError {
245242
}
246243
}
247244

248-
public enum ConversionTrackingMethods {
245+
struct ConversionTrackingMethods {
249246
@available(iOS 13.0.0, *)
250247
static func fetchHeaderValue(from urlString: String) async throws -> String? {
251248
guard let url = URL(string: urlString) else {
@@ -284,7 +281,7 @@ public enum ConversionTrackingMethods {
284281

285282
@available(iOS 13.0.0, *)
286283
static func trackConversion(originalURL: String, clid: String?) {
287-
Task.detached {
284+
Task {
288285
let originalURLString =
289286
originalURL.hasSuffix("/") ? String(originalURL.dropLast()) : originalURL
290287
guard let baseURL = URL(string: originalURLString),
@@ -311,8 +308,6 @@ public enum ConversionTrackingMethods {
311308
return
312309
}
313310

314-
print("Sending conversion request to: \(url)")
315-
316311
var request = URLRequest(url: url)
317312
request.httpMethod = "GET"
318313

0 commit comments

Comments
 (0)