[3d Touch Plugin] Don't know how to use this 3D Touch plugin

Forge Component
(2)
Published on 12 Aug by Experts
2 votes
Published on 12 Aug by Experts

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:

That much I could figure. But where do you define the page you want the in 3D Touch action?

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.


onHomeIconPressed

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):

  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:

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 :(

It would help me a little :)


Ricardo Monteiro wrote:

Fábio Vaz wrote:

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 :(

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

Fábio Vaz wrote:

Ricardo Monteiro wrote:

Fábio Vaz wrote:

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 :(

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...


Ricardo Monteiro wrote:

Fábio Vaz wrote:

Ricardo Monteiro wrote:

Fábio Vaz wrote:

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 :(

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

Fábio Vaz wrote:

Ricardo Monteiro wrote:

Fábio Vaz wrote:

Ricardo Monteiro wrote:

Fábio Vaz wrote:

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 :(

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

Hi Ricardo,


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.