3

So, I am currently using Flutter to develop an IOS-App and added Firebase. I am trying to use PayPal-Connect with the url_launcher package. As the PayPal-Connect link looks like this:

https://www.sandbox.paypal.com/connect?flowEntry=static&client_id=[<my_client_Id>]&scope=&redirect_uri=[<my_url>]

I am trying to use Firebase Dynamic Links for the redirect_uri to go back to the app and fetch the data I got from Pay-Pal as url parameters. The problem is that whenever I run this code:

Future<void> retrieveDynamicLink() async {
      final PendingDynamicLinkData data = await FirebaseDynamicLinks.instance.getInitialLink();
        final Uri deepLink = data?.link;

        if (deepLink != null) {
          print(deepLink);
          print(deepLink.queryParameters['code']);
        }
    }

The logs say:

flutter: https://domain.page.link/ppc
flutter: null

But I know from the Paypal-Connect Docs that they add a code=[<some_code>] parameter. But is the thing I plan to do even possible with Dynamic Links? Or Am I doing something completely wrong?

laaasBIGL
  • 811
  • 1
  • 7
  • 17
  • 1
    Just checkout the following answer to perform the dynamic links in flutter https://stackoverflow.com/questions/58481840/flutter-how-to-pass-custom-arguments-in-firebase-dynamic-links-for-app-invite – Jay Mungara Dec 30 '19 at 04:40
  • Yeah, I saw this one too. The problem is that I don't add the parameters but PayPal does it when it redirects to the dynamic link I passed in the url. So, I don't pass anything because I need PayPal to add a code so I can proceed the onboarding. As far as I understand in the answers you send, they want to pass arguments right away, aren't they? – laaasBIGL Dec 30 '19 at 06:45
  • 1
    No you have to pass the code yourself while generating dynamic link. – Jay Mungara Dec 30 '19 at 06:47
  • So I pass a random code or any empty one and when PayPal redirects it updates to the one from PayPal that I need? – laaasBIGL Dec 30 '19 at 06:51
  • Okay, I tried it out and it didn't work. Also the link has to be fixed because I have to add a specific URL to PayPal. – laaasBIGL Dec 30 '19 at 07:27
  • You have to pass the paypal code on yourself. they will not do anything for you. Nobody can manage the things for you. How would anybody know that what is your custom requirements? – Jay Mungara Dec 30 '19 at 07:29

1 Answers1

0

Checking the implementation, it looks like you're trying to implement something similar to a reward referral use case. The reason why deepLink.queryParameters['code'] returns null is because there's no code parameter configured on the deep link of the Firebase Dynamic Link that has been handled.

To configure a query parameter for code, the deep link of your Dynamic Link should look something similar to https://example.com/?code={CODE}

Omatt
  • 8,564
  • 2
  • 42
  • 144