mouselangelo / react-native-actions-shortcuts Goto Github PK
View Code? Open in Web Editor NEWiOS Home screen Quick Actions & Android App Shortcuts for react-native
License: MIT License
iOS Home screen Quick Actions & Android App Shortcuts for react-native
License: MIT License
addListener and removeListeners is not necessary for this lib's functionality, React will generate a NativeEventEmitter warning on Android anyway, the following patch-package fixes this error on 1.0.1:
diff --git a/node_modules/react-native-actions-shortcuts/android/src/main/java/com/reactnativeshortcuts/ShortcutsModule.kt b/node_modules/react-native-actions-shortcuts/android/src/main/java/com/reactnativeshortcuts/ShortcutsModule.kt
index ec847cc..cc2658c 100644
--- a/node_modules/react-native-actions-shortcuts/android/src/main/java/com/reactnativeshortcuts/ShortcutsModule.kt
+++ b/node_modules/react-native-actions-shortcuts/android/src/main/java/com/reactnativeshortcuts/ShortcutsModule.kt
@@ -145,6 +145,14 @@ class ShortcutsModule(reactContext: ReactApplicationContext) :
fun isSupported(): Boolean {
return Build.VERSION.SDK_INT >= 25
}
+
+ @ReactMethod
+ fun addListener(eventName: String?) {
+ }
+
+ @ReactMethod
+ fun removeListeners(count: Int?) {
+ }
}
object NotSupportedException: Throwable("Feature not supported, requires version 25 or above")
\ No newline at end of file
I have no problem, but I just want to say the Readme is introduced to simple, which can be better.
I'm still having difficulty getting iOS to work, but one speedbump I had has an error as I was trying to build to the app, that it wasn't understanding "RNShortcuts" in AppDelegate.m. When I added:
#import "RNShortcuts.h"
to the top of that file, it now at least builds. I don't know if that was an oversight, something that is just assumed, or if I'm way off base. I don't know - I don't do objective-C so I had to figure it out.
Hellow!
Thank you for developing this.
On android im getting a couple crashes a day with the following
Fatal Exception: java.lang.RuntimeException: Could not invoke RNShortcuts.setShortcuts
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:203)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:761)
Any idea what it could be?
Getting failure message in pod install
step
[!] Unable to determine Swift version for the following pods:
react-native-actions-shortcuts
does not specify a Swift version and none of the targets (frontend_mobile_app
and frontend_mobile_appTests
) integrating it have the SWIFT_VERSION
attribute set. Please contact the author or set the SWIFT_VERSION
attribute in at least one of the targets that integrate this pod.IOS onShortcutItemPressed can not work
During build I got this error.
react-native info:
System:
OS: macOS 12.6
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 87.76 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.13.0 - /var/folders/vt/__9hn07s4rdc0y4931b2xm8w0000gq/T/yarn--1674664284331-0.638874913997588/node
Yarn: 1.22.17 - /var/folders/vt/__9hn07s4rdc0y4931b2xm8w0000gq/T/yarn--1674664284331-0.638874913997588/yarn
npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
Watchman: 2023.01.09.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 23, 25, 27, 28, 29, 30, 31
Build Tools: 27.0.3, 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0
System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-31 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.6 => 0.70.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.