-
Notifications
You must be signed in to change notification settings - Fork 3
Feat(GiniMerchantSDK): Migrate to universal links #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Nice job 👍 We only need the deployment of AASA file |
AASA file should be named apple-app-site-association (without extension) and deployed to path ".well-known" content of file
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the example app’s deep link handling from a custom URL scheme to Universal Links.
- Adds a
continue userActivity
handler to process incoming universal link URLs. - Introduces an entitlements file with the associated domain for universal links.
- Updates the Xcode project to reference the new entitlements file.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
AppDelegate.swift | Implements application(_:continue:restorationHandler:) to handle universal links alongside the existing URL scheme handler. |
GiniMerchantSDKExample.entitlements | Defines the applinks:beaver-d97a1.web.app associated domain. |
project.pbxproj | Configures CODE_SIGN_ENTITLEMENTS to include the new entitlements file. |
Comments suppressed due to low confidence (1)
MerchantSDK/GiniMerchantSDKExample/GiniMerchantSDKExample/Sources/AppDelegate.swift:35
- The new universal link handling logic isn’t currently covered by tests. Add unit tests or UI tests to verify both successful and failed URL parses and ensure the correct coordinator methods are invoked.
func application(_ application: UIApplication,
params.first(where: { $0.name == "paymentRequestId" }) != nil else { | ||
print("❌ unsupported URL") | ||
return false | ||
} | ||
|
||
// Process URL | ||
coordinator.processBankUrl() |
Copilot
AI
Jun 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code checks that paymentRequestId
exists but never retrieves its value or passes it to the coordinator. Extract the paymentRequestId
from params
and pass it into coordinator.processBankUrl(paymentRequestId:)
(or a similar API) so the correct request is handled.
params.first(where: { $0.name == "paymentRequestId" }) != nil else { | |
print("❌ unsupported URL") | |
return false | |
} | |
// Process URL | |
coordinator.processBankUrl() | |
let paymentRequestId = params.first(where: { $0.name == "paymentRequestId" })?.value else { | |
print("❌ unsupported URL") | |
return false | |
} | |
// Process URL | |
coordinator.processBankUrl(paymentRequestId: paymentRequestId) |
Copilot uses AI. Check for mistakes.
guard components.host == "beaver-d97a1.web.app", | ||
path == "/payment-requester", |
Copilot
AI
Jun 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Hardcoding the host and path makes maintenance harder if the domain or path changes. Consider extracting these values into named constants or a configuration object.
guard components.host == "beaver-d97a1.web.app", | |
path == "/payment-requester", | |
guard components.host == AppDelegate.HOST, | |
path == AppDelegate.PAYMENT_REQUESTER_PATH, |
Copilot uses AI. Check for mistakes.
let components = NSURLComponents(url: incomingURL, resolvingAgainstBaseURL: true), | ||
let path = components.path, | ||
let params = components.queryItems else { | ||
print("❌ can't parse URL") |
Copilot
AI
Jun 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using print
for error logging can be unreliable in production. Consider using a structured logging framework like os_log
or a custom logger to capture and categorize these events.
print("❌ can't parse URL") | |
os_log("❌ can't parse URL", log: OSLog.default, type: .error) |
Copilot uses AI. Check for mistakes.
EC-89 migrate from URL Scheme to Universal Links
Highlights: