Giter VIP home page Giter VIP logo

Comments (6)

dschuermann avatar dschuermann commented on May 26, 2024

I just tested this. You are right, If I choose Paypal and then the Browser, a 404 page is shown. I am using the official links from PayPal's developer documentation, so not sure how to fix this. If anyone has an idea I am open for pull requests!

from donations.

liudongmiao avatar liudongmiao commented on May 26, 2024
        String paypalLink = "";
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(paypalLink));
        intent.addCategory(Intent.CATEGORY_BROWSABLE);
        // get default browser
        Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse("http://"));
        ResolveInfo resolveInfo = getPackageManager().resolveActivity(browser, PackageManager.MATCH_DEFAULT_ONLY);
        if (resolveInfo != null) {
            // set package to browser
            intent.setPackage(resolveInfo.activityInfo.packageName);
        }
        startActivity(intent);

from donations.

dschuermann avatar dschuermann commented on May 26, 2024

I now force the intent chooser in d743327

from donations.

dentex avatar dentex commented on May 26, 2024

from donations.

juanjhb1894 avatar juanjhb1894 commented on May 26, 2024

I used to have a paypal option in my apps, reading the google support information they say that web cannot open a Paypal link a WebBrowser requesting for donations because can be used for tricking user to donate an amount they don't agree with. So, after some days trying I figured a way around.

Easy instead of launching Paypal Fragment to manage Paypal just command your app to open the phone default WebBrowser in your paypal.me link. I'll leave an example below.

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://paypal.me/juanjshb"));
startActivity(browserIntent);

Hope it help. It works for me

from donations.

dentex avatar dentex commented on May 26, 2024

Yes that's exactly how I'm doing:
String url = getActivity().getString(R.string.paypal_me_link);
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

Thanks :)

from donations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.