How can I make a React native app offline? [closed] - react-native

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
This post was edited and submitted for review 1 year ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
I have a react native application to answer evaluations with different fields and load images. I need to make than the user can login and answer the evaluations offline and when the device its online, use the Web Services to load the answers automatically.
I am using React Native with Expo and Web Services to get data of forms.
Any idea where to start or how can i do it?

First, you need to check to internet connection, to make sure the device is online or offline. For this, you can use this library #react-native-community/netinfo.
Second, you need to store the question and answer on redux, so when the device is offline, you can load the question from redux. When the device is online, you can load the question from api.
Hope this works for you.

You can use Realm for that, it is a mobile database and here you can manage offline data. If you're using redux then you can also implement redux-persist, but it is a library where the data is saving to redux store in the local storage.
After that, when the device is online then sync the offline data to your web server or handle it with the automatic load.
Hope this works for you.

Related

Can REST APIs be used for both mobile and web clients apps? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I wish to know if in the development of an application, the API developed can used by both the client app and the mobile app?
For example, having an API that manges products in Symfony 2. A client app is developed in AngularJs to make the web app complete.
I concern is, is it a best practice to use this same API for the mobile app or to create another set of APIs strictly for the mobile App?
tl;dr; - Yes, you should, but consider drawbacks!
In ideal, you sure can and you should utilise the same REST API for all your clients. This will result in more maintainable system. Angular.js also has a special factory/service called resource that will do all the heavy lifting for you.
However, we don't live in an ideal world and you would face some "side effects". For example, several years ago Twitter decided to do exactly this and their website used to load javascript and then only query the REST API for tweets. This led to perception of "slow" page rendering. Twitter dropped the idea.
So, the quick answer is "Yes, you should", but the real world answer is "Consider advantages and drawbacks, only then, make your own decision".
Yes and actually that's one of the main reason we make REST APIs...
So you don't have to build multiple server backend logic per client applications you make.
I don't know for React.js but Angular does handle it very well :)
Have a look at $http and $resource
https://docs.angularjs.org/api/ng/service/$http#patch
Yes, AngularJS supports PATCH.Look at the documentation over here.
With ReactJS, it depends which library you are using. But, React is just a really small library, so you are totally free to use plain JavaScript to make PATCH work. See here.

Can I start a call from a hybrid application by clicking on one button using MobileFirst? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i want to develop a hybrid application which makes a phone call to a static number automatically when clicking on a button using mobilefirst.can you help me?
It's not specific to IBM MobileFirst. A bit of googling would've given you the answer you needed...
Here are a couple of options to open the dialer with a number:
Directly in the HTML (you can style the a to look like a 'button'): call this number
Using JavaScript code to be called in a function: document.location.href = "tel:+375292771265";
Edit:
It seems that you want to auto-dial.
iOS: In iOS this is not allowed in webpages. Worklight apps are essentially web code and thus considered a "webpage" by the OS and will thus first display an alert confirming if the end-user truly wants to call this number or not. In a native app the dialer will auto-dial. This can be read in the iOS documentation: https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html
Android: not allowed by the OS. You may be able to achieve this using a Cordova plug-in: see how to create Cordova plug-ins in MobileFirst Platform Foundation and a possible functionality implementation.

React Native - why is so few apps in AppStore? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am learning React Native and considering developing IOS apps for my clients in it. I'd like to see some sample apps in AppStore, but there is just one. Why is that?
I see so much hype about this technology, but it looks like almost nobody uses it. Or is there any other reason for it? I'm already working with React and would like to add React Native to my skills, but don't know, if it's worth it. There are some interesting tutorials on the web, but no real samples in AppStore.
Actually there is already an app in the app store according to this blog post.
And as far as I know two of facebook's apps have been built using react-native (maybe not completely ): Groups and Paper.
So if you have any concerns, whether react-native is production ready: I think if Facebook can use it in their production apps it's probably good enough for you too ... ( no offense ) :D
People are still bootstrapping their knowledge and building applications.
Also, the technology is still in its infancy.

Cloud Code vs. Express [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I need to use a server for portions of my app. Since I'm using Express for this what is the benefit for using Cloud Code for aspects of my app that could be hosted on the server or in Parse Cloud Code?
You can use both the server and cloud code for custom functions but each have there own purpose.
Cloud Code (the main.js file) is really more so for having custom API endpoints that have logic when they are called. Like changing one field for table changes another field.
The server part (all of the other files) is really for just hosing a website that uses express stuff and renders all your web pages using "ejs" or "jade".
I'm a bit new to parse but I hope this answers your question.
Using Cloud Code for our mobile app is very useful now days.
there are following things that must know about Cloud Code
1.If your app is large then the code can be save on cloud so that our app take less time to load

iOS app firewall content filtering [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
We have a native iOS app that is used by schools across the country. We've had some instances where the user isn't able to access remote video content. I don't really have any details about the school networks that seem to be blocking our video content so I guess my question is more general in nature.
Is it possible for certain firewalls to block remote mov, m4v, mp4, mp3 content that is being requested from within a native iOS app? As far as we can tell the schools that are having trouble receiving video and audio content within the app are able to access the same content when browsing with Safari. This leads me to believe that the firewall might be setup with a different set of rules for the native app vs. Safari.
I can probably provide more detailed information but I'm just not sure what it is I need to know in order to trouble shoot this problem.
yes, the content retrieved from a server with an iOS app is accessed in the same way a browser does. Over the HTTP protocol. You can embed the video in the application as a fallback when it cannot be retrieved if you have to.