React-admin | Easiest way to warn user of a newer available version - react-admin

I have a react-admin app where we are making frequent changes.
Is there an existing plugin or a way to detect a new version of app and provide user with a toast to refresh the application so that they are working with latest version?
If not with react-admin, is anyone familiar with a way to do this easily with react?
I have found some manual way to do this in following places but I am asking here in case there is an existing package or a more elegant solution that I can leverage directly.
How to force update Single Page Application (SPA) pages?
https://medium.com/#kellyrmilligan/create-react-app-let-your-users-know-when-the-app-has-been-updated-with-a-notification-21335d85481c
Any help is appreciated even if its, nothing exist and I should just hand-roll.
Thanks for reading.

This is not the responsibility of React Admin to handle this kind of issue.
You can think of RA as a simple React component that helps you define an admin.
Hence, RA doesn't provide any helper to manage code update or something similar.
You have to implement this refresh system by hand, and your links are a good start for that.

With the serviceWorker you can do that :
https://github.com/marmelab/react-admin/blob/master/examples/tutorial/src/registerServiceWorker.js
But i don't know why in the demo the service worker is not used ?
https://github.com/marmelab/react-admin/tree/master/examples/demo/src

Related

How to add a react-native expo user login in the app

I basically made a login page which could grab user/password from the text input, but if I want to use these to get auth from my website which has a REST API, where should I start it, is any lib that I can use?
I don't know how deeply you want to make. So I'll guess your concerning.
If you want to just send and get response from server
You can use fetch() method in js. Luckily react-native have documentation. https://reactnative.dev/docs/network Look this documents. React-Native have own fetch method for communicating with server.
If you want to manage state of your client-side data
Redux : You might probably hear this one. you can include redux in your package. we can use redux in react-natvie not only react. I just googled articles. https://www.digitalocean.com/community/tutorials/react-react-native-redux
MobX : Redux is pretty much complicate way to deal with state. So If you need simple things. you can try MobX. try this one. (also googled) https://www.smashingmagazine.com/2020/08/mobx-state-manager-react-native-applications/
Hope this idea helps you.
Best regards.

Is there any way of knowing (via code) if a user is in the app and using it right now?

I'm trying to incorporate a feature into one of my apps that allows you to message users that are, at that moment, in and using the app. I've searched for a while now, but with no luck finding any article, API, npm package, etc, that supports this concept - if it even is possible.
I'd rather use an API than see when the user was last on the app via a timestamp and then "guess" if the user is still using the app.
I'm using React Native.
Check that AppState equals to 'active'.
https://facebook.github.io/react-native/docs/appstate

Are there any registration/authentication api's which can be used in React Native

I'm developing an IoS and Android app using react-native, and am now starting to consider all the aspects of user registration, so that typically the person will provide some credentials, and then get sent an email (or possibly sms) enabling them to "verify" their account, after which point they are a registered user.
These registration processes (and subsequent emails/sms's seem to be fairly common , so I'm wondering if there are any API's which anyone has come across which make the job of creating the registration/activation process easier m rather than writing code from scratch ?
Many thanks in anticipation
It depends what you want when you ask for an API. If you're developing backend as well you can use Auth0.
If you want just to implement frontend, I guess you have to write your own code. Consider using something like redux or mobx to store your email and other things after logging in.
Anyways the REST part you have to write on your own. As for views you can google for it, for example there's react-native-login-screen

IBM Worklight - Can we create a custom dialog for Direct Update?

How can we use custom dialog box for direct update in worklight 6.0?
Is there any option in wlclient.js? I don't know where it should be customized in the application.
Worklight 6.0 does not provide developers the ability to create a "custom dialog box" for Direct Update.
You can submit a feature request: http://www.ibm.com/developerworks/mobile/worklight/connect.html
So Idan already answered, but I did a lot of digging prior to his answer and I thought I'd share my findings just because I spent so much time on it.
Sifting through the code, through all the checks it does to see if a Direct Update is needed, it calls an update method for the app. It utilizes a Cordova plugin called 'WebResourcesDownloader'. In turn it calls the necessary native components and that's how you get a native handler for the downloader (it is in the worklight-android.jar for Android). So, long story short, you can't customize the box itself because its rendered via the plugin/native components and you can't modify the plugin directly (not that I know of at least).
However, you can at least update all the notification messages surrounding the update in the messages.js within the wlclient folders. =)

How can I import iPhone notes to my app?

Is it possible to import a note from iPhone notes app to my app? I googled a lot to get an idea about it. Nothing helps. Can someone give any idea about it?
Thanks in Advance
Third-party apps do not have access to the notes database. There is no public API for accessing the notes data.
You can try using a flow for syncing apps (eg. ifttt.com).
Create a rule that says "If a new note has been created (if a Gmail message has the label 'notes'), forward it to my db."
The solution is very clunky, but it's a starting point.
You could then find a way to scale this for your app.