Skip to content

Commit

Permalink
expo: add ios notification entitlement during expo prebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-roland committed Nov 13, 2024
1 parent a375b92 commit a8776b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions plugin/src/ios/withReactNativeBatchEntitlements.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ConfigPlugin, withEntitlementsPlist } from '@expo/config-plugins';

export const withReactNativeBatchEntitlements: ConfigPlugin<object | void> = config => {
return withEntitlementsPlist(config, config => {
config.modResults = { ...config.modResults, 'aps-environment': 'development' };
return config;
});
};
4 changes: 3 additions & 1 deletion plugin/src/withReactNativeBatch.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ConfigPlugin, createRunOncePlugin } from '@expo/config-plugins';
import { withClassPath, withApplyPlugin, withGoogleServicesFile } from '@expo/config-plugins/build/android/GoogleServices';
import { withApplyPlugin, withClassPath, withGoogleServicesFile } from '@expo/config-plugins/build/android/GoogleServices';

import { withReactNativeBatchAppBuildGradle } from './android/withReactNativeBatchAppBuildGradle';
import { withReactNativeBatchMainActivity } from './android/withReactNativeBatchMainActivity';
import { withReactNativeBatchMainApplication } from './android/withReactNativeBatchMainApplication';
import { withReactNativeBatchManifest } from './android/withReactNativeBatchManifest';
import { withReactNativeBatchAppDelegate } from './ios/withReactNativeBatchAppDelegate';
import { withReactNativeBatchEntitlements } from './ios/withReactNativeBatchEntitlements';
import { withReactNativeBatchInfoPlist } from './ios/withReactNativeBatchInfoPlist';

export type Props = {
Expand All @@ -30,6 +31,7 @@ const withReactNativeBatch: ConfigPlugin<Props | void> = (config, props) => {
newConfig = withReactNativeBatchMainApplication(newConfig);
newConfig = withReactNativeBatchMainActivity(newConfig);
newConfig = withReactNativeBatchInfoPlist(newConfig, _props);
newConfig = withReactNativeBatchEntitlements(newConfig);
newConfig = withReactNativeBatchAppDelegate(newConfig);
// Return the modified config.
return newConfig;
Expand Down

0 comments on commit a8776b9

Please sign in to comment.