react-native-actions-shortcuts
react-native-actions-shortcuts copied to clipboard
add-symbol-name-for-ios
Hi @mouselangelo can you please merge this PR and publish new release?
@mouselangelo I'm also wanting to implement this. Is this planned to be added soon?
Hi @kierancrown! We are waiting for the merge of the PR! @mouselangelo 🙏🏻
Hi @kierancrown! We are waiting for the merge of the PR! @mouselangelo 🙏🏻
Awesome. I've created a patch file for now (for anyone else who needs this in the meantime)
diff --git a/node_modules/react-native-actions-shortcuts/ios/Shortcuts.swift b/node_modules/react-native-actions-shortcuts/ios/Shortcuts.swift
index ad77cd9..827d999 100644
--- a/node_modules/react-native-actions-shortcuts/ios/Shortcuts.swift
+++ b/node_modules/react-native-actions-shortcuts/ios/Shortcuts.swift
@@ -96,7 +96,7 @@ fileprivate extension UIApplicationShortcutItem {
}
let subtitle = value["subtitle"] as? String
- let icon = UIApplicationShortcutIcon.from(value["iconName"] as? String)
+ let icon = UIApplicationShortcutIcon.from(value)
let userInfo = value["data"] as? [String: NSSecureCoding]
return UIApplicationShortcutItem(
@@ -110,10 +110,13 @@ fileprivate extension UIApplicationShortcutItem {
}
fileprivate extension UIApplicationShortcutIcon {
- static func from(_ imageName: String?) -> UIApplicationShortcutIcon? {
- guard let imageName = imageName else {
- return nil
+ static func from(_ value: [String: Any]) -> UIApplicationShortcutIcon? {
+ guard let symbolName = value["symbolName"] as? String else {
+ guard let imageName = value["iconName"] as? String else {
+ return nil
+ }
+ return UIApplicationShortcutIcon(templateImageName: imageName)
}
- return UIApplicationShortcutIcon(templateImageName: imageName)
+ return UIApplicationShortcutIcon(systemImageName: symbolName)
}
}
\ No newline at end of file
diff --git a/node_modules/react-native-actions-shortcuts/lib/typescript/src/index.d.ts b/node_modules/react-native-actions-shortcuts/lib/typescript/src/index.d.ts
index 73e6b03..3856510 100644
--- a/node_modules/react-native-actions-shortcuts/lib/typescript/src/index.d.ts
+++ b/node_modules/react-native-actions-shortcuts/lib/typescript/src/index.d.ts
@@ -22,6 +22,10 @@ export interface ShortcutItem {
* The name of the iOS Asset or Android drawable
*/
iconName?: string;
+ /**
+ * The name of the iOS SF Symbol
+ */
+ symbolName?: string;
/**
* Custom payload for the action
*/
diff --git a/node_modules/react-native-actions-shortcuts/src/index.tsx b/node_modules/react-native-actions-shortcuts/src/index.tsx
index e0d0e46..2bf4ec2 100644
--- a/node_modules/react-native-actions-shortcuts/src/index.tsx
+++ b/node_modules/react-native-actions-shortcuts/src/index.tsx
@@ -28,6 +28,11 @@ export interface ShortcutItem {
*/
iconName?: string;
+ /**
+ * The name of the iOS SF Symbol Name
+ */
+ symbolName?: string;
+
/**
* Custom payload for the action
*/
@mouselangelo please :)