Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5993] 7.4.1 Ti.App.iOS.scheduleLocalNotification crash app

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2018-11-17T09:41:44.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsdefect, iphone
ReporterTony Lau
AssigneeShak Hossain
Created2018-10-27T19:48:35.000+0000
Updated2018-11-17T09:41:44.000+0000

Description

In 7.4.1, call Ti.App.iOS.scheduleLocalNotification crash the app instantly. The function works properly in 7.4.0 and prior versions. Sample code:
var tempdate = new Date(new Date().getTime() + 5000);
var curNotif = {
	alertBody : "Me",
	alertTitle : 'It is me',
	badge: 99,
	userinfo: {id: '123'},
	date: tempdate						
};
					
Ti.App.iOS.scheduleLocalNotification(curNotif);
Crash log:
ERROR] :  The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] :  Reason:
[ERROR] :  -[TiApp application:didReceiveRemoteNotification:]: unrecognized selector sent to instance 0x103901b60
[ERROR] :  Stack trace:
[ERROR] :  0   CoreFoundation                      0x0000000184177f10 <redacted> + 252
[ERROR] :  1   libobjc.A.dylib                     0x0000000183345a40 objc_exception_throw + 56
[ERROR] :  2   CoreFoundation                      0x000000018408f154 <redacted> + 0
[ERROR] :  3   CoreFoundation                      0x000000018417d50c <redacted> + 640
[ERROR] :  4   CoreFoundation                      0x000000018417f4bc _CF_forwarding_prep_0 + 92
[ERROR] :  5   A1                                  0x00000001002bd928 A1 + 1464616
[ERROR] :  6   UIKitCore                           0x00000001b0fbf220 <redacted> + 3176
[ERROR] :  7   UIKitCore                           0x00000001b08462d8 <redacted> + 680
[ERROR] :  8   UIKitCore                           0x00000001b0845fe0 <redacted> + 432
[ERROR] :  9   UIKitCore                           0x00000001b084b1a0 <redacted> + 220
[ERROR] :  10  UIKitCore                           0x00000001b084c100 _performActionsWithDelayForTransitionContext + 112
[ERROR] :  11  UIKitCore                           0x00000001b084b058 <redacted> + 248
[ERROR] :  12  UIKitCore                           0x00000001b084fd9c <redacted> + 368
[ERROR] :  13  UIKitCore                           0x00000001b0b91118 <redacted> + 468
[ERROR] :  14  FrontBoardServices                  0x0000000186ba85a0 <redacted> + 228
[ERROR] :  15  libdispatch.dylib                   0x0000000183bb0484 <redacted> + 16
[ERROR] :  16  libdispatch.dylib                   0x0000000183b873f0 <redacted> + 216
[ERROR] :  17  FrontBoardServices                  0x0000000186be6640 <redacted> + 40
[ERROR] :  18  FrontBoardServices                  0x0000000186be62cc <redacted> + 416
[ERROR] :  19  FrontBoardServices                  0x0000000186be68e8 <redacted> + 56
[ERROR] :  20  CoreFoundation                      0x00000001841065b8 <redacted> + 24
[ERROR] :  21  CoreFoundation                      0x0000000184106538 <redacted> + 88
[ERROR] :  22  CoreFoundation                      0x0000000184105e1c <redacted> + 176
[ERROR] :  23  CoreFoundation                      0x0000000184100ce8 <redacted> + 1040
[ERROR] :  24  CoreFoundation                      0x00000001841005b8 CFRunLoopRunSpecific + 436
[ERROR] :  25  GraphicsServices                    0x0000000186374584 GSEventRunModal + 100
[ERROR] :  26  UIKitCore                           0x00000001b0fa8bc8 UIApplicationMain + 212
[ERROR] :  27  A1                                  0x000000010015f8b8 A1 + 30904
[ERROR] :  28  libdyld.dylib                       0x0000000183bc0b94 <redacted> + 4
-- End application log -------------------------------------------------------

Comments

  1. Vijay Singh 2018-10-29

    [~tlau] I am not able to reproduce the crash. It is working fine iPhone 7 plus (iOS 12) simulator. I am using following test case -
       Ti.App.iOS.registerUserNotificationSettings({
           types: [
               Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT
           ],
       });
       var tempdate = new Date(new Date().getTime() + 5000);
       var curNotif = {
           alertBody : "Me",
           alertTitle : 'It is me',
           badge: 99,
           userinfo: {id: '123'},
           date: tempdate                      
       };
                           
       Ti.App.iOS.scheduleLocalNotification(curNotif);
       
    Can you please share complete test code for reproducing the issue? Thanks!
  2. Tony Lau 2018-10-29

    For the NotificationSettings, I have two additional parameters. types : [Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT, Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND, Ti.App.iOS.USER_NOTIFICATION_TYPE_BADGE],
  3. Tony Lau 2018-10-29

    And able to reproduce on iPhone X, 6 Plus and iPad too.
  4. Sharif AbuDarda 2018-10-29

    Hello, I am testing the sample code from Vijay with the addition to three types and I am also not able to reproduce the issue in the simulator with SDK 7.4.1.GA. Please share the full reproducible code. Thanks.
  5. Tony Lau 2018-10-29

    That is the full code listed about. In simulator, I do not see the notification but the badge number increased by 1. When test with real iPhone X, 6 Plus and iPad device, the app simply just crashed. I revert that SDK back to 7.4.0 without changing and code, I see the notification popup without crash.
  6. john adamis 2018-10-30

    I was also affected by this issue for a test case i used the following code with a real device https://gist.github.com/lbrenman/d99076889cf55564af8bf2fd399af025 This is crucial since we need to use both local and push notifications. (since right now 7.4.0 works well with local notifications but has issues with push notifications)
  7. Vijay Singh 2018-11-07

    [~tlau] [~peaceofmind7] Can you please check TIMOB-26513, which fixes similar stuff. I guess this issue should be fixed with that patch. Thanks!
  8. Marc Favreau 2018-11-14

    FYI, I NEVER had a problem with a simulator. A HUGE part of the issue!
  9. Tony Lau 2018-11-17

    Vijay, I can confirm that the reported issue is fixed in SDK 7.5.0. App not crashing anymore without any code change. Please close ticket.
  10. Jan Vennemann 2018-11-17

    Fixed in TIMOB-26513

JSON Source