How to integrate React Native KeyEvent with Expo? - javascript

I am looking for a way to get input data from device's hardware barcode scanner. I found a library that reportedly can get the job done, which is React Native KeyEvent.
However, the instructions mostly lead me to edit the gradle files inside android folder. Since I am using Expo, I do not have the android folder to follow the document.
Without Ejecting to ExpoKit, is there any other way to integrate them?

You would need to write an expo plugin for it. Fortunately, somebody seems to already have done just that. See:
expo plugin for react-native-keyevent

Related

How to handle live updates to your mobile app using capacitor?

I have a react-js app and I use capacitor to leverage with native mobile API's (eg: BLE). My objective is to live update the app upon a minor change (eg: adding a new label) without going through the whole appstore submission process. I know Ionic has AppFlow that could work well with Capacitor, but it is way too expensive for me. Thus, I saw some are suggesting writing a script that pulls in the JS perfectly from somewhere like the S3 bucket, and when you build the app you build in all of the native code and replace the HTML scripts with one that comes from a remote source (But I have no idea how to do it)
Is this how most people handle live-updating webview apps or is there a better way ?
If so what are the steps to achieve this objective using scripts and so on (with code examples)?
Hey I'm the Maker of Capacitor-updater, the only alternative to ionic AppFlow.
The updater allows you to manage update by yourself, store your zip update where you want and use the download method.
How to start
npm install #capgo/capacitor-updater
npx cap sync
Then in your main JS, this is required to let the updater know the update is valid
import { CapacitorUpdater } from '#capgo/capacitor-updater'
CapacitorUpdater.notifyAppReady()
And lately after checking yourself the current version need update:
const version = await CapacitorUpdater.download({
url: 'https://github.com/Cap-go/demo-app/releases/download/0.0.4/dist.zip',
})
await CapacitorUpdater.set(version); // sets the new version, and reloads the app
After many request of people didn't want to do that themselves, I started Capgo a business to manage all the update process for you.
All is open source and can be replicate on your own as well.
Doing things for Capacitor is now my main activity, I produce open-source plugin as my main channel of Marketing, I'm solo founder and bootstrapped.
Hope my tool will help you !
You need a subscription to Ionic's AppFlow, as of yet ionic is the only company that offers live updates.

How to turn my javascript/React Native based app into .ipa for deployment?

I currently have a starter app that is very basic but I am trying to upload it to test flight to test so that I can later upload new versions of my companies app. I currently have your basic react native app using javascript.
I'm going to attempt to upload it to transporter and then upload that to test flight. I'm having trouble converting my folder with the app in it to the required format (.ipa or .pkg). Every tutorial I've seen uses xcode but I am writing my program in vs code with javascript. How should I go about this? I can't find any resources but I may be looking in the wrong places, thanks.
The tutorials aren't using Xcode because it's their favorite IDE, they're using it because you must use Xcode to create any iOS build artifacts.
It's fine to use VS Code for writing code, but everything has to go through Xcode eventually. Make sure you've gone through all the iOS setup.

How do I turn on live reloading(using an express server) for frontend development?

I'm using Express as the server and nodemon to reload that server on file changes. Works perfectly. But when I make a frontend change (i.e changing an html page or css, javascript, anything basically) I have to reload the browser manually. If you're like me, that isn't ok. I know of the vscode extension "Live Server", but I want it all to be in that one express server. I tried using the live-reload npm package, the app and the browser extension, but that didn't work out for me. I really don't want to have to start to use something like webpack just so I'm saved the effort of pressing Ctrl+R a couple times. Any recommendations? I still haven't learned React but I've heard that if you use React, then you'll have that live reloading feature. I'm actually currently developing a typescript website template, so that's what I want to use it for.
From what you've said and after a little searching maybe samuelgjabel/nodejs-hot-reload is what you're looking for?
It supports typescript and where you don't want to roll your own / learn webpack at the moment, this seems like it would keep things simple.
*disclaimer - I haven't used the library myself and cannot attest to it's security or quality.
update:
Regarding your comment response, My mistake I misunderstood.
This library works on the front-end providing the auto (CTRL-R) you're looking for. try this guide for connect-livereload
It seems to hook into express' connection event to signal the browser for a reload after nodemon has respawned the server instace. The guide shows how to implement it without a build tool like gulp/grunt.

Nativescript core OCR plugin

I'm trying to develop an ocr app with the Nativescript plugin:
https://market.nativescript.org/plugins/nativescript-ocr
https://github.com/EddyVerbruggen/nativescript-ocr
and it seems that the example doesn't works or I'm doing something wrong. I read something about Firebase ML kit but I have no idea about that and if it works offline (Offline work is a must for me).
https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/docs/ML_KIT.md
Could be deprecated the first plugin?
might I use firebase?
could it use with nativescript core (only js)?
It works offline?
Any idea about how to start?
Yes, the OCR plugin is kind of deprecated, not actively maintained anymore.
Firebase ML-Kit is recommended and it has different methods you could use for text recognition, one works on device and another on cloud. Refer the same read me you have linked in your question.

KISSmetrics - React Native iOS

I am using React native to create an iOS app; So my code is in javascript and some objective-c.
Now i wan't to implement KISSmetrics in my project, i have done the proper setup based on kissmetrics documentation, but when it comes to create events and user identifications etc… i have to use data from my javascript code.
Does anyone knows how to do that? for example:
the objective-c code to identify the user is this: [[KISSmetricsAPI sharedAPI] identify:#"name#email.com"]; but how can i get the code that gets the identity of the user and replace the name#email.com from my javascript code?
I would look here to find out how to build a native module bridge. The way it works is that you create an iOS native module with methods that you can actually call from JavaScript by which you can send your data from JS to Obj-C.
Here's an example project that does this:
https://github.com/idehub/react-native-google-analytics-bridge
You don't need to turn it into a full-fledged NPM library, you can just simply create the necessary native files and JS files on the fly in your project.
Also, if you don't know already, remember to rebuild the iOS project (hit the Play button) to see your changes because the native side doesn't have Live Reloading.

Categories