Skip to content

Commit 1e161ce

Browse files
committed
expo: add ios notification entitlement during expo prebuild
1 parent a375b92 commit 1e161ce

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ConfigPlugin, withEntitlementsPlist } from '@expo/config-plugins';
2+
3+
export const withReactNativeBatchEntitlements: ConfigPlugin<object | void> = config => {
4+
return withEntitlementsPlist(config, config => {
5+
config.modResults = { ...config.modResults, 'aps-environment': 'development' };
6+
return config;
7+
});
8+
};

plugin/src/withReactNativeBatch.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { ConfigPlugin, createRunOncePlugin } from '@expo/config-plugins';
2-
import { withClassPath, withApplyPlugin, withGoogleServicesFile } from '@expo/config-plugins/build/android/GoogleServices';
2+
import { withApplyPlugin, withClassPath, withGoogleServicesFile } from '@expo/config-plugins/build/android/GoogleServices';
33

44
import { withReactNativeBatchAppBuildGradle } from './android/withReactNativeBatchAppBuildGradle';
55
import { withReactNativeBatchMainActivity } from './android/withReactNativeBatchMainActivity';
66
import { withReactNativeBatchMainApplication } from './android/withReactNativeBatchMainApplication';
77
import { withReactNativeBatchManifest } from './android/withReactNativeBatchManifest';
88
import { withReactNativeBatchAppDelegate } from './ios/withReactNativeBatchAppDelegate';
9+
import { withReactNativeBatchEntitlements } from './ios/withReactNativeBatchEntitlements';
910
import { withReactNativeBatchInfoPlist } from './ios/withReactNativeBatchInfoPlist';
1011

1112
export type Props = {
@@ -30,6 +31,7 @@ const withReactNativeBatch: ConfigPlugin<Props | void> = (config, props) => {
3031
newConfig = withReactNativeBatchMainApplication(newConfig);
3132
newConfig = withReactNativeBatchMainActivity(newConfig);
3233
newConfig = withReactNativeBatchInfoPlist(newConfig, _props);
34+
newConfig = withReactNativeBatchEntitlements(newConfig);
3335
newConfig = withReactNativeBatchAppDelegate(newConfig);
3436
// Return the modified config.
3537
return newConfig;

0 commit comments

Comments
 (0)