Skip to content

Commit

Permalink
feat: add Notifee plugin configuration for Android build
Browse files Browse the repository at this point in the history
  • Loading branch information
Kgeek33 committed Jan 31, 2025
1 parent a86ef9c commit e8a3dd2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default (): ExpoConfig => ({
EXPO_ENV: "expo",
},
plugins: [
"./plugins/notifee-mod.js",
[
"expo-font",
{
Expand Down
17 changes: 17 additions & 0 deletions plugins/notifee-mod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { withProjectBuildGradle } = require("expo/config-plugins");

module.exports = function withNotifeeRepo (config) {
return withProjectBuildGradle(config, async config => {
const contents = config.modResults.contents;

if (!contents.includes("@notifee/react-native")) {
const replacement = `maven { url 'https://www.jitpack.io' }
maven {
url "$rootDir/../node_modules/@notifee/react-native/android/libs"
}`;
config.modResults.contents = contents.replace("maven { url 'https://www.jitpack.io' }", replacement);
}

return config;
});
};

0 comments on commit e8a3dd2

Please sign in to comment.