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

iOS: Interactive notifications with activationMode background don't work when app is not already in memory

    Details

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

      iOS 9.2, SDK 5.1.1.GA

    • Story Points:
      15
    • Sprint:
      2017 Sprint 14 SDK

      Description

      For interactive notifications to work you have to listen for event 'localnotificationaction' (and/or remotenotificationaction for push notifications). I have an action set to activationMode: Ti.App.iOS.USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND which should allow execution of some code without launching the app to foreground. This only seems to work when the app is already/still in memory.

      Expected behavior would be that it always works even if the app has never been started yet. This works fine with WhatsApp for example. Looking at the ObjC code (mainly in TiApp.m) for this and placing some debug logging here and there I don't see how this can work. The code in TiApp.m triggers the fireevent but at that time the JS part of the app has not fully loaded yet, causing the event to be missed in JS because the listener could not be setup yet.

      Another issue that will cause this not to work is that when handling an interactive notification in the background is that the full app is loaded (at least attempted). This will fail because UI interaction is not allowed when in background.

      Code in TiApp.m that should handle this:

      - (void) application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler
      

      and

      - (void) application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hknoechel Hans Knöchel
                Reporter:
                ludolphus Steven van Loef
                Reviewer:
                Vijay Singh
                Tester:
                Abir Mukherjee
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code