UNPKG

expo-moyasar-apple-pay

Version:

iOS native apple pay implementation & integration with Moyasar SDK

37 lines (31 loc) 1.09 kB
const {withDangerousMod} = require('@expo/config-plugins'); const path = require('path'); const fs = require('fs'); const { mergeContents, } = require('@expo/config-plugins/build/utils/generateCode'); const withIOS = config => { return withDangerousMod(config, [ 'ios', async config => { const filePath = path.join( config.modRequest.platformProjectRoot, 'Podfile', ); const contents = fs.readFileSync(filePath, 'utf-8'); const moyasarPodfileDep = mergeContents({ tag: 'add Moyasar SDK to Podfile', src: contents, newSrc: [ `pod 'MoyasarSdk', :git => 'https://github.com/moyasar/moyasar-ios-pod', :tag => 'v2.0.1'`, ].join('\n'), anchor: 'config = use_native_modules!', offset: 0, comment: '#', }); fs.writeFileSync(filePath, moyasarPodfileDep.contents); return config; }, ]); }; module.exports = withIOS;