Skip to content

Commit c42aac2

Browse files
Fixed bug with android fcm plugin
1 parent dce0698 commit c42aac2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/with-fcm-manifest-fixes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ const { withAndroidManifest, AndroidConfig } = require('@expo/config-plugins');
22

33
const withFcmManifestFixes = (config) => {
44
return withAndroidManifest(config, (cfg) => {
5-
const { manifest } = cfg.modResults;
5+
const androidManifest = cfg.modResults;
6+
const { manifest } = androidManifest;
67

78
// Ensure tools namespace on <manifest>
89
manifest.$ = manifest.$ || {};
@@ -11,7 +12,7 @@ const withFcmManifestFixes = (config) => {
1112
}
1213

1314
// Get <application>
14-
const app = AndroidConfig.Manifest.getMainApplication(manifest);
15+
const app = AndroidConfig.Manifest.getMainApplicationOrThrow(androidManifest);
1516
if (!app) { throw new Error('Main application not found in AndroidManifest'); }
1617

1718
// Helper to upsert <meta-data> by android:name

0 commit comments

Comments
 (0)