mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 09:01:07 +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 {Plugin, Cordova} from './plugin';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
declare var window: any;
|
||||||
/**
|
/**
|
||||||
* @name 3DTouch
|
* @name 3DTouch
|
||||||
* @description
|
* @description
|
||||||
@ -85,7 +86,15 @@ export class ThreeDeeTouch {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
observable: true
|
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.
|
* UIWebView and WKWebView (the webviews powering Cordova apps) don't allow the fancy new link preview feature of iOS9.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user