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
🔥 DynamicLinks iOS: await dynamicLinks().getInitialLink()
works on debug, but doesn't work on release mode [workaround possible! see comments]
#2660
Comments
I am experiencing the same issue..
I have the same config as @noway and this is a very valid issue. |
Hey @noway.. After a lot of tries, this set up got everything (even first open after install scenario) working for me. Can you check this out and let me know: https://medium.com/@ramakrishnan_89356/firebase-dynamic-links-for-your-react-native-app-ios-setup-only-c6e1f5a7944e |
@ram95krishh through no power that I actually have, I grant you 10 internet points for writing such an excellent detailed guide for future people :-) |
@mikehardy Haha, thanks mate, that means a lot :D |
This does look like an interesting approach, I gonna need to try it out. Atm we just have broken implementation in production and we remedy it by just trigerring stuff we need on first sign up. |
For me the issue wasn't solved with the code in that article. This is because I was using a custom domain and this hasn't been documented properly. The solution for me was the default code from the rn-firebase docs and adding the custom domain to the Info.plist file: <key>FirebaseDynamicLinksCustomDomains</key>
<array>
<string>https://my.custom.domain</string>
</array> |
@RWOverdijk I have this in my project and I still experiencing the issue. This is not just a configuration error, the link works from cold start in iOS13 just fine, the bug seems to be present only on iOS12 for devices without home button. The most promising workaround so far seems to be using |
@noway Pretty sure that's not the case. Have you followed all the other steps? (capability and links in info). Also, you need a release build (disable debug in build settings). Update: Linking will work if you forward the results. But this will give you the short url (if you use those) which doesn't help. |
@RWOverdijk yes I have followed capability and Info.plist steps. It works for me on iOS13 in release mode on App Store, but does not in iOS12. This is clearly not a configuration issue? |
It works for me on iOS 12 so I think it might be. But I did write a lot of native code for other parts, too. Maybe your version of React Native is in need of an update? Or maybe I just did something else to make it work and I don't know what. 😄 |
I'm using 0.60.5 as specified in the Environment section of this issue. |
@RWOverdijk Thanks for pointing that out.. :) |
Hello 👋, to help manage issues we automatically close stale issues.
|
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information. |
@noway you ever get this solved? Im still struggling with getInitialLink not working on iOS. Android works perfect. onLink works perfect on iOS. its just getInitialLink on iOS that wont. I am on RNF 6.3.4 (latest) and RN0.61.4 |
@alittletf we just stopped testing for iOS12 |
@alittletf Did you find any solution to this? Facing the same issue |
I don't know why, but if I manually build main.js and then try to use getInitialLink, it starts working. As a workaround. just an observation. |
I'm still having this issue with devices on both iOS 14 and 13. I specified my custom domain in Info.plist.
|
No - best course is to reach into node_modules and add print logging of all arguments prior to making calls into native Objective-C, then similarly inside the Objective-C add print logging of all arguments prior to making calls to firebase-ios-sdk APIs, followed by print logging of all return values as it goes back up from firebase-ios-sdk API return values to native Objective-C return values in javascript up to what you get. That typically takes about 5 minutes to do (4 minutes to google "how to print to log from objective-c", if you're me, every.time. 1 minute to do it) and should show where expectations are not matching reality |
@mikehardy Sorry, staring at Objective-C for 30 minutes has done nothing but burn my eyes. Is there a debug branch I could use or a list of line numbers I can use to paste the print statement? I thought I could get away with ignoring this issue as React Native's default Linking + the dynamic links parse function works in nearly every other scenario. However, initial install requires Dynamic Links' fancy clipboard scanning which I can only do by using getInitialLink(). Again, it works fine in debug, but not on release. |
// add this up at the top
#include <React/RCTLog.h>
// somewhere else in the file
RCTLog(@"Hello world"); // can log anything that can turn into a string, most of the arguments can be strings?
As an aside, I will say even though it may not be helpful - I just reworked the way my "interruptive navigation on startup" works (like, when the app is opened with a link, or by a notification) so I was testing initial links quite heavily. And on iOS in release mode, getInitialLink is working for me. I literally tested it just now and it worked - it is definitely supposed to be working... |
Have you tried the install-survive clipboard feature? I meant I didn't know where/what to log in Objective C (RNFBDynamicLinksAppDelegateInterceptor.m and RNFBDynamicLinksModule.m) as I could barely understand where functions start and end, let alone which arguments go where/are relevant. |
Ooo! I have not tested the install-the-app-then-the-link-goes-in scenario recently as my dev environment is "release mode" and has a full-fledged firebase back-end but is not on the app stores. It seems like it should be here: react-native-firebase/packages/dynamic-links/ios/RNFBDynamicLinks/RNFBDynamicLinksModule.m Line 119 in f501fff
But this part may get caught up in things as well: Line 49 in f501fff
I'd be tempted to log all over the place, personally. How exactly are you testing these things from the install? Do you manually install your release build locally after being redirected to the app store ... or? I'm in this area with my app (as mentioned) so if you had a set of steps you're using I might be able to follow along and confirm or deny links are surviving install for me or not |
@mikehardy I delete the app, open the dynamic link, click the "open" button in the preview page (since that automatically puts a special link in my clipboard). Then when I'm redirected to the App Store (you can fake this by giving it an AppStore ID for Facebook or something) I click "run" in Xcode (set to "Release" since it weirdly works in dev/debug mode). |
Have you tried it not running from xcode? Xcode automatically attaches a debugger which causes other problems (crashlytics test crashes, so may not apply but it is a difference from a real user experience) |
@EquesMedia Excellent! 😄. I still need to test it but the code injects properly in my AppDelegate. I was actually writing a full app.plugin.js for the dynamic-links package as I checked this thread, and just finished getting the tests + snapshot done. It's basically a copy of the @react-native-firebase/app plugin per #2660 (comment). @mikehardy Do we want this as an official plugin? If so, I can submit my PR. |
@austin43 apologies for the delay, it's Firebase Summit week and I've been working on major new release items. But yes! A plugin PR would be great to have if you made an official plugin that implemented that and posted a PR (maybe also with a change to the non-Expo dynamic-links install docs mentioning the issue and the workaround of import / sharedInstance call?) that should help everyone with this until the underlying swizzle issue is figured out |
await dynamicLinks().getInitialLink()
works on debug, but doesn't work on release modeawait dynamicLinks().getInitialLink()
works on debug, but doesn't work on release mode [workaround possible! see comments]
Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
Thank you for your contributions. |
This is a hot item, and has a workaround at least, but needs investigation |
Hi @EquesMedia |
The plugin only fixes the bug that causes the dynamic link to not be detected when installing an iOS app via the app store. If we talk "implementation", to be honest, I've noticed disparities between the data received on Android and iOS depending on where the data is coming from and when, but using the functions of the + react native Linking package, you should be able to capture all the possibilities. What's next is stuff that I've seen, but haven't had time to understand what or why is was happening due to... being rushed at my work. Here are the things I had to handle:
Hopefully it can help you a bit! |
Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
Thank you for your contributions. |
Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
Thank you for your contributions. |
Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
Thank you for your contributions. |
EDIT: we think there is a workaround possible - #4548 (comment)
Issue
await dynamicLinks().getInitialLink()
works in debug mode, but doesn't work in release mode on iOS, on certain iPhones. Please not that the app does not crash, but rathernull
is returned byawait dynamicLinks().getInitialLink()
when it should be returning the dynamic link url.onLink
seems to be working fine, haven't noticed any issues with that. It is confirmed not to work on iPhone Xs with iOS 12.4.0 (device) and iPhone Xs with iOS 12.2.0 (Simulator). I use preview page in my links. Tested both from Safari via preview page and from Messages/Notes app, but NOT through App Store. See testing matrix:iPhone Xs with iOS 12.4.0 (device), debug: not tested
iPhone Xs with iOS 12.4.0 (device), release: ❌ broken
iPhone Xs with iOS 12.2.0 (Simulator), debug: ✅ works
iPhone Xs with iOS 12.2.0 (Simulator), release: ❌ broken
iPhone Xs with iOS 13.0.0 (Simulator), debug: ✅ works
iPhone Xs with iOS 13.0.0 (Simulator), release: ✅ works
iPhone 7 Plus with iOS 12.4.1 (device), debug: ✅ works
iPhone 7 Plus with iOS 12.4.1 (device), release: ✅ works
This issue is critical because it affects a significant amount of the iOS user base, I think it might be affecting any iPhone X and higher users who haven't updated to iOS 13 yet (i.e. everyone but the early adopters) which is a very substantial percentage of all iOS users.
The issue might be releated to #1901, and if so the issue has failed at least 2 Firebase customers, who since have chosen to switch to branch.io instead. See #1901 (comment) and #1901 (comment)
Android is working flawlessly as far as I've tested, with getInitialLink, onLink, install through Play Store all working perfectly. Only issue is iOS.
Code I'm using:
Project Files
iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Android
Click To Expand
android/build.gradle
:android/app/build.gradle
:android/settings.gradle
:MainApplication.java
:AndroidManifest.xml
:Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:Firebase
module(s) you're using that has the issue:DynamicLinks
TypeScript
?N
Think
react-native-firebase
is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: