"a task was canceled" using result = await CrossPayPalManager.Current.Buy ...

When requesting a payment to be made through PayPal with PayPal.Forms with the line

result = await CrossPayPalManager.Current.Buy(items, deliveryFee, tax);

The line does not await and exits the method. After try-catching it seems it is throwing an error "the task was canceled" so we never get the result of the payment, but the PayPal plugin goes through the process of letting the user sign-in and submitting their payment.

This appears to be an Android-only issue, has anybody else had this issue and what is the solution?




  • mwagdymwagdy EGMember
    edited February 19

    Just Use This in MainActitvity.cs

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
            base.OnActivityResult(requestCode, resultCode, data);
            PayPalManagerImplementation.Manager.OnActivityResult(requestCode, resultCode, data);
        protected override void OnDestroy()
Sign In or Register to comment.