React Native JS concern - javascript

I am new to react-native world. Following few tutorials, I found that it react-native app runs on javascript engine on mobile. I am following ios tutorial. So when I go to localhost:8081/index.ios.bundle it loads JS for the app. I know I can use ngrok to manipulate this URL.
I have multiple concerns with this:-
If I change the URL of js from something local to something remote, this would result in a completely new app and now I don't need to go through the App Store to upgrade my app version. Can this be a potential issue in the future?
Since anybody can open this JS in a browser which might have important information like client id and secret for the app, can this be an issue as well?

I am not 100% sure. You can indeed update hybrid app easier and if it is only a quick fix you don't need to go through apple store verification process. Apple can also delete your app and ban you if you don't follow guidelines. Usually your js is local in production for instant app start time, and the network is used only for fresh data.
This is solved with an authentication mechanism.

Related

How do I use universal links with Expo?

We have the server set up and configured to return certain paths under /.well-known/apple-app-site-association. When we publish our app, the "associatedDomains" key in our app.json instructs iOS to give us a chance to open links in app.
That all, more or less, works. What we can't figure out is how to productively test universal links during local development. The expo app won't have our app.json and its a horrendous flow to make an independent build for this purpose (we lose hot reloading and frankly it just doesn't seem to work regardless)
This wouldn't be the end of the world if our product didn't require opening a link in email to log in, but it does and that requirement isn't going anywhere.
Expo does not support Universal links in development. They can only be tested in production and standalone builds. One work around for this is to use something like branch.io to conditionally send the user to a different url depending on the device they are using.

Web application is not loading after redeployment

I have the following situation:
I have a react web application that is deployed on an NGINX web server via Jenkins. In some cases, my web application does not show up in the browser after I deployed a new version of the application. When you open the web application, it only shows a text: "Loading...".
A quick solution to this problem is to delete your browser data and refresh the web application.
My question: What is the possible cause for this problem or how can I find out what the cause is? I don't want that the users of this application have to delete their browser data when I deploy a new version.
From my experience, It could be because of several reasons:
1) The javascript could be breaking.
2) You might be using some caching strategy that causes the javascript to be cached. Service worker for example.
3) Problem with your react router configuration.
4) A network call might be taking too long to respond.
Need a minimum reproducible example to debug further.

How can I share a cookie from my website to a React Native app?

I'm trying to implement a form of deferred deep linking where a user follows a Universal Link and gets sent to my web site because they do not have the app installed. What I want to do is the following, but I am unsure how to do it:
When they land on the web site, I will create a cookie with information pertinent to how they got there.
I will then direct them to the App Store to install the app.
When they install the app and open it, I should be able to read the previously created cookies to figure out where to direct them in the app.
Step 1 and 2 are easy, but I'm not sure how to read cookies from Safari on iOS and Chrome on Android (presumably no other browser would even be possible) from React Native.

iOS native app upgrade to hybrid app

I have a native app version 1.0 in iOS and now the client wants the next version to be a hybrid app using html5 and javascript. If i build the hybrid app, can the native app users upgrade to the hybrid app? Will there be any difficulties, issues in doing so? Im using corodova for building the hybrid app.
There’s two things: the app itself, and data.
There won’t be any problems upgrading the app itself: users just get a new version from the app store, and that’s it. The old code is removed, new code is installed, and users can run it just fine.
The data is another matter. If you have any data stored on the device by the native app, the hybrid app likely won’t be able to access it out of the box, unless you code some sort of migration. So just think about how this will work. If your data happens to live in the cloud, you can just re-download everything. If you store the access credentials in Keychain and the app ID doesn’t change, it’s likely that the new hybrid app can use the same credentials that the old app stored.
So, in summary, upgrading the app executable won’t have any problems, but you have to think about data.

Meteor.js deploy for web and mobile native app, one code-base

So this maybe a silly question, but i guess I'm missing something.
I host my meteor app in modulus.com.
The goal is to have a single code-base for all devices and the web, fetching from the same database.
So everything happens in the web is immediately synced with the mobile app or vice versa.
Should i provide different builds (different modulus projects [web, ios, android]) all connected to the same db to make it all work as one application?
A single build will do?
How will this work?
thanks
Yes, you can use the --server option to specify which Meteor server your built mobile app should point to. This way, you have one Meteor backend running the web app, Android app, and iOS app. This should work just fine with Modulus.

Categories

Resources