Questions tagged [react-native-native-module]
137 questions
0
votes
1 answer
How to mock global variable which holds React Native native module function
In App.js I have some thing like
Class App extends Component {
constructor(props){
super(props)
global.test = NativeModules.TestClass
}
}
And in Test class I am using it like
Class Test extends Component {
constructor(props){
super(props)
…

Shivani Kumar
- 11
- 1
0
votes
1 answer
How to check wifi status on change from Off to on
i want to use service in react-native using native modules ,if Wifi connectivity change from off to on just show toast that connection change

Majid Aziz
- 64
- 10
0
votes
0 answers
React-Native: Render View From Javascript
So I am trying to use AutoCompleteTextView(for android) as a native module in react-native.
I drew inspiration from
https://github.com/nulrich/RCTAutoComplete.
So in the above library the author has defined custom cell for each…

Amol Gupta
- 2,054
- 1
- 14
- 29
0
votes
1 answer
How to mock a React Native native module"in Jest?
I want something like the following (that actually works...):
import { NativeModules } from 'react-native';
import PushNotifications from '../../app/platform/PushNotificationSupport';
const mockRNA =…

codecitrus
- 659
- 6
- 17
0
votes
0 answers
Is there a way to access callback in a function, from an extension of the class?
In react native, I'm using NativeModules and RCTResponseSenderBlock to create a callback. Because the callback is specific to the function I declare in my bridge, I can't access it from the Extension that provides the feedback I need. This is built…

flipyouforreal
- 1
- 1
0
votes
1 answer
React-Native code works without importing Platform module why?
I just added this code on my home/index.js file
if (Platform.OS === 'android') {
Expo.Notifications.createChannelAndroidAsync('chat-messages', {
name: 'Chat messages',
sound: true,
vibrate: [0, 250, 250, 250],
…

Iván E. Sánchez
- 1,183
- 15
- 28
0
votes
1 answer
Importing react native native module JS not working but importing native module from NativeModules does?
When importing a react-native native module. There is an issue when importing the js from the project for example
import RNModule from 'react-native-module';
However importing RNModule using native modules works:
import { NativeModules } from…

814k31
- 55
- 8
0
votes
1 answer
How to package an android native module for React Native
I wrote an android native module for a React Native app. I was wondering how would I package the module for private (i.e. my own apps or send them to someone to try) distribution ?
The module contains 1 native module (ReactContextBaseJavaModule)…

K.A.Q
- 469
- 4
- 13
0
votes
1 answer
Cannot read property 'string' of undefined Trying to understand React Native Native Modules via react-native-create-bridge
I'm currently attempting to do the Ios version of this tutorial.
The tutorial is brief introduction to using native modudles in react-native via react-native-create-bridge
I should see a simple blue box under the text. However, I'm getting the…

VK1
- 1,676
- 4
- 28
- 51
0
votes
1 answer
How to fix missing ReactContextBaseJavaModule symbol?
I wan't to create a custom native module for my app only - so no lib. Following the docs it gives me an error:
import com.facebook.react.bridge.ReactContextBaseJavaModule;
Cannot resolve symbol 'ReactContextBaseJavaModule'
My app's…

martn_st
- 2,576
- 1
- 24
- 30
0
votes
1 answer
Not able to call ios native module from React native project
Hello friends i want to make my plugin in react native and i want to call my ios native module function from my react native js file so below is my code
ios library code as below
@implementation RNMyLib
- (dispatch_queue_t)methodQueue{
return…

Harshal Kalavadiya
- 2,412
- 4
- 38
- 71
0
votes
0 answers
not able to pass arraylist to native module library in react native
Hello friends i want to create library for native module call so below is my code
Mylib is my library project in android
package com.reactlibrary;
import java.util.ArrayList;
public class RNMyLibModule extends ReactContextBaseJavaModule…

Harshal Kalavadiya
- 2,412
- 4
- 38
- 71
0
votes
2 answers
React Native, Android Studio, JDBC, MySql - Access denied for user 'root' @'ipaddress'
I'm developing an android native module in a react native app. I'm using JDBC to directly connect with a mysql database hosted on my pc. My Phone and pc are on same wifi network and as I'm trying to access the db I'm getting the following error.
…

phanom9797
- 43
- 1
- 10
0
votes
1 answer
Which thread am I supposed to use to call uiManager calls inside a react-native native ui component?
I'm building a native UI component for Android that uses a view that extends a ReactRootView.
On the constructor of my view (named SyncRootView) if I check the thread I get Thread curThread = Thread.current(); // main
so we're on the main…

SudoPlz
- 20,996
- 12
- 82
- 123
0
votes
1 answer
Undefined is not an object (evaluating '_reactNativeSpotify.spotify.initialize')
This is the relevant portion of my code (imports, etc. not included)
import Spotify from 'react-native-spotify';
let spotifyOptions = {
"clientID": "69708bf2b35e4cc2b208fafa600ce9a9",
"sessionUserDefaultsKey": "SpotifySession",
…

Shrey Gupta
- 43
- 7