AppsFlyerSDK / AppsFlyerFramework

AppsFlyer Apple SDK
https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS
Other
163 stars 90 forks source link

Randomly Getting not Shortened URL from OneLink #208

Closed ferhatabd closed 1 year ago

ferhatabd commented 2 years ago

Report

Hello, Within our app we generate custom links for each user with which they refer the app to other people and upon each install we log these attributions.

While everything works as expected, we are receiving some reports that for some users the link appears to be not shortened. The link displays all the parameters that are embedded into it by the app. So it doesn't look like a corrupted link but really just a long version URL.

Is there a possible cause known to you which can cause this behavior? Thanks in advance!

SDK Version

6.6.1

What did you do?

Here is how the link is generated:

image

What did you expect to happen?

Getting the shortened URL in completion handler

What happened instead?

Although in our tests we receive the shortened URL we got reports from some of our users that the long version of the URL appears instead of the shortened one. We haven't yet been able to reproduce this on our end but we have screenshots that display the long url.

cameronehrlich commented 1 year ago

@ferhatabd We are seeing the same issue.

ferhatabd commented 1 year ago

@cameronehrlich Hey! We were able to reproduce this by generating the link 40-50 consecutive times. It looks like this happens on the server because the long URL is returned from the server. When we were able to reproduce it we've implemented a workaround. Basically it's very very rare to have two long URL's consecutively - so we basically try to generate the link once again when we detect a long URL. Then in case the app is opened via a long URL - the deeplink would still work and open the app. But the didResolveDeepLink(_:) method from the DeepLinkDelegate will have a result status failure. When we see that we try to parse the URL query items manually as they appear in the long URL and if everything seems OK we treat it as we do for the shortened URLs. Not the best approach but we stopped getting the long URL reports.

cameronehrlich commented 1 year ago

Thanks for the info @ferhatabd. I think our issue might be different, because we are always getting the long URL every time and I can't figure out why.

amit-kremer93 commented 1 year ago

The SDK uses a long URL as a fallback when it fails to get a short link from the server. This can occur when there are internet connection issues.