142 questions
2
votes
1
answer
2k
views
React Native - ios Native Module not working
I'm following the example posted in the official doc for native module ios. I've set up everything, build it and run the application.
// CAL.h
#import <React/RCTBridgeModule.h>
@interface ...
0
votes
0
answers
366
views
Reduce time for calling native module methods in react-native application
I implemented a native module which navigates to a camera activity. But while calling the camera from nativeModules, it takes 1500-2000ms to open(excluding ui updation in camera).
The native module ...
1
vote
0
answers
247
views
react native how to import and use pure android sdk in react native project
I wanted to print receipt from react native app my problem is the device is smart pos
so i have this documentation it is explain how to user their SDK in pure android project
https://drive.google.com/...
0
votes
1
answer
2k
views
How to use 3rd party library in react native expo
Im total noob in RN and Expo. I'v generated new project expo init test, then cd test, then npm install --save react-native-ble-plx and started expo by npm start.
In my code I added following lines:
...
1
vote
2
answers
1k
views
Detect when a NativeModule is running in React-native
So I'm using a few different NativeModules in an App (both Android and iOS specific) for playinmg Videos and such. This means that the screen is taken over by Native code eg. Java or Swift and their ...
1
vote
3
answers
2k
views
My custom native module is not present inside NativeModules object
So, i wanted to create a native module which will detect, if the app is running on emulator/simulator or an actual device.
Everything works fine on android, but i'm facing issue on iOS.
I have create ...
1
vote
0
answers
169
views
How can I build a voice assistant for my react native app?
I want to build a voice assistant for my react native app. So that I can say something like "TestApp, Play songs". Any idea on how to approach for this ?
1
vote
0
answers
23
views
"Utils.startApp()" not working in android version 10 & 11
I'm trying to start app from kill state. "Utils.startApp()" this method works perfectly fine in android version 7 or 8 but its not working in 10 & 11.
I think in android 10 or 11 needs ...
10
votes
3
answers
5k
views
Native module in React Native: function returns "undefined"
So, I am practicing making native modules in Java that can have functions exposed to the JavaScript code of React Native. For that, I decided to go for a simple demo math library. My code is as ...
0
votes
1
answer
1k
views
Making React Native iOS Native Module to use Garmin SDK
So I'am trying to implement the Garmin iOS SDK in a native module to connect a Garmin watch to my react native app. I have done all what the docs say for creating a native module and I'am able to ...
0
votes
1
answer
3k
views
Can not add Android Native Module to React Native project
I have a task where I need to add a Native functionality to the React Native project for Android devices.
I have followed this [tutorial][1], which is pretty straight-forward. But unfortunately, I ...
0
votes
1
answer
1k
views
React native RecordScreen Native Module is null
I want to use RecordScreen NativeModule in my react native app.
import {NativeModules} from 'react-native'
console.log(NativeModules) // This is empty {}
console.log(NativeModules.RecordScreen) // ...
3
votes
0
answers
974
views
React Native iOS native module pass parameters
I am writing an NPM library that contains iOS & Android native modules. Important is that I need to pass parameters to the native module before startup. This works great for Android:
package ...
...
1
vote
0
answers
180
views
How to use React Native Package in a TS based library?
I'm creating a custom library for React Native. I initiated the library using react-native-create-library. The library has not any native code. It's just written in typescript. At some places, I need ...
0
votes
1
answer
337
views
Display red screen error in react native from a native module
I implemented a native module and I would like to display an error for a developer using the redbox error screen from the native module. This error will inform about obsolete values.
Does anyone know, ...
8
votes
0
answers
1k
views
How to track app usage time in React Native?
I want to track user's overall app usage time (other apps) in React Native.
I found android.app.usage that tracks exactly what I want.
Is it possible to use 'android.app.usage' in React Native? or Do ...
2
votes
1
answer
507
views
Why is RPBroadcastPickerView rendering a blank white screen?
Ive created a native iOS module for a react-native (v0.61.5) application. all it does is return the native RPBroadcastPickerView. what i expect is the picker view to be displayed, but only a blank ...
3
votes
0
answers
91
views
Only audio audible no video seen while playing media through android media player in react native Native-modules
I am trying to use native modules on react native and I want to play a video that has been prepared(mediaplayer.prepare()) in an android native mediaplayer . The mediaplayer is then added to a surface ...
1
vote
2
answers
1k
views
React Native Navigation: cant click in navigation
I'm trying to use react navigation. But when I click on the button to navigate, nothing happens. I'm new to React Native.
App.js:
function App() {
const Stack = createStackNavigator();
return (
...
1
vote
1
answer
619
views
ReactNative NativeModules using Interface callback not resolving promise
Im trying to use a native Android library that implements Interface callbacks. I have implemented the bridge, and by running this code:
for (const i in payloads) {
console.log("i", ...
1
vote
0
answers
74
views
Create react native module from android activity class
how can create react native module from android activity class , I need android activity in react native as UI module but i cant create module I have to access activity class directly that not good ...
0
votes
1
answer
853
views
How to show progress bar in react native for a long running android native task?
I have a react native app and I'm using an android native module to run a long task. While this task is going on, I would like to show a progress bar in my react native screen while this task is going ...
1
vote
1
answer
180
views
Text String must be rendered within Text Component
I know this question has been asked many times and i have already referred to those but my use case is little different. I need to allow user to draw on an ImageBackground so i created my own native ...
1
vote
0
answers
658
views
Let Android Module know that some permissions are already granted on React-native class
I'm using react-native-permissions package to request some permissions in my app. When I start it , the app shows the modal to accept the requested permissions after that I call a method that requires ...
2
votes
0
answers
887
views
Ios React native Native modules return my module with null
I tried to implement the example of the Native Module for ios, but the module doesn't seem to be registered.
RCTCalendarModule.h
#import <React/RCTBridgeModule.h>
@interface RCTCalendarModule : ...
1
vote
1
answer
253
views
React Native Android Native Module Works Well on Debug but Doesn't Work on Release
I've created an Android Native Module in my React Native App to get User Installed Apps List. it works well on Debug but doesn't work on Release.
*Note : I've also tried to use a npm package called ...
2
votes
0
answers
89
views
How to pass files to native modules and vice versa in react-native?
I want to encrypt/decrypt files in native side using react-native. So I need to pass files such as Images, Videos, docs from javascript side to java code and back from java code to javascript side.
...
1
vote
2
answers
5k
views
Document picker is not working in react native
I am currently facing issue with react native document picker in my react native app .
I attached screenshot for your referenced.
RNDocumentPicker -Native module is not available.
0
votes
1
answer
533
views
React-native Native Modules Official Guide not working
I've tried following this guide 10 times today: https://reactnative.dev/docs/native-modules-android
I just tried on a clean project following the guidelines exactly. No matter what I do I always get
...
1
vote
1
answer
850
views
How to extend RCTEventEmitter while overriding methodQueue getter?
I'm trying to create a React Native native module in Swift that needs to be run on the main thread and which sends events to JS. This works fine (as instructed in RN docs):
@objc(MyModule)
class ...
3
votes
1
answer
3k
views
How to add a thirdparty SDK (multiple .framework files) to react native library module?
I have built a react native library module (with RN 0.63). This module depends on some thirdparty SDKs. When integrated with Android (using .aar files) it works just fine. In case of iOS, I have been ...
3
votes
0
answers
304
views
React Native - Native Modules iOS Empty
I am creating an iOS 14 widget for my app. The part of widget is working, but I want to create an Native integration for updating my widget data.
I started following this tutorial: https://reactnative....
2
votes
0
answers
733
views
React Native CameraRoll File Upload
I am trying to build a custom image gallery that user can select multiple images from it and upload by FormData but on iOS from CameraRoll library it gets ph://SOMETEXT kinda uri which is a "...
8
votes
3
answers
4k
views
Tried to register two views with same name
I know this kind of question has been asked before but they are related to third party libraries, mine is related to requireNativeComponent
I have created a React Native Component from a Native iOS ...
0
votes
1
answer
627
views
Create own dependency in react native for iOS
I'm creating first react-native dependency for both android and iOS. I have done coding part for android but now I'm stuck in iOS. Where to write code for my library and how to test.
2
votes
1
answer
1k
views
React Native metro bundler not connecting after install a native dependency on android
After i add this library to my react native project as a native module, my metro bundler wont connect.
https://github.com/FolioReader/FolioReader-Android
react-native 0.61.5
error image
1
vote
0
answers
343
views
Send custom data types to React Native from Native iOS
I'm writing a Native Module for React Native and need to return a value in a custom data type to React Native. To return a value I use the Promise method like this:
// .swift
@objc
func ...
0
votes
1
answer
591
views
At what point are Native Modules compiled in a React Native app (with Expo)?
Are the underlying Native Modules compiled when they are installed from NPM, or are they compiled when the App is run (i.e. bundled)?
I don't think it's likely that they are compiled when they are ...
1
vote
0
answers
69
views
Using native modules with React native and swift
I'm just getting started with React native and made some code with Swift and my question is, do I need to unlink the project and rebuild everytime i change a piece of code within my swift file ? ...
0
votes
1
answer
371
views
Objective C - Call Method defined from a Macro
I'm trying to call a Method from Objective-C that has been defined using a Macro which wraps a Swift function. I'm getting the compilation error No visible @interface for 'NearbyMessages' declares the ...
3
votes
1
answer
1k
views
Display png image from native module in react native
I have a slider component which I want to have a handle as png image pass as a prop. Now, I want that png image to pass through react native to native modules(android and ios both). The component is ...
3
votes
1
answer
3k
views
method is not a recognised objective c method
Lot of question are asked regarding the same but none of them solve my error.
Here is my objective c file
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
#import <...
1
vote
0
answers
158
views
How do I add an existing library as dependent on my new library? REACT NATIVE
I am creating a new library for React Native and I would like to add an existing library that uses native modules as a dependent (React Native Video) to use my library, but I am not able to do that.
...
2
votes
1
answer
4k
views
React native native modules with swift getting exported method value as undefined?
I am creating native module using create-react-native-module with swift. After that I have followed react native official documentation for iOS setup.
doc link:: https://facebook.github.io/react-...
6
votes
5
answers
9k
views
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 ...
0
votes
2
answers
211
views
React Native Module, Cocoapod file not found
I am building a module for React Native, as a part of this, there is some native iOS code that is wrapped in a cocoapod. I have this working fine, and I can install the cocoapod and see the native ...
0
votes
1
answer
273
views
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 ...
0
votes
1
answer
221
views
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
14
votes
1
answer
81k
views
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-...
1
vote
0
answers
286
views
React-native custom native module couldn't search header search path
I am building a wrapper SDK in react-native. However, I am new to react-native and facing following issues:
I have created a library using react-native-create-library npm package. While compiling iOS ...