Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo push notification entitlement #13

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ UPCOMING

* Removed deprecated API `registerForRemoteNotifications`. Please use `requestNotificationAuthorization` to request permission when needed, and `requestToken` at each app launch.

**Expo**

* Batch now automatically adds Apple push notification entitlement since it was removed from Expo SDK 51.


9.0.2
----
Expand Down
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
Loading