Skip to content

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

Closed

Description

@marqroldan

[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?

Activity

  1. maksymmalyhin commented on Jun 23, 2020

    @maksymmalyhin
    Contributor

    @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.

  2. 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[/+] on Jun 24, 2020
  3. ncooke3 commented on Jul 1, 2020

    @ncooke3
    Member

    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?

  4. marqroldan commented on Jul 2, 2020

    @marqroldan
    ContributorAuthor

    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

  5. added this to the 6.28.0 - M75 milestone on Jul 2, 2020
  6. locked and limited conversation to collaborators on Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions