Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26344] iOS: Applications Shortcuts crash on SDK 7.3.0+ when triggered from background

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-09-20T10:36:39.000+0000
Affected Version/sRelease 7.3.0, Release 7.3.1
Fix Version/sRelease 7.4.0
ComponentsiOS
Labelscrash, ios, shortcuts
ReporterAndreas Pingas
AssigneeHans Knöchel
Created2018-08-29T22:27:24.000+0000
Updated2018-09-20T10:37:03.000+0000

Description

Please check out the following:
var windowA = Ti.UI.createWindow();
var windowB = Ti.UI.createWindow();

var tabA = Ti.UI.createTab({
	window:windowA,
	title:'Tab A'
});

var tabB = Ti.UI.createTab({
	window:windowB,
	title:'Tab B'
});
	
var tabGroup = Titanium.UI.createTabGroup({
	tabs:[tabA, tabB]
});

tabGroup.open();

var label = Ti.UI.createLabel({
    text: ''
});

windowA.add(label);

if (Ti.UI.iOS.forceTouchSupported) {
		
		Ti.App.iOS.addEventListener('shortcutitemclick', function(e) {	
			Ti.API.info('shortcutitemclick');
			label.text = 'Shortcut icon clicked, with title = ' + e.title;	
		});
		
		var appShortcuts = Ti.UI.iOS.createApplicationShortcuts();
		
		appShortcuts.removeAllDynamicShortcuts();
		
		appShortcuts.addDynamicShortcut({
		    itemtype:'itemt_a',
		    title:'Itemt A',
		    icon:Titanium.UI.iOS.SHORTCUT_ICON_TYPE_MESSAGE
		});

		appShortcuts.addDynamicShortcut({
		    itemtype:'itemt_b',
		    title:'Itemt B',
		    icon:Titanium.UI.iOS.SHORTCUT_ICON_TYPE_ADD
		});
			
	}
1) Open the app from shortcut
 2) Take the app to run on background 
3) Open the app from shortcut again The app terminates instantly

Comments

  1. Rakhi Mitro 2018-08-30

    Hello, Thanks for sharing this. Are you experiencing this on device? Have you seen any crash logs during your app termination? If yes, please share the logs here.
  2. Andreas Pingas 2018-08-30

    I test it on TestFlight for iPhone 6s on iOS 11.4.1
  3. Hans Knöchel 2018-08-30

    This looks like a valid issue! We refactored big parts of the UIApplicationDelegate handling in 7.3.0 and this may be a side-effect of doing it. Fixing today, patching for the next release (likely 7.3.2 as 7.3.1 will be released today already and finished QE-testing by now). *EDIT*: I am able to reproduce it and it indeed is triggered by the queued application delegates from cold boots.
  4. Hans Knöchel 2018-08-30

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/10296 PR (7_4_X): https://github.com/appcelerator/titanium_mobile/pull/10297 PR (7_3_X): https://github.com/appcelerator/titanium_mobile/pull/10298 Test-Case: See above! [~andreas.pingas] You can patch the change today and go for it!
  5. Keerthi Mahalingam 2018-09-06

    Verified the fix on 7.4.0.v20180906093302 and 7.5.0.v20180906093938. No Crashing occurs. Closing.
       Operating system
       Name                        = Mac OS X
         Version                     = 10.13.6
       Node.js
         Node.js Version             = 8.9.1
         npm Version                 = 5.5.1
       Titanium CLI
         CLI Version                 = 5.1.1
       
  6. Keerthi Mahalingam 2018-09-13

    [~amukherjee], the fix is not in 7.3.1 GA version.

JSON Source