Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

method to retrieve all shortcuts created by the Cordova app #10

Open
beaudry12087 opened this issue Nov 27, 2018 · 2 comments
Open

method to retrieve all shortcuts created by the Cordova app #10

beaudry12087 opened this issue Nov 27, 2018 · 2 comments

Comments

@beaudry12087
Copy link

There is an API to donate, present, and remove shortcuts but It will be pretty useful to have a method to retrieve all the shortcuts created by the Cordova app. This will be very useful as it will allow solving an issue like this one #9 without the need to change the existing APIs.

@levieu
Copy link

levieu commented Dec 14, 2018

Hi,
in my fork i have add un api to retrieve all shortcuts. The api is getAll and the success callback returns an array of key-value object containing: { persistentIdentifier: string; invocationPhrase: string; }.
In ionic app you must extends the SiriShortcuts plugin and add the method getAll. Moreover, you must add this class in list of providers in the app.module file.
Below an example:
import { Injectable } from '@angular/core';
import { SiriShortcuts } from '@ionic-native/siri-shortcuts';
import { Cordova } from '@ionic-native/core';
export interface SiriShortcutSaved {
persistentIdentifier: string;
invocationPhrase: string;
}
@Injectable()
export class SiriShortcutsExtends extends SiriShortcuts {
/**
* Get all shortcut saved
* @return Promise<SiriShortcutSaved[]>
*/
@Cordova()
getAll(): Promise<SiriShortcutSaved[]> {
return;
}
}

@beaudry12087
Copy link
Author

@levieu Thank you. This is amazing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants