Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23806] Allow local images in static shortcut items (hash image names)

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS, Tooling
Labelscb-tooling
ReporterHans Knöchel
AssigneeUnknown
Created2015-10-17T05:27:21.000+0000
Updated2020-02-06T19:15:21.000+0000

Description

Currently, we can only set local icons for UIShortcutItems using our SDK API. As static shortcuts are added through the xml, it is natively possible to provide the asset catalog name there. Proposal: We need to hash the values inside the UIApplicationShortcutItems array dict, that have the key UIApplicationShortcutItemIconFile to get our asset catalog name. See this example:
<key>UIApplicationShortcutItems</key>
                <array>
                    <dict>
                        <key>UIApplicationShortcutItemIconFile</key>

                       <!-- Currently not possible, because image name is not hashed --> 
                        <string>images/icons/settings.png</string>

                        <key>UIApplicationShortcutItemTitle</key>
                        <string>select_canteen</string>
                        <key>UIApplicationShortcutItemType</key>
                        <string>SelectCanteen</string>
                        <key>UIApplicationShortcutItemUserInfo</key>
                        <dict/>
                    </dict>
                </array>

Comments

  1. Sebastian Klaus 2015-11-12

    With which function are the image names hashed in the asset catalog?
  2. Hans Knöchel 2015-11-12

    [~benutzername] Check this out: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/ImageLoader.m#L514 I think if you manually hash the names you should make it work for now (as I think thats what you want to do).
  3. Sebastian Klaus 2015-11-12

    It works by searching the hashes in the image assets through Xcode
  4. Chee Kiat Ng 2016-08-23

    Somewhere in iOS build it needs to intercept these elements and convert them to hash before writing them to info.plist. This has to be done in such a way it doesn't force a rebuild.
  5. Chris Barber 2016-08-23

    By "CLI", you mean "iOS build".
  6. Chee Kiat Ng 2016-08-23

    yes. pardon me. corrected accordingly.
  7. Chris Barber 2020-02-06

    [~vijaysingh] Is this ticket still relevant now that asset name hashing is no more?
  8. Vijay Singh 2020-02-06

    It should be fixed in TIMOB-25032.

JSON Source