Questions tagged [native-module]

84 questions
10
votes
3 answers

React Native Get battery status / level Using Native Modules

I am writing a react native app to get IOS and Android Battery status. I search through the net and found few libraries which can get battery level of the phone. https://github.com/robinpowered/react-native-device-battery…
8
votes
1 answer

React Native: How to invoke native Android layout from module?

Regarding this question, I've been trying to get this done via native modules in Android. I've declared my Module at .../java/com/myproject/multiplecamerastream following the example at React Native ToastModule (functionality here is not…
7
votes
2 answers

React native Wifi list

Is there a way to scan and all get Wifi list using react native for Android and iOS. I have seen a few libraries but mostly for android and even those doesnt work properly. Any suggestions? If I need to write Native Modules can you point me to…
Vinay
  • 311
  • 4
  • 9
6
votes
1 answer

Do we need to run `pod install` with React Native 0.60?

I'm using React Native 0.60.5 and am linking this module. It says that for React Native 0.60+, "CLI autolink feature links the module while building the app", so all we need to run is yarn add @react-native-community/async-storage. However, on the…
6
votes
1 answer

React-Native: Error trying to get in touch with native module in the tutorial

Having issue with defining a native module from the tutorial in https://facebook.github.io/react-native/docs/native-modules-ios.html. #import "CalendarManager.h" #import @implementation…
LittleFunny
  • 7,205
  • 11
  • 71
  • 166
6
votes
2 answers

I can't see any iOS Native Module in JS

I have some experience with React but I'm new to React Native. I've played around for a while, but I got stuck when I tried to write a basic native module for iOS. I've tried with both Swift and Objective C. (I have some basic experience with Swift,…
charlietango
  • 318
  • 1
  • 9
6
votes
2 answers

"undefined is not a function" when create android native module in ReactNative

I'm following ReactNative Native Module Guide to write the java class that can be used in JS side. The exported method is show from class ToastModule(exported as ToastAndroid). The show method is below: public void show(String message, int duration)…
Johnson
  • 423
  • 3
  • 12
5
votes
0 answers

Catch c++ native addon cout/console messages in electron.js or node.js app

C++ native module's std::cout console message don't get printed on console once module gets build. Is there any way to print runtime std::cout messages on console AND then we can catch those messages in electron app using node.js How does…
xyz xyz
  • 754
  • 4
  • 15
5
votes
5 answers

typeError: null is not an object while accessing the Native Module

I am working on one React Native Application and trying to access the Native Module from the android. I am following this official documentation enter link description here After creating the Native Module, when I try to access it in the javaScript…
5
votes
1 answer

Call JavaScript function from native code

I have a react-native app and want to integrate it with native SDK. At some point I need to call js function which will return me data, and this call I should make from native side. Here is the flow: some iOS handler require more info native layer…
Alexei Malashkevich
  • 1,120
  • 1
  • 12
  • 30
4
votes
1 answer

how to pass a react component as a native view property

I'm trying to build a react-native application with a some native UI components and some React components. I want a native ui component which takes a react component as a property, and renders it as a subview. I went through the normal process of…
4
votes
2 answers

How do I return an array from a Java module in a React Native Component?

I'm writing this to answer my own question because the docs don't explicitly state this and I couldn't find it on stack overflow or anywhere else. Here is how to return a String array from a Java module back into a React Native Component (simplified…
S. Pan
  • 529
  • 6
  • 13
4
votes
1 answer

ReactNative native-modules Promise passing field and in Swift

I'm trying to run a promise in React Native using Swift and passing one field (array). This is the code that i have: GuidedTourInterfaceBridge.m @interface RCT_EXTERN_MODULE(GuidedTourInterface, NSObject) RCT_EXTERN_METHOD(readFile(_ arr:…
Tiago Mendes
  • 2,556
  • 1
  • 26
  • 29
4
votes
2 answers

how do I pass image data to a native module in React Native?

In my class that implements the RCTBridgeModule protocol in Xcode, I am trying to write an RCT_EXPORT_MEATHOD that I can expose to React Native code to consume image data. Currently, I can write an image to disk in React Native, and then pass the…
nwales
  • 3,301
  • 2
  • 20
  • 42
4
votes
0 answers

React native: plug-in for audio recorder on Android

Is there any available plugin for recording audio? Searching on google but no luck. Thanks, Huy
1
2 3 4 5 6