mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
fix(3dtouch): fix implementation for onHomeIconPressed function
closes #232
This commit is contained in:
parent
4c6006b2e4
commit
d2b2be6a70
@ -1,5 +1,6 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
declare var window: any;
|
||||
/**
|
||||
* @name 3DTouch
|
||||
* @description
|
||||
@ -85,7 +86,15 @@ export class ThreeDeeTouch {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static onHomeIconPressed(): Observable<any> {return; }
|
||||
static onHomeIconPressed(): Observable<any> {
|
||||
return new Observable(observer => {
|
||||
if (window.ThreeDeeTouch && window.ThreeDeeTouch.onHomeIconPressed) window.ThreeDeeTouch.onHomeIconPressed = observer.next.bind(observer);
|
||||
else {
|
||||
observer.error('3dTouch plugin is not available.');
|
||||
observer.complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9.
|
||||
|
Loading…
Reference in New Issue
Block a user