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?

6
  • 1
    Just checkout the following answer to perform the dynamic links in flutter stackoverflow.com/questions/58481840/… Commented Dec 30, 2019 at 4: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? Commented Dec 30, 2019 at 6:45
  • 1
    No you have to pass the code yourself while generating dynamic link. Commented Dec 30, 2019 at 6: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? Commented Dec 30, 2019 at 6: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. Commented Dec 30, 2019 at 7:27

1 Answer 1

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}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.