I am developing a reactive application that can be run as a PWA or a native application. I am implementing a barcode scanner which doesn't have a good solution for PWA. So I am hoping to implement 2 solutions ie;
Is there a way for me to find if the instance of my application is running as a PWA or a native app ?
regards
Rakesh.V
Hello Rakesh,
You can use the action IsCordovaDefined from Common Plugin. This action will return true only if you are running in a native app. It is the better way to check if you are in an app or PWA/web.
Fabio
Doesn't this throw an exception if Cordova isn't defined ?
if you try to use the plugin directly, yes, you will throw an exception. But if you call the action, you will get a boolean without exception and you could do your own treatment for that.
Thanks a lot. It worked :).
Hi Rakesh,
You should be able to use the IsRunningAsPWA action from OutSystems UI and include it to the logic flows of your mobile application, and handle each case as necessary:
Let me know if that helps.
Hi,
This seems to be returning a false if I launch the application from my browser . What I was looking for was a solution to launch the native barcode scanner if I am running the app from an apk/ipa. Else launch the javascript version if running on a browser or PWA .
Thanks and Regards