Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27394] iOS: Application Shortcuts cannot handle SF Symbols

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2019-10-04T18:42:27.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.2.1
ComponentsiOS
LabelsengSchedule
ReporterHans Knöchel
AssigneeVijay Singh
Created2019-09-11T18:48:28.000+0000
Updated2020-11-04T03:48:18.000+0000

Description

Currently, application shortcuts cannot handle SF Symbols and error out with "Invalid icon provided, defaulting to use no icon". The simple fix is to properly handle TiBlob input types and assign it with the new symbols method of UIApplicationShortcuts.

Comments

  1. Hans Knöchel 2019-09-11

    cc [~vijaysingh]
  2. Vijay Singh 2019-09-16

    PR(master) - https://github.com/appcelerator/titanium_mobile/pull/11220 PR(8_2_X) - https://github.com/appcelerator/titanium_mobile/pull/11222 Test Case -
       Ti.App.iOS.addEventListener("shortcutitemclick", function(e){
           Ti.API.info("shortcutitemclick Event Fired");
           Ti.API.info("event payload:" + JSON.stringify(e));
       });
       var win = Titanium.UI.createWindow({
           title:'Test', backgroundColor:'#fff', layout:"vertical"
       });
       var btn1 = Ti.UI.createButton({
           top: 50, height:45, title:"Add System image (triangle) Application Shortcut"
       });
       win.add(btn1);
       btn1.addEventListener("click",function(){
           var image = Ti.UI.iOS.systemImage('drop.triangle.fill');
           var appShortcuts = Ti.UI.iOS.createApplicationShortcuts();
           appShortcuts.addDynamicShortcut({
               itemtype:"system_image",
               title:"System Image",
               subtitle:"Tap to reach us",
               icon: image,
               userInfo:{
               infoKey:"system_image"
               }
           });
       });
       var btn2 = Ti.UI.createButton({
           top: 10, height:45, title:"Remove System image (triangle) Application Shortcut"
       });
       win.add(btn2);
       btn2.addEventListener("click",function(){
           var appShortcuts = Ti.UI.iOS.createApplicationShortcuts();
           appShortcuts.removeDynamicShortcut("system_image");
       });
       
       var btn5 = Ti.UI.createButton({
           top: 10, height:45, title:"Dynamic Shortcut Exists?"
       });
       win.add(btn5);
       btn5.addEventListener("click",function(){
           var appShortcuts = Ti.UI.iOS.createApplicationShortcuts();
           var exists = appShortcuts.dynamicShortcutExists("system_image");
           var msg = (exists) ? "Icon exists" : "Sorry isn't there";
           alert(msg);
       });
       var btn6 = Ti.UI.createButton({
           top: 10, height:45, title:"Remove All Dynamic Shortcuts"
       });
       win.add(btn6);
       btn6.addEventListener("click",function(){
           var appShortcuts = Ti.UI.iOS.createApplicationShortcuts();
           appShortcuts.removeAllDynamicShortcuts();
       });
       
       win.open();
       
  3. Satyam Sekhri 2019-09-24

    FR Passed. An image blob is shown as part fo the app shortcut. Also no error is shown when adding the shortcut.
  4. Satyam Sekhri 2019-10-04

    Verified On: Mac OS: 10.14.5 SDK: 8.2.1.v20191003075717, 8.3.0.v20191003144543 Appc CLI: 7.1.1 JDK: 1.8.0_162 Node: 10.5.0 Studio: 5.1.4.201909061933 Xcode: 11.0 Device: iPhone X(13.0)

JSON Source