Skip to content
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

fetchDeferredAppLink doesn't work on IOS 15,14 #104

Closed
tranducduong1994 opened this issue Sep 29, 2021 · 5 comments
Closed

fetchDeferredAppLink doesn't work on IOS 15,14 #104

tranducduong1994 opened this issue Sep 29, 2021 · 5 comments

Comments

@tranducduong1994
Copy link

tranducduong1994 commented Sep 29, 2021

🐛 Bug Report

This is my code:

const getDeferredAppLinkData = async () => {
      try {
       const resultTrackingStatus = await requestTrackingPermission();
        if (
          resultTrackingStatus === 'authorized' 
        ) {
          return;
        }
        await Settings.initializeSDK();
        await Settings.setAdvertiserTrackingEnabled(true);
        let deferredAppLinkData = await AppLink.fetchDeferredAppLink();
        console.log('From fb', deferredAppLinkData); // =====> ALWAYS undefined
        if (deferredAppLinkData) AsyncStorage.setItem('deferredAppLinkData', deferredAppLinkData);
      } catch (error) {}
    };
    getDeferredAppLinkData();

AppLink.fetchDeferredAppLink(); always return undefined in IOS platform. it worked in android platform as well.

To Reproduce

I used https://developers.facebook.com/tools/app-ads-helper/ to send a test deep-link to my app after installing the app.

Expected Behavior

AppLink.fetchDeferredAppLink must return deep-link from https://developers.facebook.com/tools/app-ads-helper/ after installing the app.

Environment

IOS: 14 or 15

@mikehardy
Copy link
Collaborator

Hi there! Just to set expectations, I don't see a lot of people helping to troubleshoot issues in this repo, so you should have the expectation you need to dig deep on this one and do the work to diagnose it.

The native code starts here

[FBSDKAppLinkUtility fetchDeferredAppLink:^(NSURL *url, NSError *error) {

This is not a use case I personally use so I won't have time to help, I'm not sure if there are special things to be careful with regard to installation to use deferred app links or anything but I'd check that, then open the app via Xcode and set a breakpoint or add logging statements and watch them, hopefully that let's you see the problem.

I'm happy to help merge + release any reasonable PR you come up with that fixes the issue if you can discover the root cause

@tranducduong1994
Copy link
Author

@mikehardy .
Finally, I found out the root cause of the issue. User must allow my app and facebook app to track user's activity ( user can setup in Privacy > Tracking in IOS 14+ ). That why it worked on android as well, cuz Android don't require this permission

@mikehardy
Copy link
Collaborator

Oh that's really interesting! Thanks for posting back. The App Tracking Transparency stuff is all new and pretty subtle.

I added that to the troubleshooting section 2614385

@sarafcredable
Copy link

sarafcredable commented Apr 25, 2022

Please check this #234

@b8ne
Copy link

b8ne commented Jan 6, 2023

@mikehardy @tranducduong1994 I'm just implementing this at the moment so only going through these issues now. I completely understand that you can only work on areas that you have time for, but hoping to get some further background info that may help. I've installed the base sdk without any ATT permissions and I am still getting the automatic events show up. In the FB event manager the Overview tab appears to show all events, even in testing, I just have to wait a few hours for them to show. Test events are only working once the app is in testflight. In Test events i can see the fb_mobile_request_deferred_deep_link but none of the deep link validation tools work, and the link is showing as undefined.
Everything I've read about ATT permission is when sharing user IDs across companies, I am not, and also have FIrebase and RevenueCat setup fine already without ATT, so I'm not sure why ATT is needed for FB? From your experience, is it just the FB validation and testing features that require it? Do you think your app and sdk implementation would work fine in production without it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants