Giter VIP home page Giter VIP logo

mouselangelo / react-native-actions-shortcuts Goto Github PK

View Code? Open in Web Editor NEW
122.0 3.0 22.0 4.56 MB

iOS Home screen Quick Actions & Android App Shortcuts for react-native

License: MIT License

Kotlin 30.11% JavaScript 3.64% Java 16.22% TypeScript 14.11% Swift 13.82% Ruby 10.73% C 0.26% Objective-C 11.11%
react-native ios android quick-actions app-shortcuts home-screen actions uiapplicationshortcutitem shortcut shortcuts

react-native-actions-shortcuts's People

Contributors

dependabot[bot] avatar michaelknoch avatar mouselangelo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-actions-shortcuts's Issues

[Fixed] NativeEventEmitter

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

iOS setup

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.

Android crashes

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?

iOS pod install failure

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.

The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher

During build I got this error.

  • What went wrong:
    The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
    The following dependencies do not satisfy the required version:
    project ':react-native-actions-shortcuts' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.