Closed gerzonc closed 1 year ago
Alternatively, could just document that the user must add schemes to the Info.plist directly:
{
"expo": {
"ios": {
"infoPlist": {
"LSApplicationQueriesSchemes": [...]
}
}
}
}
and avoid the config plugin altogether. Another possible solution could be something simple like this:
module.exports = function (config, schemes) => {
if (!config.ios) config.ios = {}
if (!config.ios.infoPlist) config.ios.infoPlist = {}
if (!Array.isArray(config.ios.infoPlist.LSApplicationQueriesSchemes)) {
config.ios.infoPlist.LSApplicationQueriesSchemes = []
}
config.ios.infoPlist.LSApplicationQueriesSchemes = [...(new Set([
...config.ios.infoPlist.LSApplicationQueriesSchemes,
...schemes
])];
}
Alternatively, could just document that the user must add schemes to the Info.plist directly:
{ "expo": { "ios": { "infoPlist": { "LSApplicationQueriesSchemes": [...] } } } }
and avoid the config plugin altogether. Another possible solution could be something simple like this:
module.exports = function (config, schemes) => { if (!config.ios) config.ios = {} if (!config.ios.infoPlist) config.ios.infoPlist = {} if (!Array.isArray(config.ios.infoPlist.LSApplicationQueriesSchemes)) { config.ios.infoPlist.LSApplicationQueriesSchemes = [] } config.ios.infoPlist.LSApplicationQueriesSchemes = [...(new Set([ ...config.ios.infoPlist.LSApplicationQueriesSchemes, ...schemes ])]; }
Ooh, didn't know we could modify Info.plist
directly from app.json
😲 I believe there is no need for this config plugin then!
Why
Related issue: #379
But basically, by following
React Native Razorpay
docs we can see that in order to use the UPI Intent on iOS we must add the apps URL scheme's toLSApplicationQueriesSchemes
.How
We must pass values to the
LSApplicationQueriesSchemes
onInfo.plist
, more specifically, an array of values, to tell which apps our app is going to communicate with (e.g.tez
,phonepe
andpaytmmp
).Test Plan
plugins
attribute on yourapp.json
(orapp.config.ts
):