Closed mrsasha closed 1 year ago
I was just reading that last night from the round of emails Google sent out yesterday 😄.
There is only 1 issue in two places that prevents Drop-in (specifically the code in this repo) from working well in instant apps. Drop-in is started as an Activity
via Activity#startActivityForResult
and if a user chooses to use a card it starts one more Activity
via Activity#startActivityForResult
. This is pretty minor and could be solved with either of the two following options:
Fragment
based UI and refactor the existing Activity
s to use these Fragment
s for backwards compatibility. This would allow a developer to start a Drop-in Fragment
and never worry about calling Activity#onActivityResult
. Although this would require some minor updates for developers wishing to use Drop-in in instant apps, this is ultimately the most maintainable approach.Activity#startActivityForResult
as it currently does. Due to the complexity in the code, setup and documentation this is the less preferable approach.Drop-in is built on top of the Braintree Android SDK and uses it for all of it's communication with Braintree. The Braintree Android SDK also runs into some of the instant app limitations including not using Activity#startActivityForResult
and:
Discover or interact directly with the list of installed apps on the device (e.g. via explicit intents).
The following are limitations any use of the Braintree Android SDK would run into in instant apps when using certain payment methods:
Activity#startActivityForResult
.Activity#onActivityResult
. As it stands today, only cards (including UnionPay) and PayPal via browser switch would be supported in instant apps by the Braintree Android SDK. With one of the above changes to Drop-in, it could also support these payment methods. Additional changes would be required by other parties to support Android Pay, Venmo and PayPal app switches in instant apps.
Please let us know what you think of these options and limitations!
Note: As of January 9th, 2017 30.3% of devices are on API 23 or above and would support app links + instant apps.
Hi Luke,
sorry for my late reply but I was in the process of obtaining some further info from the Google guys. So, when it comes to the approach, the first one is preferable, I would say - removing the Activity/onActivityResult wouldn't be complicated neither from the library nor the app standpoint.
When it comes to limitations, I have some more info, but cannot talk about specifics at the moment:
As for our app users, we currently have around 57% on Android 6 and further 7% on Android 7, which means that probably more than 50% of our target group would be able to use Instant Apps.
Thanks for the follow up @mrsasha. We'll hopefully be getting some more information and the chance to test instant apps before they become generally available. I'll leave this issue open and include any additional information that becomes available as well as include it on any relevant commits in the future.
Thanks!
Hi, just saw that this is still open - Google is using their own Google Payments API for AIA payments, so I think we can close this issue now.
This should remain open, there is still work that needs to be done on Drop-in for instant apps. Apps can still use saved payment methods outside of the Google Payments API and Drop-in can also add support the Google Payments API.
👋 Closing this issue due to lack of community engagement and since there is no current plan to include it on our product roadmap.
Feel free to re-open on this issue or reach out to Braintree Developer Support if this is something your app still needs!
Hi,
do you have any info on if/when you'll be providing Instant Apps compatibility? Looking at the available info (https://developer.android.com/topic/instant-apps/prepare.html), there's item 2 i.e.
Also, an activity cannot launch another activity directly within an instant app; rather, it must request the URL address that corresponds to that activity.
Effectively there's no activity opening and no
onActivityResult
but everything would need to be communicated via app links (https://developer.android.com/training/app-links/index.html).Thanks!