Following the setup for the appsflyer cordova plugin as well as enabling universal links for iOS (following Appsflyer documentation) does not result in actually directing a user to a specific page in our app.
Versions:
cordova 7.1.0
cordova-android 6.4.0
cordova-ios 4.5.3
cordova-plugin-appsflyer-sdk 4.3.0
iOS: 10.3.3
The associated domains is set to applinks:<_onelink_id>.onelink.me
for the Xcode project. Then, we publish a onelink with a deep link into a specific page in our app (with a query param such as af_dp=<custom_scheme>://some/specific/route
)
On Android, the normal deeplinks work. E.g: handleOpenUrl
is called, then we call appsflyer.handleOpenUrl
and then we continue to route into the app to the page requested in the deeplink.
However, on iOS it does open our app when it is installed but handleOpenUrl
is never called. I cannot find any other part mentioning a different handling of universal links in the documentation.
As the app is opened, universal links must be configured correctly. How to proceed from here?
iOS has a separate method of handling Universal Links (in general, and also in AppsFlyers Cordova Plugin):
- (BOOL) application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *_Nullable))restorationHandler
{
[[AppsFlyerTracker sharedTracker] continueUserActivity:userActivity restorationHandler:restorationHandler];
return YES;
}
Here is the relevant code in AppsFlyer's Cordova plugin: https://github.com/AppsFlyerSDK/cordova-plugin-appsflyer-sdk/blob/master/src/ios/AppsFlyerPlugin.m#L420
In AppsFlyer's Cordova plugin, the expected data should be returned in the success callback of initSdk
, provided that onInstallConversionDataListener data is set to true, for example:
var onSuccess = function(result) {
alert(result);
// will return success for init, and also ConversionData and onAppOpenAttribution Data
};
function onError(err) {
// handle error
}
var options = {
devKey: 'd3Ac9qPardVYZxfWmCspwL',
appId: '123456789',
onInstallConversionDataListener: true
};
window.plugins.appsFlyer.initSdk(options, onSuccess, onError);