Identify WiFi in Ionic2 mobile app


#1

Hey guys.

I want to build a mobile app which is able to identify the user’s “home network”. Meaning: The user once declares a certain WiFi network he is currently logged in to be his “home network”. From this moment on, the app checks whether the user is logged into his home network or not. This information should be saved somewhere in the database and should be updated as soon as the network connection of the user changes.

Is this possible to be realizee with Ionic 2? Can you give me some hints in which direction I should read further?

Thanks a lot in advance & best regards to all of you!


#2

additionally: the network-status change should even be recognized when the app is running in the background and the user is not actively using the app at the moment…


#3

I’ve done this very thing using the wifi wizard Cordova plugin: https://github.com/parsonsmatt/WifiWizard/blob/master/README.md

To store the ssid of the home wifi you can use localStorage.

Cheers


#4

Thanks for your reply, @jasonwaters . The wifi wizard plugin indeed looks interesting - thank you!
However, why wouldn’t you store the network’s ssid to the database and use localStorage instead, which is aimed at temporary data? What am I missing?


#5

My app data is rather simple and a database is overkill. LocalStorage isn’t any more temporary than a db.


#6

Fair enough. Thanks for your support. I read through some other blogs and forums and it seems like my ideas can work with Ionic 2. Now it’s my turn to put something out on the street… Cheers & thanks again!