Hello,
I am building my application through ionic pro dashboard but I need to add this meta data to the androidManifest.xtml for setting the icon notification:
Is it posible to add the meta data through config.xml or something?
Thanks
Hello,
I am building my application through ionic pro dashboard but I need to add this meta data to the androidManifest.xtml for setting the icon notification:
Is it posible to add the meta data through config.xml or something?
Thanks
Nvm.
I fixed it by using the following hook:
module.exports = function (context) {
const fs = require(‘fs’);
const _ = require(‘lodash’);
const metadata = ‘’;
const manifestPath = context.opts.projectRoot + ‘/platforms/android/AndroidManifest.xml’;
const androidManifest = fs.readFileSync(manifestPath).toString();
const manifestLines = androidManifest.split(/\r?\n/);
const lineNo = _.findIndex(manifestLines, (line) => line.includes(‘android:name=“org.apache.cordova.firebase.FirebasePluginMessagingService”’));
if(lineNo) {
manifestLines.splice(lineNo - 1, 0, metadata);
fs.writeFileSync(manifestPath, manifestLines.join(’\n’));
}
};