braintree / braintree_android

Braintree SDK for Android
https://developer.paypal.com/braintree/docs/start/hello-client/android/v4
MIT License
409 stars 234 forks source link

Can't get clientMetadataId on braintree drop-in 6.4.0 #635

Closed skauss closed 1 year ago

skauss commented 1 year ago

Integration Details (please complete the following information):

Hi I need to Mirgrate from drop-in version 5.2.1 to version 6.4.0 and miss the way to get the clientMetadataId On drop-in SDK version 5.2.1 I get the clientMetadataId this way

String clientMetadataId = DataCollector.getPayPalClientMetadataId(activity.getApplicationContext());

The clientMetdataId is used inside our WebView which make special Braintree payment with payment by installments with a Browser switch.

I can't use BraintreeClient for the PayPalClient because the app has no authorization or clientTokenProvider

To create an BraintreeClient with returnUrlScheme only this constructors are available

public BraintreeClient(@NonNull Context context, @NonNull String authorization, @NonNull String returnUrlScheme) 
public BraintreeClient(@NonNull Context context, @NonNull ClientTokenProvider clientTokenProvider, @NonNull String returnUrlScheme)

for this reason I create the BrowserSwitch this way

             BrowserSwitchOptions browserSwitchOptions = new BrowserSwitchOptions();
             browserSwitchOptions.returnUrlScheme(urlScheme);
             browserSwitchOptions.url( Uri.parse(urlToLoad)); 

             BrowserSwitchClient browserSwitchClient = new BrowserSwitchClient();
             browserSwitchClient.start(activity,browserSwitchOptions);

Is there an example how I get the clientMetadataId and do an BrowserSwitch without authorization or clientTokenProvider ?

sshropshire commented 1 year ago

@skauss we should be able to add a clientMetadataId property to DropInResult. Would that help?

skauss commented 1 year ago

No. Also the DropInClient need one of authorization stuff like

Or do you have an example using the DropInClient without authorization and start a ChromeTab (Browser switch)

sshropshire commented 1 year ago

Hi @skauss like I mentioned, let's take this over to the DropIn library so we can improve tracking on our end.

skauss commented 1 year ago

Hi @sshropshire done. See https://github.com/braintree/braintree-android-drop-in/issues/385