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(ios): revert accidental change to category "callback" #328

Merged
merged 2 commits into from
Dec 9, 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: 3 additions & 1 deletion src/ios/PushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ - (void)didReceiveNotificationResponse:(NSNotification *)notification {
NSDictionary *originalUserInfo = response.notification.request.content.userInfo;
NSMutableDictionary *modifiedUserInfo = [originalUserInfo mutableCopy];
[modifiedUserInfo setObject:applicationStateNumber forKey:@"applicationState"];
[modifiedUserInfo setObject:response.actionIdentifier forKey:@"actionCallback"];

switch (applicationState) {
case UIApplicationStateActive:
Expand Down Expand Up @@ -491,7 +492,8 @@ - (void)notificationReceived {
// Remove "actionCallback" when application state is not foreground. Only applied to foreground.
NSNumber *applicationStateNumber = mutableNotificationMessage[@"applicationState"];
UIApplicationState applicationState = (UIApplicationState)[applicationStateNumber intValue];
if (applicationState != UIApplicationStateActive) {
if (applicationState != UIApplicationStateActive
&& [[mutableNotificationMessage objectForKey:@"actionCallback"] isEqualToString:UNNotificationDefaultActionIdentifier]) {
[mutableNotificationMessage removeObjectForKey:@"actionCallback"];
}
// @todo do not sent applicationState data to front for now. Figure out if we can add
Expand Down
2 changes: 1 addition & 1 deletion src/ios/PushPluginSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ - (UNNotificationAction *)createActionFromDictionary:(NSDictionary *)dictionary
return nil;
}

NSString *identifier = [dictionary objectForKey:@"identifier"];
NSString *identifier = [dictionary objectForKey:@"callback"];
NSString *title = [dictionary objectForKey:@"title"];

if (!title || !identifier) {
Expand Down
Loading