65ad16e394
* Add build config plugin to set .MainActivity launchMode
* Change android:launchMode to standard
* Revert "Change android:launchMode to standard"
This reverts commit fddbc4e1b5.
* adjust
---------
Co-authored-by: Hailey <me@haileyok.com>
18 lines
624 B
JavaScript
18 lines
624 B
JavaScript
const {withAndroidManifest} = require('expo/config-plugins')
|
|
|
|
module.exports = function withAndroidManifestLaunchModePlugin(appConfig) {
|
|
return withAndroidManifest(appConfig, function (decoratedAppConfig) {
|
|
try {
|
|
const mainApplication =
|
|
decoratedAppConfig.modResults.manifest.application[0]
|
|
const mainActivity = mainApplication.activity.find(
|
|
elem => elem.$['android:name'] === '.MainActivity',
|
|
)
|
|
mainActivity.$['android:launchMode'] = 'singleTop'
|
|
} catch (e) {
|
|
console.error(`withAndroidManifestLaunchModePlugin failed`, e)
|
|
}
|
|
return decoratedAppConfig
|
|
})
|
|
}
|