Dialog-overlay ? Disable screen if no network connection

Id like to disable the screen like the dialog-overlay does, how can I call that but without the NSB.MsgBox ?

I want to disable the screen if internet connection is lost and hide #NSBPage. so a user can not see the html source code.

You use an offline page.

Hi,
Do you mean: if offline then ChangeForm(“OfflineForm”)

Yes. And then you’ll need to remember where the user was and add an online handler so when the device comes back online you can return the user to what they were doing.

Use case: User is using your app and device goes offline (airplane mode??). You detect the offline state, move them to the offline page. The user fixes the problem (leaves airplane mode) and when the offline state changes back to online you take them back to where they were.

i see, good idea but I append a footer and header which have menus, so although I can show an offline page the header menus will still navigate to the other pages.

Yeah, I hide the headers and footers in my offline page.

Ah good idea.

My aim is to try and secure & protect the source code from being copied once I upload it to my website.

Anyone who knows what source code is and wants your source code just has to go into debug mode (ctrl+shift+i on chrome) and under elements they get all the html and under sources they get the javascript and css.

Most people who really want to protect their code “obfuscate” it and I’m pretty sure AppStudio has a built in function for that.

Beware that code obfuscation makes it difficult but not impossible for others to see what you’re doing. Also, for any script that can obfuscate, there’s another script out there that will reverse it… all you’re doing is making it harder, not impossible.

Thank you for your input.

Yes I do use the obfuscate function.

I’m just trying to make it not worth someones bother to extract the code and copy it.

Yeah, I get that. People (Russians, Chinese etc.) used to hack cordova apps and steal various google codes (like the maps api token) and then run up huge charges on other peoples accounts. It was a constant game of cat and mouse.

What you end up learning is that every move you make is an opportunity cost. The more effort you put into keeping predators at bay, the less effort you can put into features.

Personally, after obfuscating, I’d spend all the extra effort protecting the backend because, ultimately, that’s where the bad actors are going to go.

One way to avoid the hijacking of maps accounts, etc, is to “hide” them behind your API server. EG, instead of the app on the device having the code to access the service, it would access your API server where you store the data from the app, etc. Then your API does the special stuff to access the services elsewhere on the internet. This does require a server where you can create an API - not sure what resources you have available for this project.

1 Like

Yeah, most of us tried the store and forward api technique and then google changed their policies and pricing so that you were penalized for that. Now if you use their mobile sdk then maps are free but you’re obviously allowing Google to track your users.

Not sure you can avoid 3rd party data mining no matter how you setup your calls to an external service. For example, maps have coordinates, and a lot of them that are associated for whatever reason. But the fact you’re looking them up “together” or in a particular sequence means something to someone who will buy that data. I don’t see how to avoid data mining - we all know they do, whether it is regulated or not.

That was my point in all this for the OP, there’s a limited amount you can protect.

Thank you for your comments, I think I’ll have to accept there is so sure way to fully protect the code. I guess someone could also reverse engineer the actual app so its no different.