invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.71k stars 2.22k forks source link

Dynamic Links - Can't add fallback url for other platforms #5184

Closed Sheleya closed 3 years ago

Sheleya commented 3 years ago

https://firebase.google.com/docs/dynamic-links/create-manually supports adding ofl parameter which supports fallback url for other platforms i.e. opening dynamic link via computer.

I need next scenario:

I have implemented this Manually constructing url, but I need this with buildShortLink() method

RN - 0.63.3 Version - 10.1.1

mikehardy commented 3 years ago

We do not provide support when people skip the template (or in general for out of date versions), and for this one I would definitely need to see the code you use to generate the link.

I'm curious why this is not working? https://rnfirebase.io/reference/dynamic-links/dynamiclinkiosparameters#fallbackUrl - perhaps it is not url encoded correctly - it works in my app

Without a minimal reproducible example App.js, I can't say.

Sheleya commented 3 years ago

We do not provide support when people skip the template (or in general for out of date versions), and for this one I would definitely need to see the code you use to generate the link.

I'm curious why this is not working? https://rnfirebase.io/reference/dynamic-links/dynamiclinkiosparameters#fallbackUrl - perhaps it is not url encoded correctly - it works in my app

Without a minimal reproducible example App.js, I can't say.

const link = await dynamicLinks().buildShortLink(
      {
        link: ,
        domainUriPrefix: ,
        ios: {
          fallbackUrl: ,
          bundleId: ,
        },
        android: {
          fallbackUrl: ,
          packageName: ,
          minimumVersion: '18',
        },
      },
      dynamicLinks.ShortLinkType.DEFAULT,
    );

In the Firebase console I have created free Google-provided domain. When I'm creating dynamicLink manually everything works as expected. I'm implementing dynamicLink in this way, every object field is filled. And when I try to open this link using phone it works, as expected, but when I try to open using computer I got:

Screenshot 2021-04-16 at 18 25 51
mikehardy commented 3 years ago

In the code you pasted the object parameters appear empty, not sure what happened there but if that's how the code actually is, that's the problem

Additionally have you tried pasting the link in for debugging https://firebase.google.com/docs/dynamic-links/debug

Sheleya commented 3 years ago

In the code you pasted the object parameters appear empty, not sure what happened there but if that's how the code actually is, that's the problem

Additionally have you tried pasting the link in for debugging https://firebase.google.com/docs/dynamic-links/debug

No, I mentioned that

every object field is filled

So, I pass everything correctly to the object I erased field values due to NDA

mikehardy commented 3 years ago

What you have done is nothing like a minimal reproducible example, sorry

https://stackoverflow.com/help/minimal-reproducible-example

Post an App.js that is complete and runs and demonstrates the problem or this will not move forward, sorry.

If you have problems with proprietary information you may put literally any values in there that work and demonstrate the failure. Note you may create a sample firebase project for free on their free plans at any time if that is a constraint

stale[bot] commented 3 years ago

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 the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

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.

skam22 commented 2 years ago

@Sheleya PR submitted that fixes your issue, the parameter will have to be provided using this format:

buildShortLink({
  // … other params,
  otherPlatform: {
    fallbackUrl: ‘https://urlToOpenOnDesktop.com/‘
  }
})
adamsythe commented 1 year ago

@skam22 I am on version ^17.4.3 and fallback doesn't work on otherplatforms. Any idea if this is still stable?

My code looks like this (everything else is working)

link = await dynamicLinks().buildShortLink({ link: MyLink, // domainUriPrefix is created in your Firebase console domainUriPrefix: domainUriPrefix, ios: { bundleId: bundleId, appStoreId: appStoreId, }, android: { packageName: packageName, }, social: { descriptionText: 'text', title: shop?.title, imageUrl: shop?.new_feature_image.small, }, otherPlatform: { fallbackUrl: 'www.google.com' } });

skam22 commented 1 year ago

Try putting the full url including https:// in there.

If that doesn’t work view dynamic link debug in browser to see what was actually generated as the fallback.

adamsythe commented 1 year ago

Thanks for getting back to me apologies for not noticing, we tried everything on this but in the end it was easier to just generate these server side and pass them into the app.

itx-wick commented 1 year ago

Am using firebase-dynamic-links which works exactly same as firebase.dynamicLinks but it is not providing me the otherPlatform fallback property.