Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20105] iOS: Foreground and TextInput interactive notifications do not work when bundle Watch App is installed

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.1.0, Release 5.1.1
Fix Version/sn/a
ComponentsiOS
LabelswatchOS2
ReporterFokke Zandbergen
AssigneeUnknown
Created2015-12-07T15:44:49.000+0000
Updated2018-02-28T19:55:19.000+0000

Description

The attached project demonstrates that if a Titanium app is bundled with a watchOS (2) app, interactive notifications with FOREGROUND activationMode or TEXTINPUT behavior do not work as expected when the Watch App is installed. *Steps to reproduce*

Install on an iPhone but not yet install the bundled Watch App.

*Works via iPhone*

Open the app, tap the button and quickly press the iPhone home button.

Drag down the notification banner when it appears.

Tap either action and confirm that the localnotificationaction event appears in the console (after entering input).

*Works via Apple Watch when Watch App is not installed*

Open the app, tap the button and quickly lock the iPhone.

On the Apple Watch tap either action and confirm that the localnotificationaction event appears in the console (after entering input).

*Fails via Apple Watch when Watch App is installed*

Install the bundled Watch App via the Watch companion app.

Open the app, tap the button and quickly lock the iPhone.

Tap the _Works_ action and confirm that the localnotificationaction event appears in the console.

On the Apple Watch tap the _Fails_ action and confirm that nothing happens.

You can also change the app.js to use FOREGROUND activationMode without TEXTINPUT behavior and confirm that this does open the Watch App as expected but again the iOS app does not receive the localnotificationaction event. *Whose bug is this?* Run [this Swift iOS and WatchOS2 project](https://github.com/satheeshwaran/Notifications-iOS9) to confirm that here the expected function of the iOS app *does* get called for the above TEXTINPUT scenario. So it does seem to be a Titanium bug, although [this Apple Forum topic](https://forums.developer.apple.com/thread/22453) looks related as well. For the FOREGROUND scenario you will have to modify AppDelegate.swift and add the following function. You'll see that this doesn't seem to get called. I guess this is normal when the bundled Watch App is installed although I didn't see this 100% confirmed in the docs.
    func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void){
        
        NSLog("Without text")
        completionHandler()
        
    }

Attachments

FileDateSize
internotify.zip2015-12-07T15:32:54.000+00004269542

Comments

  1. Fokke Zandbergen 2015-12-07

    /cc [~hansknoechel]

JSON Source