Siri Shortcuts
This plugin only works when your app is built with XCode 10. Shortcuts will only appear on iOS-versions >= 12.0
This plugin enables the use of Siri shortcuts in Cordova. Siri Shortcuts enable the user to perform certain actions by adding them to Siri.
After you have donated a shortcut to Siri, it will appear in the settings menu, after which the user is able to add the action. You can check
whether the user launched your app through a shortcut by calling
getActivatedShortcut()
when the app is resumed. It will return
null
if it has not been launched by Siri, and if it did, it will return an object with
SiriShortcut
properties.
Cordovaの問題で困っていますか?

本格的なプロジェクトを構築している場合、トラブルシューティングに時間を費やす余裕はありません。Ionicのエキスパートが、保守、サポート、統合に関する公式サポートを提供しています。
インストール
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、 エンタープライズプラグインに興味があれば 連絡ください
サポートしているプラットフォーム
- iOS
利用方法
React
Angular
import { SiriShortcuts } from '@ionic-native/siri-shortcuts/ngx';
constructor(private siriShortcuts: SiriShortcuts) { }
...
this.siriShortcuts.donate({
persistentIdentifier: 'open-my-app',
title: 'Open my app',
suggestedInvocationPhrase: 'Open my app',
userInfo: { username: 'username' },
isEligibleForSearch: true,
isEligibleForPrediction: true,
})
.then(() => console.log('Shortcut donated.'))
.catch((error: any) => console.error(error));
this.siriShortcuts.present({
persistentIdentifier: 'open-my-app',
title: 'Open my app',
suggestedInvocationPhrase: 'Open my app',
userInfo: { username: 'username' },
})
.then(() => console.log('Shortcut added.'))
.catch((error: any) => console.error(error));
this.siriShortcuts.remove('open-my-app')
.then(() => console.log('Shortcut removed.'))
.catch((error: any) => console.error(error));
this.siriShortcuts.removeAll()
.then(() => console.log('All shortcuts removed removed.'))
.catch((error: any) => console.error(error));
this.siriShortcuts.getActivatedShortcut()
.then((data: SiriShortcut|null) => console.log(data))
.catch((error: any) => console.error(error));