Services Plugins FAQs

Native app - disabling access via web browser

I would like to disable all browser/non-native access to my app, now that it is wrapped, so it can only be accessed via the native app. Is there an easy way to do this using the Air Native plugin?

Hello @jessegoplen

Thank you for reaching out.

At the moment, it is not possible to disable the access directly from the Air Native plugin. However, I would recommend creating an event Page is loaded > Check if the OS is Android, then redirect to Google Play Store and if the operating system is an iOS, redirect to App Store. However, for that, you will likely need some sort of OS detecting plugin and then do a redirect to one of the stores.

Please let me know if you have any other questions.

Take care :slight_smile:

1 Like

Ok, thank you Kirill, I will look for a plugin like that, or perhaps some javascript.

I was hoping there might be a way where I could use Get OneSignal DeviceID, so if it failed, that would then mean that the user wasn’t using the wrapped version of the app. Would that not work? If it did, I could set a custom state that would show an info page to web browser users instead of the app.

Thank you for additional information @jessegoplen

I’ve discussed your case with our developers, and the method with OneSignal is most likely not going to work. We suggest you put the following condition: Air Native’s Device OS is empty, how it works: when the plugin is launched, we send a request to the native and make the state itself empty (null or, in the understanding of the bubble, empty). When the response from the native comes, then our state can become ios or android but if there is no response, the state will remain empty. This method is more likely to work and easier to implement.

Please let me know if you have any other questions.

Have a nice day :slight_smile:

1 Like