diff --git a/mobile/plugins/ios/FEDEOSiriIntents.swift b/mobile/plugins/ios/FEDEOSiriIntents.swift index b625275..18db094 100644 --- a/mobile/plugins/ios/FEDEOSiriIntents.swift +++ b/mobile/plugins/ios/FEDEOSiriIntents.swift @@ -383,19 +383,40 @@ struct FEDEOAppShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: FEDEOCreateTodoIntent(), - phrases: ["Erstelle ein Todo in \(.applicationName)", "Neues Todo in \(.applicationName)"], + phrases: [ + "Erstelle ein Todo in \(.applicationName)", + "Erstelle ein Todo mit \(.applicationName)", + "Neues Todo in \(.applicationName)", + "Neues Todo mit \(.applicationName)", + "Erstelle \(\.$name) als Todo in \(.applicationName)", + "Erstelle \(\.$name) als Todo mit \(.applicationName)", + "Füge \(\.$name) zu meinen Todos in \(.applicationName) hinzu", + ], shortTitle: "Todo erstellen", systemImageName: "checklist" ) AppShortcut( intent: FEDEOListOpenTodosIntent(), - phrases: ["Zeige meine offenen Todos in \(.applicationName)", "Meine Todos in \(.applicationName)"], + phrases: [ + "Zeige meine offenen Todos in \(.applicationName)", + "Zeige meine offenen Todos mit \(.applicationName)", + "Meine Todos in \(.applicationName)", + "Meine Todos bei \(.applicationName)", + "Was sind meine offenen Todos in \(.applicationName)", + ], shortTitle: "Offene Todos", systemImageName: "list.bullet" ) AppShortcut( intent: FEDEOCompleteTodoIntent(), - phrases: ["Erledige ein Todo in \(.applicationName)", "Todo abschließen in \(.applicationName)"], + phrases: [ + "Erledige ein Todo in \(.applicationName)", + "Erledige ein Todo mit \(.applicationName)", + "Todo abschließen in \(.applicationName)", + "Todo abschließen mit \(.applicationName)", + "Erledige \(\.$todo) in \(.applicationName)", + "Schließe \(\.$todo) in \(.applicationName) ab", + ], shortTitle: "Todo erledigen", systemImageName: "checkmark.circle" ) diff --git a/mobile/plugins/with-share-intent-multifile.js b/mobile/plugins/with-share-intent-multifile.js index e6b7694..68fd28e 100644 --- a/mobile/plugins/with-share-intent-multifile.js +++ b/mobile/plugins/with-share-intent-multifile.js @@ -1,6 +1,6 @@ const fs = require('node:fs'); const path = require('node:path'); -const { withXcodeProject } = require('@expo/config-plugins'); +const { withAppDelegate, withInfoPlist, withXcodeProject } = require('@expo/config-plugins'); const SHARE_EXTENSION_DIRECTORY = 'InFEDEOhochladen'; const SIRI_INTENTS_FILE = 'FEDEOSiriIntents.swift'; @@ -13,6 +13,37 @@ function replaceOnce(source, search, replacement, label) { } module.exports = function withShareIntentMultifile(config) { + config = withInfoPlist(config, (modConfig) => { + modConfig.modResults.INAlternativeAppNames = [ + { + INAlternativeAppName: 'Fedeo', + INAlternativeAppNamePronunciationHint: 'Feh-deh-oh', + }, + { + INAlternativeAppName: 'FEDEO Aufgaben', + INAlternativeAppNamePronunciationHint: 'Feh-deh-oh Aufgaben', + }, + ]; + return modConfig; + }); + + config = withAppDelegate(config, (modConfig) => { + let source = modConfig.modResults.contents; + if (!source.includes('import AppIntents')) { + source = source.replace('import Expo\n', 'import AppIntents\nimport Expo\n'); + } + if (!source.includes('FEDEOAppShortcuts.updateAppShortcutParameters()')) { + source = replaceOnce( + source, + ' ) -> Bool {\n', + ' ) -> Bool {\n if #available(iOS 16.0, *) {\n FEDEOAppShortcuts.updateAppShortcutParameters()\n }\n', + 'die Siri-Shortcut-Aktualisierung im AppDelegate' + ); + } + modConfig.modResults.contents = source; + return modConfig; + }); + return withXcodeProject(config, async (modConfig) => { const siriTemplatePath = path.join(__dirname, 'ios', SIRI_INTENTS_FILE); const siriDestinationPath = path.join(modConfig.modRequest.platformProjectRoot, 'FEDEO', SIRI_INTENTS_FILE);