Coder Social home page Coder Social logo

Comments (19)

jesobreira avatar jesobreira commented on May 20, 2024 1

Did we run into the same issue again?

The modification posted by @akaNightmare was done in a file that does not exist anymore on Ionic Native's codebase.

And onHomeIconPressed does not fire for me either, although configureQuickActions works. From my debugging, the plugin's performActionForShortcutItem is not running (using with Ionic/Capacitor).

from cordova-plugin-3dtouch.

EddyVerbruggen avatar EddyVerbruggen commented on May 20, 2024

Have you also tried it as shown in the readme?

from cordova-plugin-3dtouch.

enzor77 avatar enzor77 commented on May 20, 2024

Any idea on how override the splashscreen collision?
Any help will be much appreciated

from cordova-plugin-3dtouch.

enzor77 avatar enzor77 commented on May 20, 2024

Hi, what is teh difference between what I used and what is showed on readme?
I'm using same procedure, if not wrong...
Thanks a lot for your prompt reply

from cordova-plugin-3dtouch.

enzor77 avatar enzor77 commented on May 20, 2024

from cordova-plugin-3dtouch.

santekotturi avatar santekotturi commented on May 20, 2024

@enzor77 try wrapping onHomeIconPressed in addEventListener

document.addEventListener('deviceready', function () {
 ThreeDeeTouch.onHomeIconPressed = function(payload) {
     console.log("Icon pressed. Type: " + payload.type + ". Title: " + payload.title + ".");
     if 
     (payload.type == 'searchapplication') {$state.go('app.vehicles');} 
     else if 
     (payload.type == 'searchcode') {$state.go('app.code');} 
     else if 
     (payload.type == 'searchproduct') {$location.path('app/product');} 
     else if 
     (payload.type == 'searchbarcode') {$location.path('app/barcode');} 
     else {
       // wrapping in a timeout, otherwise it collides with the splashscreen
       setTimeout(function() {
         alert(JSON.stringify(payload));
       }, 500);
     }
   };
})

[edit]: also, are your injecting $state and $location ? can you try without those and just get it to console.log the payload?

from cordova-plugin-3dtouch.

toriqo avatar toriqo commented on May 20, 2024

hi,

the plugin stopped working for me as well. I had some custom icon templates, working fine and all of a sudden it stopped working.
i've removed the plugin and re-added it, i've used the stock example code, nothing.
should i remove and re-add the ios platform? though i wouldn't want to do that and go through all the hassle with the pods etc.

might have something to do with ios 10.3 (iphone7)

also, if i add your example code in the .plist file, both of those actions open my front camera (opening the front camera is one of the options i have set in the configureQuickActions)

thanks

from cordova-plugin-3dtouch.

toriqo avatar toriqo commented on May 20, 2024

@EddyVerbruggen is this repo still maintained?

from cordova-plugin-3dtouch.

EddyVerbruggen avatar EddyVerbruggen commented on May 20, 2024

@toriqo Sure, all PR's are welcome as always.

from cordova-plugin-3dtouch.

toriqo avatar toriqo commented on May 20, 2024

@EddyVerbruggen well, i was expecting some feedback regarding this issue :)
do you know what's happening or should i do a pull request for a fix? :)

thanks

from cordova-plugin-3dtouch.

EddyVerbruggen avatar EddyVerbruggen commented on May 20, 2024

Do you have one?

from cordova-plugin-3dtouch.

toriqo avatar toriqo commented on May 20, 2024

nope. but i could investigate and see what's wrong. just wanted to know if it's something you know about.

from cordova-plugin-3dtouch.

JoxieMedina avatar JoxieMedina commented on May 20, 2024

Anyone can help me , I'm experiencing the same problem with ionic v1 (1.3.1), the actions are correctly added but I can't make the method assigned to ThreeDeeTouch.onHomeIconPressed get trigger, I tried many ways to do it but no luck at the end I have an implementation pretty much like this : https://github.com/ashteya/ionic-tutorial-quickactions , If anyone can make it works please let me kwon how to do it

Greetings and thanks for your time and effort

from cordova-plugin-3dtouch.

akaNightmare avatar akaNightmare commented on May 20, 2024

Guys, any movements to fix this issue?

from cordova-plugin-3dtouch.

JoxieMedina avatar JoxieMedina commented on May 20, 2024

Hi @akaNightmare , I managed to make this works with the following steps:

  1. Configure the Quick Actions in the config function in the angular module like this:
    ...
 .config(function () {
    document
      .addEventListener("deviceready", function () {
        ThreeDeeTouch.isAvailable(function (available) {
          if (available) { // Comment out this check if testing in simulator
            console.log('Configure 3D touch, available');
            // Configure Quick Actions
            ThreeDeeTouch.configureQuickActions([
              {
                type: 'send', // optional, but can be used in the onHomeIconPressed callback
                title: 'Enviar Dinero', // mandatory
                iconType: 'location' // optional
              }, {
                type: 'pay',
                title: 'Pay',
                iconType: 'compose' // optional
              }, {
                type: 'locations',
                title: 'Locations',
                iconType: 'markLocation' // optional
              }
            ]);

          }
        })

      }, false);

...

  1. Add the actions listener in the run function in the angular module like this:
    ...
.run(function ($rootScope) {
    document
      .addEventListener('deviceready', function () {
        ThreeDeeTouch.onHomeIconPressed = function (payload) {
          console.log("Icon pressed. Type: " + payload.type + ". Title: " + payload.title + ".");
          if (payload.type == 'send') {
            $rootScope.$broadcast('openQuickSend');
          } else if (payload.type == 'pay') {
            $rootScope.$broadcast('openQuickPay');
          } else if (payload.type == 'locations') {
            $rootScope.$broadcast('openQuickSendLocations');
          }
        };
      }, false)

...
3. Note that I'm using $rootScope.$broadcast() to emit another event in the rootScope so the actions can be trigger in the controllers for example I handle all the actions in the MainCtrl, each one look like this:

...

$rootScope.$on('openQuickSendLocations', function () {
      console.log('opening locations')
      $state.go('locations');
    });

...

I hope this helps you!

from cordova-plugin-3dtouch.

akaNightmare avatar akaNightmare commented on May 20, 2024

@enzor77 thanks, however, I using ionic3.
Also, I found how to fix this issue, just need to update ionic/native package and particular commit for this fix -> danielsogl/awesome-cordova-plugins@6cd97ca

from cordova-plugin-3dtouch.

stevenleija avatar stevenleija commented on May 20, 2024

Did we run into the same issue again?

The modification posted by @akaNightmare was done in a file that does not exist anymore on Ionic Native's codebase.

And onHomeIconPressed does not fire for me either, although configureQuickActions works. From my debugging, the plugin's performActionForShortcutItem is not running (using with Ionic/Capacitor).

I have the same issue. Were you able to get it to work?

from cordova-plugin-3dtouch.

jesobreira avatar jesobreira commented on May 20, 2024

Hi, @stevenleija ! I didn't. My codebase has changed recently to React Native, so I won't be looking at solutions anymore.

from cordova-plugin-3dtouch.

mobileias avatar mobileias commented on May 20, 2024

hello

does anyone solve this issue into ionic 5 and capacitor?

My end also same issue,
it not called onHomeIconPressed

Thanks

from cordova-plugin-3dtouch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.