Does corona have 3D touch support for in app or if you 3D touch the app on the home screen?
Yes. I’m not sure what build it went in on, but it’s been there for at least 6 months or longer and is in the current public build. There is an extra field in the touch events called event.pressure. You can read about it here:
https://docs.coronalabs.com/api/event/touch/pressure.html
It works with both Android and iOS devices that have pressure sensitive touch.
Rob
Yes I have seen this but I’m asking about how I can implement a 3D touch shortcut. For example if I am on the homescreen, instead of regularly touching my app I want to be able to 3D touch it and see 2 shortcuts.
I don’t have a 3D touch device that I can easily test on, but this page from Apple:
Seems to indicate that it’s a matter of just adding somethings to the plist in build.settings. Of course their examples don’t work directly in Lua, you would need to convert them to Lua tables.
The next phase would be to see if it works. If it does, I suspect you will get a populated launchArgs table.
local json = require( "json" ) local launchArgs = ... if launchArgs then print("Startup with launch arguments") print( json.prettify( launchArgs ) end
And see what parameters you get passed.
Rob
I found one of engineers who had a 6s and had him conduct a test for me. There is good news and bad news. The good news is displaying the flyout menu is just a matter of dropping some code into your build.settings:
iphone = { plist = { UIApplicationShortcutItems = { { UIApplicationShortcutItemIconType = "UIApplicationShortcutIconTypeCompose", UIApplicationShortcutItemTitle = "New message", UIApplicationShortcutItemType = "com.mycompany.myapp.newmessage", UIApplicationShortcutItemUserInfo = { key1 = "value1", key2 = "value2", } }, { UIApplicationShortcutItemIconType = "UIApplicationShortcutIconTypePlay", UIApplicationShortcutItemTitle = "Play", UIApplicationShortcutItemType = "com.mycompany.myapp.play", UIApplicationShortcutItemUserInfo = { key1 = "value3", key2 = "value4", } } }, CFBundleIconFile = "Icon.png", etc.
The bad news is Corona SDK doesn’t receive anything that would let you make use of this feature. As of now, this is not possible in Corona SDK.
There are a couple of next steps. The first is to put in a feature request at:
https://feedback.coronalabs.com
and create a new feature request for this and get some people voting it up. There were quite a few votes for people wanting to get 3D implemented inside of Corona. So it shouldn’t be hard for this to get voted up either.
In the mean time you could consider Corona Enterprise if this is an important feature to you. It doesn’t look too difficult to implement on the native side and then it’s a matter of communicating that data back to the Lua side.
Rob
So if I am understanding you correctly this is possible but I cannot test it in the Corona SDK?
It is possible to generate the menu. It is *not* possible for Corona SDK to do anything about it until we add support for it.
It is possible for Corona Enterprise to do this, but you would in fact be adding the native code to do it.
Rob
Yes. I’m not sure what build it went in on, but it’s been there for at least 6 months or longer and is in the current public build. There is an extra field in the touch events called event.pressure. You can read about it here:
https://docs.coronalabs.com/api/event/touch/pressure.html
It works with both Android and iOS devices that have pressure sensitive touch.
Rob
Yes I have seen this but I’m asking about how I can implement a 3D touch shortcut. For example if I am on the homescreen, instead of regularly touching my app I want to be able to 3D touch it and see 2 shortcuts.
I don’t have a 3D touch device that I can easily test on, but this page from Apple:
Seems to indicate that it’s a matter of just adding somethings to the plist in build.settings. Of course their examples don’t work directly in Lua, you would need to convert them to Lua tables.
The next phase would be to see if it works. If it does, I suspect you will get a populated launchArgs table.
local json = require( "json" ) local launchArgs = ... if launchArgs then print("Startup with launch arguments") print( json.prettify( launchArgs ) end
And see what parameters you get passed.
Rob
I found one of engineers who had a 6s and had him conduct a test for me. There is good news and bad news. The good news is displaying the flyout menu is just a matter of dropping some code into your build.settings:
iphone = { plist = { UIApplicationShortcutItems = { { UIApplicationShortcutItemIconType = "UIApplicationShortcutIconTypeCompose", UIApplicationShortcutItemTitle = "New message", UIApplicationShortcutItemType = "com.mycompany.myapp.newmessage", UIApplicationShortcutItemUserInfo = { key1 = "value1", key2 = "value2", } }, { UIApplicationShortcutItemIconType = "UIApplicationShortcutIconTypePlay", UIApplicationShortcutItemTitle = "Play", UIApplicationShortcutItemType = "com.mycompany.myapp.play", UIApplicationShortcutItemUserInfo = { key1 = "value3", key2 = "value4", } } }, CFBundleIconFile = "Icon.png", etc.
The bad news is Corona SDK doesn’t receive anything that would let you make use of this feature. As of now, this is not possible in Corona SDK.
There are a couple of next steps. The first is to put in a feature request at:
https://feedback.coronalabs.com
and create a new feature request for this and get some people voting it up. There were quite a few votes for people wanting to get 3D implemented inside of Corona. So it shouldn’t be hard for this to get voted up either.
In the mean time you could consider Corona Enterprise if this is an important feature to you. It doesn’t look too difficult to implement on the native side and then it’s a matter of communicating that data back to the Lua side.
Rob
So if I am understanding you correctly this is possible but I cannot test it in the Corona SDK?
It is possible to generate the menu. It is *not* possible for Corona SDK to do anything about it until we add support for it.
It is possible for Corona Enterprise to do this, but you would in fact be adding the native code to do it.
Rob