@rnw-community/react-native-payments
Version:
Accept Payments with Apple Pay and Android Pay using the Payment Request API.
26 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withGooglePay = void 0;
const config_plugins_1 = require("@expo/config-plugins");
const withGooglePay = initialConfig => (0, config_plugins_1.withAndroidManifest)(initialConfig, config => {
const androidManifest = config.modResults;
const mainApplication = androidManifest.manifest.application?.[0];
if (mainApplication) {
const existingMetaData = mainApplication['meta-data']?.find(metadata => metadata.$['android:name'] === 'com.google.android.gms.wallet.api.enabled');
if (!existingMetaData) {
if (!mainApplication['meta-data']) {
mainApplication['meta-data'] = [];
}
mainApplication['meta-data'].push({
// eslint-disable-next-line id-length
$: {
'android:name': 'com.google.android.gms.wallet.api.enabled',
'android:value': 'true',
},
});
}
}
return config;
});
exports.withGooglePay = withGooglePay;
//# sourceMappingURL=with-google-pay.js.map