Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5836] When the app is set on run on main thread for IOS it stops and restars without any errors appearing.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2018-08-14T12:43:59.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterAndreas Pingas
AssigneeShak Hossain
Created2018-08-14T10:40:43.000+0000
Updated2018-08-23T21:57:43.000+0000

Description

When the app is set on run on main thread for IOS it stops and restars without any errors appearing. 1) when the app runs and the user selects an App Shortcut 2) when the app runs and you close and re-open it, it opens and instantly stops running and restarts automatically

Comments

  1. Hans Knöchel 2018-08-14

    Please add a reproducible test-case for both cases. For 2) it is a known iOS bug (not only for Titanium apps) when an app is quit and reopened quickly afterwards. And for the first issue, I cannot reproduce it with the following code:
       var win = Ti.UI.createWindow({
           backgroundColor: '#ccc'
       });
       
       Ti.App.iOS.addEventListener('shortcutitemclick', function (e) {
           label.text = 'Shortcut icon clicked, with title = ' + e.title;
       });
       
       var label = Ti.UI.createLabel({
           text: ''
       });
       
       win.add(label);
       win.open();
       
    Shortcuts-items:
       	 <key>UIApplicationShortcutItems</key>
               <array>
                 <dict>
                   <key>UIApplicationShortcutItemIconType</key>
                   <string>UIApplicationShortcutIconTypeAdd</string>
                   <key>UIApplicationShortcutItemTitle</key>
                   <string>TestTitle</string>
                   <key>UIApplicationShortcutItemType</key>
                   <string>TestCategory</string>
                   <key>UIApplicationShortcutItemUserInfo</key>
                   <dict/>
                 </dict>
               </array>
       
  2. Andreas Pingas 2018-08-23

    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

JSON Source