Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26444

Calling Titanium.App.iOS.UserNotificationCenter.getDeliveredNotifications causes 'NSInvalidArgumentException'

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 7.4.1
    • Component/s: iOS
    • Labels:
      None
    • Environment:

      SDK >7.2

    • Story Points:
      3
    • Sprint:
      2018 Sprint 21

      Description

      Calling Titanium.App.iOS.UserNotificationCenter.getDeliveredNotifications causes 'NSInvalidArgumentException'.
      The first line of the stacktrace ` -[UNNotification content]: unrecognized selector sent to instance` points to a type mismatch. The code attempts to get the 'content' property on UNNotification instead of UNNotificationRequest.
      Code should be modified to look like this. I can provide a PR

       [[UNUserNotificationCenter currentNotificationCenter] getDeliveredNotificationsWithCompletionHandler:^(NSArray<UNNotification *> *notifications) {
              NSMutableArray *result = [NSMutableArray arrayWithCapacity:[notifications count]];
       
              for (UNNotification *notification in notifications) {
                [result addObject:[self dictionaryWithUserNotificationRequest:[notification request]]];
              }
      

        Attachments

          Activity

            People

            • Assignee:
              vijaysingh Vijay Singh
              Reporter:
              rlustemberg Richard Lustemberg
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-6618
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code