Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19489] iOS9: 3D-Touch: Support UIApplicationShortcutItem ("Quick Actions")

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-10-02T21:12:40.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.1.0
ComponentsiOS
Labels3DTouch, iOS9
ReporterHans Knöchel
AssigneeHans Knöchel
Created2015-09-10T01:48:37.000+0000
Updated2015-10-28T11:24:43.000+0000

Description

Apple just presented the new 3D-Touch feature of the iPhone6S. User can press a view and will review an instant feedback providing a context-like menu to select different actions, called UIApplicationShortcutItem. After clicking on one of the actions, the user will guided to the app where several actions can be performed depending on the action. There are the properties type, localizedTitle, localizedSubtitle, icon and userInfo. There is also a UIApplicationShortcutIcon to configure the icon or associate it with existing (contact) images to personalize the experience. We differentiate *static* vs. *dynamic* shortcut items: - *Static*: Are set in the Info.plist before launching the app. - *Dynamic*: Are set in the app to offer a dynamic behavior at runtime. As is currently see it, we can support static action very easy by letting the user write them in the section of our tiapp.xml. Dynamic shortcut items will need an own proxy to receive existing actions and configure own actions. *Related documents*: - https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIApplicationShortcutItem_class/ - https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIApplicationShortcutIcon_Class/index.html#//apple_ref/occ/cl/UIApplicationShortcutIcon - https://developer.apple.com/library/prerelease/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW36

Attachments

FileDateSize
Screen Shot 2015-09-15 at 19.53.36.png2015-09-16T02:57:13.000+0000554103

Comments

  1. Sebastian Klaus 2015-09-22

    This would be an awesome thing to make apps more user-friendly
  2. Hans Knöchel 2015-09-24

    [~cbowley] Works great! Altough we can test using the device starting tomorrow. But great to have.
  3. Hans Knöchel 2015-09-28

    PR (by [~ben.bahrenburg@gmail.com], work in progress): https://github.com/appcelerator/titanium_mobile/pull/7236
  4. Hans Knöchel 2015-10-02

    PR approved, thank you [~ben.bahrenburg@gmail.com]!
  5. Sebastian Klaus 2015-10-08

    How can I translate static shortcut items?
  6. Hans Knöchel 2015-10-14

    You can simply use a translation key e.g. "my_title" and translate it in the i18n/en/app.xml and i18n/de/app.xml. We will provide an example in the shortcuts docs. I remember [~fokkezb] created a ticket for that.
  7. Harry Bryant 2015-10-14

    Verified as working correctly, Using the example code provided, tested the UIApplicationShortcutItem feature for 3D touch, adding & removing "Contact Us" shortcut, as well as the static / dynamic app shortcut count reading the appropriate values. Tested on both iPhone 6S & iPhone 6S + devices. Closing Ticket. OSX El Capitan 10.11 Studio: 4.3.1.201509302304 Ti SDK: 5.2.0.v20151009071418 & 5.1.0.v20151008153630 Appc NPM: 4.2.1-1 Appc CLI: 5.1.0-38
  8. Fokke Zandbergen 2015-10-15

    [~benutzername] [~hansknoechel] that's TIDOC-2341
  9. Sebastian Klaus 2015-10-15

    Great news! And the translations work well. But I still can't use 5.1.x causing TC-5718
  10. Sebastian Klaus 2015-10-26

    How do I use an own icon file in dynamic shortcut icons?
  11. Fokke Zandbergen 2015-10-26

    [~benutzername] for now we're disabling main thread (TIMOB-19760) so TC-5718 is no issue anymore. Just set the path to the icon image to the icon property (image/myIcon.png) which should be a 35p b/w image (so-called template icon). I will release a sample app with it this week.
  12. Sebastian Klaus 2015-10-26

    Thanks [~fokkezb] I just was a little bit confused, because Apple splits it in iconType and iconFile. But if you say so, I'll do it that way.
  13. Fokke Zandbergen 2015-10-26

    Mmm, yes. I guess it's always a balance between staying close the original APIs and making it more JS-ish and staying close to our cross-platform APIs.
  14. Sebastian Klaus 2015-10-26

    That's ok. It's even better to let the code in background decide, to take an integer or a string, than the let the user make mistakes ;)
  15. Sebastian Klaus 2015-10-27

    [~fokkezb] Own images worked in 5.2.0.v20151021171225 and stopped working in 5.2.0.v20151026172037
  16. Fokke Zandbergen 2015-10-27

    [~hansknoechel] could this be because we decided to rip out image asset catalogs last minute? (which I heard we did in Flow, not sure why)
  17. Hans Knöchel 2015-10-27

    [~fokkezb] [~benutzername] We removed the asset catalog in the 5.1.0 by default, because they was discovered an issue where files could not be accessed any more (TIMOB-19757). You can turn it on by using <use-app-thinning>true</use-app-thinning>. That will also be documented in 5.1.0 and most probably fixed in 5.2.0.
  18. Sebastian Klaus 2015-10-27

    Ah, good to know. Thanks
  19. Fokke Zandbergen 2015-10-27

    [~hans123] to prevent surprises, cant we name the code work with both?
  20. Hans Knöchel 2015-10-27

    Nope, the API only accepts an image name inside the asset catalog.
  21. Fokke Zandbergen 2015-10-28

    Updated sample and blog post.

JSON Source