How can I automatically login to Hotspots service? - iphone

I'm working on an app which logs automatically in to a hotspot service (Fon Hotspots).
The service I want to uses is a unprotected WiFi-connection which asks a login and password in the first screen you open.
I want to let the app do it automatically so you don't need to do it each time by yourself.
So you need to enter before your login and password in the app and save it.
Can someone tell me which functions I need to use and how it works?

It is my understanding that the iPhone takes care of network connections for you. I think you just need to test to see if the device is connected to a network and then do whatever you need to do.

Related

Does whatsapp store password?? Or are their Sockets always open?

I am trying to figure out how to auto-reconnect a ejabberd socket connection. Like whatsapp, Facebookmessenger etc
For example, when the app is closed, and i receive a push notification to wake the app up and that calls to connect the connection, or if i put the app to the background for an hour, and the connection has been idle too long and get disconnected,then i put the app back to the foreground.
I can only think of 2 ways to automatically connect to the ejabberd server.
1.) To have the JID and Password stored(but this is not good for safety reason)
2.) To have the ejabberd idle connection set to never disconnect a connection(But this uses quite a lot of resources)
Is there any other possibility to automatically re-connect a user to the server?
You cannot stay connected all the time on mobile. This is the case today on iOS and is going to be the same on Android with Android Marshmallow.
So, you need to authenticate and store some form of credentials. It does not have to be a password. If you have a custom auth module in ejabberd for example, it can be a token.
Please, note that you can also store sensitive data encrypted on mobile. Both Apple and Google provide a keychain API that is design to protect the credential. It is not accessible in cleartext from a backup for example.

How to call Web service Continuously in ios

I have an ios app.
In which i have multi user account.So multiple user can Login.
When one user see other user profile and if that user is also online i want to notify him.
I can't get how to implement it.
If i have to continuously check some flag value on server if someone has checked their profile or how can i handle it?
Remote notifications is the way to do it. The logic on when and who has to be notified can be handled at the server.
You may have seen lots of apps asking for permissions to send notification. The downside being if the user denies that permission.
Polling from client side can also be one of the methods which can be used and but would require the client to do most of the computation.
So all in all, its a call you got to take considering what you are building.

Can I send a URL Scheme to my App by texting someone?

Basically the problem is my app has some very specific server settings that will change from store location to store location.
Instead of me telling the client over the phone what to set their phone as.
Server IP:
Username:
Password:
Service IP:
etc.
I'd like to be able to send a text message to their iDevice witha URL Scheme that they will tap and will automatically activate my app.
Can I send a message like this?
"And apparently I need 30 characters :P to be able to post..."
This is quite simple. I think what you want to implement is what Apple called a "custom URL scheme"
You can find it in this Apple documentation at page 122.
First, your application registers to the system at install telling it that you will handle this URL scheme, for example, "myapp://"
Then, you simply text it to your client.

iPhone NSURLConnection pop-up for entering user/password requested?

I observed in a Hotel I am that when other apps trying to access the internet a pop-up appears that ask the iPhone user to enter the user id and password of the Hotel's Wireless LAN. I guess it is some kind of redirect on all requests to protect misuse of the WLAN.
I have an app and it does use the NSURLConnection but I am not getting the pop-up instead it goes via the regular data network of the carrier. I removed the SIM to see what happens then and then the connection fails with an error "The Internet connection appears to be offline".
I wonder whether this is because the NSURLConnection does not provide such a pop-up and this other apps (e.g. Safari, e.g. WhatsApp) use a different API. One the other hand I thought that might be what the documentation says is the "Authorization Challenge". I have implemented those delegate methods but they are not called.
If someone with some experience on this can help me.
Search the documentation for the UIRequiresPersistentWiFi Info.plist key - there are some tradeoffs (users will get an alert every time they open your application if their phone is in Airplane Mode - doesn't seem to be any way to turn that off) but that should force it to make the connection.

Why registering for push notifications every time a user launch an app?

In the Apple documentation you can find the following sentence :
An application should register every time it launches and give its provider the current token. It calls registerForRemoteNotificationTypes: to kick off the registration process.
So when I implemented the push notification in my app I had to register the device, and I did what they said in that documentation: registering every time a user launch my app.
The token that I receive from the APNS is always the same for a given user.
My question is: why do I need to register everytime if the APNS gives me always the same token?
I read somewhere than a token can change if a user swipe his iPhone or the app. Is it the only case?
Thank you !
The token that I receive from the APNS is always the same for a given user.
Except it isn't, basically because there's nothing you can hang onto as being "a user" in the iPhone setup. The device token is always the same for each app for each device. So different apps on the same device get different tokens. The same app on two different devices gets two different tokens.
The crucial thing to note, and this is mentioned in the APNS guide, is that a user may back up their apps, settings, everything. Then they can drop their phone down the toilet. When they get their replacement phone, they can take their backup and restore it onto their new phone. Bingo - same app, same user, different device, and different token.
As far as your app is concerned, nothing has changed since the last time it ran - it doesn't know that it's actually running on a different device now. The only way it knows is because it asks for the 'current' device token, and hey presto it's a different token to last time.
You can choose to cache the token and check it against the token you just received (e.g. save it in your NSUserDefaults) - that way you don't have to communicate it back to the server unless it has changed since the last run, but you absolutely do have to check, otherwise your users will come complaining that they don't get push notifications any more since they replaced their phone.