Handling first time users in react-native - javascript

Is there any configuration in react-navigation for screens I only want to display once during the life time of the app? For instance, once the app is installed for the first time, I want the help screen to appear.
If no configuration is available, then what is the best way to do it? My idea is to save a variable locally and set it once the help screen has been displayed. Once the user opens the app again this variable will be checked and based on the that the next screen will appear. The problem here is that if the user erased the app data (cache and all) then the help screen will appear again even if he is not a first time user.
Any suggestions?

People change their mobiles and sell the old ones. A new user might install the same application on the same mobile but that user should also see the help page. You can achieve this using 2 methods, one would be server based and one would be local mobile based.
1) Server Based
When the user registers or log-ins for the first time show the help page and store that the user has seen the help page on your server. Next time the user reinstalls the application on a new device or the same device check for that information and do not show the help page.
2) Local Based
Use React Native's AsyncStorage and mark the user as help seen. When the user logs-out of the application make sure to remove that key from AsyncStore so that a new user can see the help page.
My thoughts would be you use the local app based method and let the user see the help page everytime they clear their app data or reinstall the application because features change and you might also change the help page in future. So it is better to let the user see it more than once given that you give the ability to skip the help page as well :)

Using AsyncStorage is probably the best option since it will store data locally on the device and persist between sessions. However, AsyncStorage data will be erased if the user uninstalls an app.
You can persist data between app installs on iOS by using the Keychain, accessible in React Native via 3rd party libraries (https://github.com/oblador/react-native-keychain)
I don't believe there is any way to persist data between app installs on Android.

Related

Hard refresh the page every time when I update the code

Whenever I update the code on production the changes can't reflect without hard refreshing (ctrl+F5) the page. So, Is there any way by coding I can handle this problem because the end user doesn't know these things.
Pls suggest. Currently, I am developing using the Dot net core for API's and reactJS as frontend.
You can implement PWA, whenever a new version/file is available it automatically downloads. In PWA you can add an alert like "App Update is available" Here is the reference for ReactJs: https://dev.to/daniellycosta/showing-new-version-available-notification-on-create-react-app-pwas-3jc9

PWA - How to check for updates?

I have a progressive web app which works as intended.
But now I want to know how to check if the site has changed (if the user is online) so the user gets the newest version.
Right now I need to hard reload or wait till the service worker does this automatically.
I've checked many sites including
https://developers.google.com/web/tools/workbox/modules/workbox-build#full_generatesw_config
but could not find an answer.
How can I archive that? E.g using navigator.serviceWorker.

share component between pages without reloading it

Do any of you know how can I share a component between several html pages but load it only once?
I`m trying to share a unit canvas between several pages, but it takes too long to load, so every time I change the page it loads again, causing a very poor user experience. I tried to create the frame once and put it on session to be reused, but it seem to be not the fix for it.
I need to use the same component amongst all the pages without reloading it every time the user changes the browser address.
Thank you.
we had the same problem with adding the communicator to out online app (something like on FB). The best solution is to do a single page application and manage urls by html5 history API, but is only applicable when you start development. You could also try something with iframe e.g. put canvas in main document and the rest (changing part) in iframe, but you will have a problem with urls, so it isn't solution.
Becouse we had working app when we started work on communicator we ended up with everything store in session like you did.

How can I know when user going to clear cache of my app

I'm new to Phonegap, I need to know when user going to clear cache of installed app or can we take control on user mobile like examples on to know about charging of mobile,clear cache etc... belongs to my app...
plz help on this,
Thanking you,
You will not be able to be alerted when a user is going to clear your app cache. However, you can place a file in the cache and every time the app is opened, check to see if that file exists. If it doesn't exist, then you know the user cleared the cache and you can take appropriate action, including placing the file back in the cache.

How to get the app's user when the app is loaded from graph api?

I am having a serious problem with my app. While installing the app, my app will ask the user in which page he wants to install it. Suppose the user select a page and says install. The app will be installed.
Now When a visitor visits that page, the app will also load. What I want to do is I want to get the user id of the person who actually installed the app, using a javascript code.
Can anyone help me fix this? Thank you all in advance.
You could store that off someplace on your installation, either in the site itself, or back on your server and then call back to it to get the user/page combo, I don't know of any other way to do it.

Categories

Resources