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

159827739: Dynamic Links - App crashes when a dynamic link is pressed for the second time while the app is on foreground #5880

Closed
marqroldan opened this issue Jun 23, 2020 · 3 comments · Fixed by #5941

Comments

@marqroldan
Copy link
Contributor

marqroldan commented Jun 23, 2020

[REQUIRED] Step 1: Describe your environment

  • Xcode version: Xcode 11
  • Firebase SDK version: 6.13.0 ~ 6.25.0
  • Firebase Component: Dynamic Links
  • Component version: _____
  • Installation method: CocoaPods (select one)

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?

  • Simply press another or the same dynamic link for the second time when the app has been opened by a dynamic link (or a dynamic link has already been pressed beforehand); this would crash the app and the following is logged in Crashlytics
FIRDynamicLinks.m line 458
__50-[FIRDynamicLinks handleUniversalLink:completion:]_block_invoke_2

https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseDynamicLinks/Sources/FIRDynamicLinkNetworking.m#L68

Relevant Code:

This issue has been raised here: invertase/react-native-firebase#2807
With a solution by @rszalski at invertase/react-native-firebase#2807 (comment)

Replacing
NSURLSession *session = [NSURLSession sharedSession];
with

NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:sessionConfig];

Fixes the issue, but is there any side effect to it?

@maksymmalyhin
Copy link
Contributor

maksymmalyhin commented Jun 23, 2020

@marqroldan Thank you for reporting the issue with a suggested fix! The proposed solution looks relevant and safe. Would you like to create a PR to apply the fix? Your contribution is highly appreciated.

@firebase firebase deleted a comment from google-oss-bot Jun 23, 2020
@rohandandavati rohandandavati changed the title Dynamic Links - App crashes when a dynamic link is pressed for the second time while the app is on foreground 159827739: Dynamic Links - App crashes when a dynamic link is pressed for the second time while the app is on foreground Jun 24, 2020
@ncooke3
Copy link
Member

ncooke3 commented Jul 1, 2020

Hi @marqroldan, thanks for the contribution! 🙂 While trying to recreate the issue, I couldn't quite get the app to crash. I'm using the iOS12 simulator. So I have a dynamic links enabled app and also a dynamic link that links me to this app. With the app running, I switch to the Notes app where I have the dynamic link pasted. It brings me to the app. ✓ Then, without closing the app, I switch back to the Notes app and tap the same dynamic link again. This brings me back to the app, with no crashes. Do these sound like the same steps to reproduce?

@marqroldan
Copy link
Contributor Author

Hi @ncooke3, I also tried it with the iOS 12.4 simulator and could not reproduce it there. But when done on a physical device, it does happen. I'd like to know how to help you more, as I'm not really knowledgable in native development

@paulb777 paulb777 added this to the 6.28.0 - M75 milestone Jul 2, 2020
@firebase firebase locked and limited conversation to collaborators Aug 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants