0

After push message from Google Firebase Console, The push message notification show on top of iPhone device and then I click the message and Xcode throws exception as below:

 [UIConcreteLocalNotification setAlertTitle:]: unrecognized selector sent to instance 0x17e1a810

 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIConcreteLocalNotification setAlertTitle:]: unrecognized selector sent to instance

here this code:

//show notification to status bar
UILocalNotification *local_notification = [[UILocalNotification alloc] init];

local_notification.userInfo = userInfo;
local_notification.alertBody = userInfo[@"notification"][@"body"];
local_notification.alertTitle = userInfo[@"notification"][@"title"] ? userInfo[@"notification"][@"title"]: @"VietAir.tv Thông báo";
local_notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:0]; // todo item due date (when notification will be fired). immediately here

 [[UIApplication sharedApplication] scheduleLocalNotification:local_notification];

Please help me, thanks for your suggestion

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
hungudgm
  • 9
  • 1
  • 7

1 Answers1

1

The problem is while setting the title. Check whether it has alertTitle method implemented or not. Check once the title format you are setting for it.

Santo
  • 1,611
  • 3
  • 17
  • 37