codepush react native new package - react-native

I tried react native code push and it works flawlessly. Let's say I modify the text in my buttons to say something else, then with a single command, the update is sent to the users.
Now, lets say I am using a new npm library which requires some native code. Say react-native-image-picker (https://github.com/react-community/react-native-image-picker). Can code push handles this? I want the image picker functionality to be updated too in my users app. Thank you.

No - CodePush can only update JavaScript code and images.
CodePush does not update native code at all so any changes to native code require a full app build and deploy via the relevant app store or app distribution tool (e.g. HockeyApp).
Note: There are some limitations around images - full details here.

Related

How to call react-native function from IOS native module(Plugins)

I want to call react-native function from native module.
I have created one barcode-scanner plugins for my react-native app, barcode-scanner SDK is available in native IOS & Android so, i extract those native code and create one plugins(NPM) for react-native app.
Now my problems is, Once barcode-scanner scan a data and send to native IOS, how can i get those scanning data in my react-native app ?(I got scanned data in IOS native)
I want to call react-native app function once native module scanned a data and send those data in react-native
Please give example or proper document so i can try and implement.
Thanks in advance.
You'll find your answer well described here:
https://facebook.github.io/react-native/docs/communication-ios#passing-properties-from-native-to-react-native
I have used "RCTDeviceEventEmitter" & "NativeEventEmitter" and add listener for received event
more detail

How to read data in background in React Native

I have an app in React Native, that uses the bluetooth connection to read data from external devices.
I need a way to continue to read this data in background when, for example, the user starts a reading session and put the app in background.
What should I use to do this?
My code is divided in two parts:
Scan and Connect
Reading Data from external devices.
You need a background service for this. The following link for Android will help you.
github => react-native-foreground-service
If you want, you can do it yourself as described on the RN official site. But you'll have to write Java code for it.
React Native => Native Module

React Native local Notification by background service of App

I want to show notification when new post available in react native app.
when ever my app open it fetch latest PostID{POSTID is auto increment in online database} and save the latest PostID in Mobile database.
But now if App close it should check in background by fetching after every 15min about new postID and compare it with the saved PostID.
If saved PostID is smaller then received PostID then it should show notification of new post.
you could use react-native-firebase, it encapsulate Local notifications feature since version 4+...
Problem: this version is only compatible with Gradle 3+, which React Native doesn't support yet (RN 0.56 still runs with gradle 2.3.3)
An alternative in the meantime is - react-native-fcm' - they're dropping development in favor of react native firebase, but has the feature you want.
You could even copy/paste the code you need if you don't want the whole 3rd party lib...

White labeling React Native apps

There is some information here already: White labeling an iOS app
I was wondering if there any workflows for white labeling a React Native app?
Basically if I had a core app for the app store. I would like to create white labeled versions (iOS + Android) with some modifications.
I found the project a project called white-label-app in github, I believe you can inspire yourself looking this project closer (and use them as boilerplate).
I'll try to use the majorajs, the idea of this package is "Manage white-label or skinned versions of your React Native app", sounds good for me.
You can use a combination of the React Native Bridge & product-flavors/targets to achieve what you want.
The process is extensive to setup, but once you have it setup it is very easy to add new white labelled apps to it.
I wrote a blog post that goes over every detail if you need a step by step guide.
One approach would be to use Fastlane together with react-native-config to provide values from the environment.
I wrote up a more detailed blog post about it here that explains my approach:
A React Native White Labeling Journey
I'm building the app through the CI which runs my Fastlane script, which parses the unique git tags for each app, building the appropriate app and distributing it to AppStore / GooglePlay.

React Native Dynamically load modules/plugins?

As far as I've searched it appears to be impossible to load modules (=plugins/libraries?) dynamically (I'm very new to React Native..).
What I'd like to accomplish is to let the user of the app load additional functions as she/he desires.
Example:
A user wants to add a music plugin to the app.
Intuitively, I'd long for something like dynamic library loading. The user would fetch the library, it'll be loaded into the code and can then be executed. However, in React Native it seems like there are only modules that can be loaded?
Alternatively, I'd hope that auto-updating the app would allow to add modules "on-the-fly" ( https://github.com/aerofs/react-native-auto-updater or www.npmjs.com/package/react-native-hot-load ). But I fear that this is only for JS and data content?
The ability to dynamically add functionality to the app is an essential part of the app. I have no previous experience worth mentioning in mobile app development.
Question: Is it possible to dynamically add functionality (also native in nature) to React Native apps?
If not, would there be a workaround?
EDIT: I have found the following repository on github: https://github.com/yusefnapora/react-dynamic-linking-example .
Unfortunately, without any description. I have no idea about Objective-C, but the repo name sounds promising. Anybody knows what its purpose is?