Set application default payment service
Asked Answered
K

1

8

Let's think about a case where user has installed multiple applications capable of NFC HCE payments. Those application services are visible under settings NFC Tap and Pay.

How to programmatically change your application to be the default payment service if it's not?

CardEmulation seems only to have API to query if service for category is default.

Thanks.

Kropp answered 11/6, 2014 at 13:30 Comment(0)
B
13

The main idea behind having that UI is that the user can decide on which payment app should be the default app. Consequently, there is no way to programmatically set your app to be the default.

However, you can request the user to set your app as default app for the payment category (see ACTION_CHANGE_DEFAULT):

Intent intent = new Intent();
intent.setAction(CardEmulation.ACTION_CHANGE_DEFAULT);
intent.putExtra(CardEmulation.EXTRA_SERVICE_COMPONENT,
                new ComponentName(this, my.package.MyPaymentService.class));
intent.putExtra(CardEmulation.EXTRA_CATEGORY, CardEmulation.CATEGORY_PAYMENT);

startActivity(intent);
Beatnik answered 11/6, 2014 at 15:35 Comment(1)
can we set the translations of locales because currently it shows only default textLyndsaylyndsey

© 2022 - 2024 — McMap. All rights reserved.