-
Notifications
You must be signed in to change notification settings - Fork 136
iOS Deferred Deep Link: Missing media_source and campaign (works on Android) #397
Description
Hi AppsFlyer team,
I'm currently testing deferred deep linking on iOS using the AppsFlyer SDK, and I've noticed that the media_source and campaign parameters are missing from the response.
This issue does not occur on Android.
Steps to Reproduce:
Generate a short link (one link) with media_source and campaign parameters on appsflyer dashboard.
Click the short link on an iOS device.
Install the app either from Xcode (IDE) or via TestFlight.
Launch the app and wait for the AppsFlyer deferred deep link callback.
Expected Result:
The deep link data should include the media_source and campaign parameters.
Actual Result:
These parameters are missing from the deep link response on iOS.
onDeepLinking method result:
DeepLink: {"af_sub4":"","click_http_referrer":"","af_sub1":"","af_sub3":"","deep_link_value":"TEST","campaign":"","match_type":"probabilistic","af_sub5":"","campaign_id":"","media_source":"","af_sub2":"","is_deferred":true}
onInstallConversionData result:
{status: success, payload: {is_first_launch: true, install_time: 2025-07-02 13:31:31.066, af_message: organic install, af_status: Organic}}
On Android, the same process correctly returns both media_source and campaign.
Notes:
I’ve tried installing from both Xcode and TestFlight after clicking the short link, but the issue persists.
On Android, clicking the same link and installing the app returns all expected data.
Environment:
Platform: iOS
AppsFlyer SDK version: 6.16.21
iOS version: 18.5
Tested on: Iphone 13 pro max
Code Snippet:
AppsFlyerOptions appsFlyerOptions = AppsFlyerOptions(
afDevKey: Env.appsflyerDevKey,
appId: Platform.isAndroid ? _androidAppId : _iosAppId,
showDebug: isDebug,
timeToWaitForATTUserAuthorization: 15,
disableAdvertisingIdentifier: false,
disableCollectASA: false,
manualStart: true,
);
_store = store;
_appsFlyerSdk = AppsflyerSdk(appsFlyerOptions);
_setupListeners();
await _appsFlyerSdk.initSdk(
registerConversionDataCallback: true,
registerOnAppOpenAttributionCallback: true,
registerOnDeepLinkingCallback: true,
);
if (Platform.isAndroid) {
_appsFlyerSdk.performOnDeepLinking();
}
_appsFlyerSdk.startSDK(
onSuccess: () {
_isInitialized = true;
Log.i("AppsFlyer SDK initialized successfully.", tag: TAG);
},
onError: (int errorCode, String errorMessage) {
_isInitialized = false;
Log.i("Error initializing AppsFlyer SDK: Code $errorCode - $errorMessage", tag: TAG);
},
);
void _setupListeners() {
_appsFlyerSdk.onAppOpenAttribution((res) {
Log.i("onAppOpenAttribution: $res", tag: TAG);
});
_appsFlyerSdk.onInstallConversionData((res) async {
Log.i("onInstallConversionData: $res", tag: TAG);
saveAttributes(res['payload']);
});
_appsFlyerSdk.onDeepLinking((DeepLinkResult dp) {
switch (dp.status) {
case Status.FOUND:
Map<String, dynamic>? deepLink = dp.deepLink?.clickEvent;
if (deepLink != null && deepLink.isNotEmpty) {
_handleDeepLink(deepLink);
}
Log.i("Deep link found: ${dp.deepLink?.toString()}", tag: TAG);
break;
case Status.NOT_FOUND:
Log.i("Deep link not found", tag: TAG);
break;
case Status.ERROR:
Log.e("Deep link error: ${dp.error}", TAG);
break;
case Status.PARSE_ERROR:
Log.e("Deep link parse error", TAG);
break;
}
});
}