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

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

* fix: install option

* remove install
This commit is contained in:
Maxim Belov 2024-10-13 17:44:04 +03:00 committed by GitHub
parent 50287d1f5a
commit 8fc3465ed5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,10 +1,10 @@
import { Injectable } from '@angular/core'; 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'; import { Observable } from 'rxjs';
export interface ThreeDeeTouchQuickAction { export interface ThreeDeeTouchQuickAction {
/** /**
* Type that can be used in the onHomeIconPressed callback * Type that can be used in the registerQuickActionListener callback
*/ */
type?: string; type?: string;
@ -105,7 +105,7 @@ export interface ThreeDeeTouchForceTouch {
* *
* this.threeDeeTouch.configureQuickActions(actions); * this.threeDeeTouch.configureQuickActions(actions);
* *
* this.threeDeeTouch.onHomeIconPressed().subscribe( * this.threeDeeTouch.registerQuickActionListener().subscribe(
* (payload) => { * (payload) => {
* // returns an object that is the button you presed * // returns an object that is the button you presed
* console.log('Pressed the ${payload.title} button') * console.log('Pressed the ${payload.title} button')
@ -120,9 +120,9 @@ export interface ThreeDeeTouchForceTouch {
*/ */
@Plugin({ @Plugin({
pluginName: 'ThreeDeeTouch', pluginName: 'ThreeDeeTouch',
plugin: 'cordova-plugin-3dtouch', plugin: '@herdwatch/cordova-plugin-3dtouch',
pluginRef: 'ThreeDeeTouch', pluginRef: 'ThreeDeeTouch',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch', repo: 'https://github.com/herdwatch-apps/cordova-plugin-3dtouch',
platforms: ['iOS'], platforms: ['iOS'],
}) })
@Injectable() @Injectable()
@ -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 * @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
*/ */
@CordovaFunctionOverride() @Cordova({
onHomeIconPressed(): Observable<any> { observable: true,
})
registerQuickActionListener(): Observable<ThreeDeeTouchQuickAction> {
return; return;
} }