Skip to main content

ADVANCED

iOS Universal Links

When using External Browser flows, returning from Pay Station to your app via a custom URL scheme can trigger an iOS confirmation dialog (for example, β€œOpen this page in App Name?”). Using Universal Links (HTTPS) avoids this prompt and provides a smoother redirect back to the game.

The SDK supports Universal Links for redirecting back to your app.

Requirements​

To use Universal Links, you must configure your iOS project and your domain:

SDK handling (automatic vs manual)​

If the SDK's automatic URL handling (swizzling) is enabled, Universal Links are handled automatically.

If you disabled automatic URL handling, you must forward the Universal Link to the SDK so it can process the callback (same idea as manual deep link handling, but the URL comes from NSUserActivity.webpageURL).

AppDelegate​

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions {

// Cold start (optional): app was launched by a Universal Link
NSDictionary *userActivityDict = launchOptions[UIApplicationLaunchOptionsUserActivityDictionaryKey];
NSUserActivity *activity = userActivityDict[UIApplicationLaunchOptionsUserActivityKey];
NSURL *url = activity.webpageURL;
if (url) {
[[SKPaymentQueue defaultQueue] openWithUrl:url];
}

return YES;
}

// Warm start: app receives a Universal Link while running/suspended
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {

NSURL *url = userActivity.webpageURL;
if (!url) { return NO; }

// Forward to SDK
BOOL handledBySDK = [[SKPaymentQueue defaultQueue] openWithUrl:url];
return handledBySDK;
}

SceneDelegate​

// Cold start: app was launched by a Universal Link
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {

for (NSUserActivity *activity in connectionOptions.userActivities) {
NSURL *url = activity.webpageURL;
if (!url) { continue; }

// Forward to SDK
[[SKPaymentQueue defaultQueue] openWithUrl:url];
break;
}
}

// Warm start: app receives a Universal Link while running/suspended
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
NSURL *url = userActivity.webpageURL;
if (!url) { return; }

// Forward to SDK
[[SKPaymentQueue defaultQueue] openWithUrl:url];
}