Skip to content

Commit

Permalink
refactor(three-dee-touch): Replace onHomeIconPressed with registerQui…
Browse files Browse the repository at this point in the history
…ckActionListener (#4829)

* refactor(three-dee-touch): Replace onHomeIconPressed with registerQuickActionListener

* fix: install option

* remove install
  • Loading branch information
MaximBelov authored Oct 13, 2024
1 parent 50287d1 commit 8fc3465
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/@awesome-cordova-plugins/plugins/three-dee-touch/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaFunctionOverride, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';
import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';
import { Observable } from 'rxjs';

export interface ThreeDeeTouchQuickAction {
/**
* Type that can be used in the onHomeIconPressed callback
* Type that can be used in the registerQuickActionListener callback
*/
type?: string;

Expand Down Expand Up @@ -105,7 +105,7 @@ export interface ThreeDeeTouchForceTouch {
*
* this.threeDeeTouch.configureQuickActions(actions);
*
* this.threeDeeTouch.onHomeIconPressed().subscribe(
* this.threeDeeTouch.registerQuickActionListener().subscribe(
* (payload) => {
* // returns an object that is the button you presed
* console.log('Pressed the ${payload.title} button')
Expand All @@ -120,9 +120,9 @@ export interface ThreeDeeTouchForceTouch {
*/
@Plugin({
pluginName: 'ThreeDeeTouch',
plugin: 'cordova-plugin-3dtouch',
plugin: '@herdwatch/cordova-plugin-3dtouch',
pluginRef: 'ThreeDeeTouch',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
repo: 'https://github.com/herdwatch-apps/cordova-plugin-3dtouch',
platforms: ['iOS'],
})
@Injectable()
Expand Down Expand Up @@ -169,8 +169,10 @@ export class ThreeDeeTouch extends AwesomeCordovaNativePlugin {
*
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
*/
@CordovaFunctionOverride()
onHomeIconPressed(): Observable<any> {
@Cordova({
observable: true,
})
registerQuickActionListener(): Observable<ThreeDeeTouchQuickAction> {
return;
}

Expand Down

0 comments on commit 8fc3465

Please sign in to comment.