-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin 3DTouch bug #232
Comments
Hey @Bouzmine Thanks for reporting this issue. The problem is with the wrapper I created for that method. It's actually not a method, it's a property. (See https://github.com/EddyVerbruggen/cordova-plugin-3dtouch#onhomeiconpressed) Since you are using the plugin, can you tell me which of the following is a better option:
import {ThreeDeeTouch} from 'ionic-native';
...
ThreeDeeTouch.onHomeIconPressed = (payload: any) => {
// do something with payload.type
// do something with payload.title
};
// import plugin
...
let subscription = ThreeDeeTouch.onHomeIconPressed().subscribe(
(payload: any) => {
// do stuff with data
}
);
...
// then eventually stop processing that data
subscription.unsubscribe(); I'm not so sure if wrapping it with an observable would really work, but it should 😁 .. Let me know what you think is a better option, as I personally haven't used this plugin. |
I think option number 2 would better fit with Ionic Native's objective (providing observable wrapper for Cordova plugin, if I recall correctly). That said, if option 2 cannot work, option 1 would be just fine. |
I think this is what you mean by custom wrapper? @ihadeed something like: /**
* When a home icon is pressed, your app launches and this JS callback is invoked.
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
*/
static onHomeIconPressed(): Observable<any> {
return new Observable(observer => {
window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
})
} |
@mlynch Yes that's exactly what I meant. |
This should be fixed in next release. Let me know if you still have problems with it. |
Hi,
I am having trouble with the 3DTouch plugin which was recently added. The
configureQuickActions
is OK, it's theonHomeIconPressed()
that's bugging.I think this could be related with #106.
The text was updated successfully, but these errors were encountered: