Is it possible to use code push when native code has changed? - code-push

If I add a package that requires changes in the native code, like MainActivity for android, is it still possible to use codepush to update the app?

I don't think that's possible, since code-push runtime on the device can only replace the javascript part and not the native parts.

Related

React Native compiling for Android -Beginner

I am a newbie to react native.
1.) I need to know if I can create a react native application and import it to Xcode, then add code in swift?
2.) I also need to know if the components I developed with swift can be compiled and run as a Android application?
Yes you can definitely do this, it's pretty common.
No, that swift code will not run on android
To help understand this, all UI code written in React Native is translated into corresponding native languages, everything else stays as Javascript.
Your Swift code cannot be translated back into Javascript that can then run on Android and certainly cannot be translated into Java.

How can I do Signature Capture in React Native?

I'm trying to understand how I can do a signature capture in React Native. My App is created with create-react-native-app and Expo and I'd prefer to not have to eject the app to get this functionality to work.
Would it be possible to wrap something like this in a webview? https://github.com/szimek/signature_pad
I've also looked at this project, https://github.com/RepairShopr/react-native-signature-capture but it requires me to eject the app and use react-native link.
Looking for any advice or suggestions on how to implement this feature while keeping my project as straightforward as possible (ideally, using create-react-native-app, but if this isn't possible could someone please explain to me why?)
The way React Native works is that each component available in React Native maps to a native component in the underlying platform.
ie. a <Image /> is an ImageView in Android and a UIImageView.h in iOS.
The Javascript code itself runs in a Javascript thread on each platform and as you use Components in React Native, there's a translation layer that passes information from JS into the React Native bridge that then results in corresponding native components being created.
By default, React Native has included the following components: https://facebook.github.io/react-native/docs/components-and-apis.html#basic-components which means that only those components come out-of-the-box in React Native. If you want other components, then you have 2 options, either create a "composite" component in which your JS component is written into other JS components or, if your feature needs a native component not yet exposed by React Native, write your own "native" component to expose certain native functionality to your React Native code.
The way Expo works is that they have wrapped React Native and a handful of 3rd party components and built it within their application. The reason why you can't use a 3rd party native component they don't support is because when that component is used, the app itself doesn't have translation code to go from JS to a native Android/iOS view.
So, to do what you're asking, you'd need to find either a "native" drawing component that Expo has included in their platform/app. OR you need to find a "composite" drawing component that is built with other default React Native components (or other components Expo supports).
ie. On Android, I might build this with a Canvas view, but from what I can tell React Native doesn't support that object natively, so I would probably write this myself, etc.
It's hard for Expo to support every 3rd party "native" component out there because React Native is open source and it iterates so fast that most community-built components aren't always up to date or they might conflict with one another.
I am using react-native-signature-capture.
Working properly on both Android and iOS.
I know it's been a while, but there is an interesting article here: https://blog.expo.io/drawing-signatures-with-expo-25d1629ca1ac
Wait, but how?
Using “expo-pixi”, you can add a component that lets you choose your brush’s color, thickness, and opacity. Then when your user lifts her finger, you get a callback. From there you can take a screenshot of the transparent view or get the raw point data if that’s what you’re looking for.

codepush react native new package

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.

Using React Native to run JavaScript code from an existing native app without having to display a component

The official documentation for React Native explains how to add React Native views to existing native applications. However, it does not explain how to run React Native code written in JavaScript from a native application, without having to display any React Native component. Does the framework provide a way to do this?
I think reason being, R-N works on top of Native components and not other way round. I have not come across anything that you are looking.

How do I run a native code in corodova

Is it possible that I can embed some native code with cordova ?
i.e In native application I can Intercept some javascript in webview and run native code
Is it possible in corodova ?
As far as I know it's not possible.Is there any plugin ? or something like that.
Yes it is possible.
Please refer here
http://docs.phonegap.com/tutorials/develop/1-embed-webview/ios/