Could someone give me a quick guide on how to use this on mobile apps?
That much I could figure. But where do you define the page you want the in 3D Touch action?
Ricardo Monteiro wrote:
Ricardo,
I think in action "SetQuickActions", and when you ill press over the icon of app what you configure in that action ill appear
Look at the component Documentation:
https://github.com/OutSystems/cordova-plugin-3dtouch
Can't see where I define that (for example) the check in 3D Touch shortcut goes to the app's check in page.
When a home icon is pressed, your app launches and this JS callback is invoked. I found it worked reliable when you use it like this (you should recognize the type params used previously):
type
document.addEventListener('deviceready', function () { ThreeDeeTouch.onHomeIconPressed = function (payload) { console.log("Icon pressed. Type: " + payload.type + ". Title: " + payload.title + "."); if (payload.type == 'checkin') { document.location = 'checkin.html'; } else if (payload.type == 'share') { document.location = 'share.html'; } else { // hook up any other icons you may have and do something awesome (e.g. launch the Camera UI, then share the image to Twitter) console.log(JSON.stringify(payload)); } } }, false);
Maybe you need change something, the plugin dont has that if in bold
Search for onHomeIconPressed in ThreeDeeTouchPlugin and you ill see that
Could you make a working example of that? Send me an oml with a 3D Touch action going to a certain page of your mobile app please.
Hi Ricardo,
I don´t have any IOS to test, i can do a oml but i'll dont 100% sure if it work's :(
Fábio Vaz wrote:
It would help me a little :)
Ricardo, lets pray :P
Use this oml and see the comment inside him. Hope it works
Create in QuickActions test type and Share type
Sadly it doesn't work...
Sorry, maybe someone with a iphone can be more usefull
I will pray for another kind soul :P
I used this plugin in order to have some static shortcut menu options when doing a force touch on the app icon, and it worked for me.
What you need to do are basically two steps:
1) Call the SetQuickActions client action in order to provide the plugin with the set of options you need. In my case, because I just needed some static shortcuts, I did this in the OnApplicationReady event.
2) Drag the WatchTouch block into the layout block of your pages, creating an event handler for the AppStart event. In this handler you can decide based on the attribute "type" of the QuickAction selected by the user to which page you want to redirect him.
Be aware that this plugin is only currently supported by iOS, although there are rumors that Android Q might also have this feature.