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

fix: expo-notifications compatibility with customerio-expo-plugin #70

Merged
merged 4 commits into from May 11, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/helpers/constants/ios.ts
Expand Up @@ -40,10 +40,12 @@ CIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler
`;

export const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = `
[super application:application didFailToRegisterForRemoteNotificationsWithError:error];
[pnHandlerObj application:application error:error];
`;

export const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `
[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
return [pnHandlerObj application:application deviceToken:deviceToken];
`;

Expand Down
4 changes: 2 additions & 2 deletions src/ios/withAppDelegateModifications.ts
Expand Up @@ -88,7 +88,7 @@ const addDidFailToRegisterForRemoteNotificationsWithError = (
return stringContents;
};

const AddDidRegisterForRemoteNotificationsWithDeviceToken = (
const addDidRegisterForRemoteNotificationsWithDeviceToken = (
stringContents: string
) => {
stringContents = injectCodeByMultiLineRegexAndReplaceLine(
Expand Down Expand Up @@ -155,7 +155,7 @@ export const withAppDelegateModifications: ConfigPlugin<
stringContents =
addDidFailToRegisterForRemoteNotificationsWithError(stringContents);
stringContents =
AddDidRegisterForRemoteNotificationsWithDeviceToken(stringContents);
addDidRegisterForRemoteNotificationsWithDeviceToken(stringContents);

config.modResults.contents = stringContents;
} else {
Expand Down