Skip to main content

How to add codes in your MainApplication.java file using expo

Inside your app.plugin.js file, add the following code.

const {
withCustomMainApplication,
} = require('@appmaker-xyz/expo-plugins');

module.exports = function myCustomExpoFunctionName(config) {
config = withCustomMainApplication(config, {
javaImports: [
'com.mycustompackage.MyCustomClass', // Add your custom class package for import, If needed you can add multiple classes since this is an array.
],
onCreateAfterSoLoader: 'MyCustomClass.init();', // Add your custom class initialization code here
});
return config;
};