paypal / android-checkout-sdk

Apache License 2.0
77 stars 38 forks source link

Confusion regarding removal of returnUrl and activity declaration in manifest with our custom return url. #181

Closed hiteshchalise closed 1 year ago

hiteshchalise commented 1 year ago

In the developer.paypal.com site, in 'customize return url' section it is mentioned that, there should be two activity declarations with our custom return URL. Since, the use of return url is removed in newer versions of checkout SDK, does this mean the activity declaration with our custom return url is now obsolete?

I have this error, after upgrading from 0.6.2 to 0.8.7

Class referenced in the manifest, com.paypal.openid.RedirectUriReceiverActivity, was not found in the project or the libraries.

The activity declaration in our manifest:

    <activity
        android:name="com.paypal.openid.RedirectUriReceiverActivity"
        android:excludeFromRecents="true"
        android:exported="true"
        android:theme="@style/PYPLAppTheme">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:host="paypalpay"
                android:scheme="com.customurl.paypal" />
        </intent-filter>
    </activity>

    <activity
        android:name="com.paypal.pyplcheckout.home.view.activities.PYPLInitiateCheckoutActivity"
        android:exported="true"
        android:theme="@style/AppFullScreenTheme">
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:host="paypalxo"
                android:scheme="com.customurl.paypal" />
        </intent-filter>
    </activity>

I couldn't find the info in this particular issue anywhere. It seems removing these declarations has no effect in our sandbox testing, can anyone please confirm this. Thank you.

saperi22 commented 1 year ago

@hiteshchalise You are correct in that we don't require a returnUrl to be passed in in the latest version as of today - 0.8.7. However, we've noticed a few issues with removing the custom return url. So, while I cannot tell you exactly when, the return url is going to be added back.

hiteshchalise commented 1 year ago

Thank you for the response, and as a followup question, what is the intermediate solution until the return of the 'returnUrl'? Should we remove both RedirectUriReceiverActivity and PYPLInitiateCheckoutActivity declaration from our manifest? or should we only remove RedirectUriReceiverActivity?, because that activity is not currently present, but PYPLInitiateCheckoutActivity is. What would be the best path moving forward? Because we must use 0.8.7 due to policy violation.

saperi22 commented 1 year ago

We define the intent-filters in our manifest, so it shouldn't be necessary for you to declare it again. I believe the reason why these were asked to be declared was to handle few edge cases where app developers had non-standard characters in their application ID and that was causing issues. You should be able to remove them without problem.

The intent filters are used to return from web authentication back into the application. If you want to test it for yourself on sandbox, authenticate on web and check if you are being taken back into the native application.