mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-02 23:32:58 +08:00
fix(geofence): remove duplicate onTransitionReceived method
This commit is contained in:
parent
79f88d6a02
commit
00c0707dad
@ -85,7 +85,7 @@ declare const window: any;
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class Geofence extends IonicNativePlugin {
|
export class Geofence extends IonicNativePlugin {
|
||||||
|
|
||||||
public TransitionType = {
|
TransitionType = {
|
||||||
ENTER: 1,
|
ENTER: 1,
|
||||||
EXIT: 2,
|
EXIT: 2,
|
||||||
BOTH: 3
|
BOTH: 3
|
||||||
@ -96,7 +96,7 @@ export class Geofence extends IonicNativePlugin {
|
|||||||
* @return {Observable<any>}
|
* @return {Observable<any>}
|
||||||
*/
|
*/
|
||||||
@CordovaFunctionOverride()
|
@CordovaFunctionOverride()
|
||||||
onTrasitionReceived(): Observable<any> { return; };
|
onTransitionReceived(): Observable<any> { return; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
|
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
|
||||||
@ -139,20 +139,6 @@ export class Geofence extends IonicNativePlugin {
|
|||||||
@Cordova()
|
@Cordova()
|
||||||
getWatched(): Promise<string> { return; };
|
getWatched(): Promise<string> { return; };
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a geofence is crossed in the direction specified by `TransitType`.
|
|
||||||
*
|
|
||||||
* @returns {Observable<any>}
|
|
||||||
*/
|
|
||||||
onTransitionReceived(): Observable<any> {
|
|
||||||
|
|
||||||
return new Observable<any>((observer) => {
|
|
||||||
window && window.geofence && (window.geofence.onTransitionReceived = observer.next.bind(observer));
|
|
||||||
return () => window.geofence.onTransitionReceived = () => { };
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the user clicks a geofence notification. iOS and Android only.
|
* Called when the user clicks a geofence notification. iOS and Android only.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user