[TIMOB-23806] Allow local images in static shortcut items (hash image names)
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS, Tooling |
Labels | cb-tooling |
Reporter | Hans Knöchel |
Assignee | Unknown |
Created | 2015-10-17T05:27:21.000+0000 |
Updated | 2020-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>
With which function are the image names hashed in the asset catalog?
[~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).
It works by searching the hashes in the image assets through Xcode
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.
By "CLI", you mean "iOS build".
yes. pardon me. corrected accordingly.
[~vijaysingh] Is this ticket still relevant now that asset name hashing is no more?
It should be fixed in TIMOB-25032.