How does push work on ipod touch with respect to auth credentials? - authentication

I installed this instant messenger program called IM+ that keeps your accounts online even when you exit the application (you know... touch: only one app at a time) it accepts push deliveries to report you have a message.
I am kind of puzzled on how they can keep me logged in and send me a push notification that someone is messaging me. I noted the same happens for mail. If I receive a mail, even if I don't have mail open, a badge appears near the icon.
My main concern is the password. How does push work? does it mean that apple or the company behind IM+ stores my email and instant messenger passwords to keep me logged in and push me a notification when I have something new ?
Edit: ok... the tumbleweed is a bit too much for such a question.

Read this to understand how it works: Apple Push Notification Service

Related

Asp.Net Boilerplate Notifications

I have Notifications working in a .NET Core web application using the Abp Boilerplate framework. I've also implemented EmailRealTimeNotifier so that after the Push notification is sent, an Email is sent as well.
I'd like to give Users of the application the ability to choose as a preference, whether they want to receive
Push Notifications Only
Email Notifications Only
Both Push and Email Notifications
I figure I can refactor the EmailRealTimeNotifier class used to send Emails with some clever logic hopefully. But I'm stuck on where and or how I would implement code to prevent the Push Notification from firing off.
You can save the settings in the Settings per user provided by abp, read those settings and based on that send the emails or push notifications.

Strategy for notification checking

Is there a recommended strategy for checking of notifications within my AngularJS app?
By 'notification' I'm talking about message alerts that are to be displayed to a user when they're logged into the application.
My plan is to notify the user of unread notifications in the app's NavBar as shown below:
My app communicates with my restFul API (written using Node.js, express, MongoDB), so I anticipate that new notification will be written to a MongoDB collection with details the user the notification is intended for.
What I'm unsure about is how the AngularJS application will check for notifications once a user is logged on. I could call my API for unread notifications every time the user navigates from one path to another but that seems simplistic and it wouldn't work if a new notification occurs whilst a user is viewing a page.
Another way would be some sort of timer system that checked, say, every 30 seconds. But this would results in unnecessary polling of my API when there aren't any new notification for a user.
So, wondering if there is a recommended strategy. Thanks for your help.
Polling is a solution but it is very inefficient. The solution to your problem are websockets. Websockets is a technology that provides a full-duplex bidirectional communication between your clients and your server. So you can send messages from your server to your connected clients. Your server maintains an array of connected clients and you just have to know which ID you need to send a message to it.
For your stack, the best solution I have came to is Socket.io http://socket.io
It also have cool features. For example, you can "observe" models, so if a model change in your database, for example an update to a user profile is made, you can trigger an event and automagically send a message to your client. This client get and handles the notification and do something, like put a badge on your alerts icon.
Hope this is useful for you.

IOS UILocalNotifications live after my app has been deleted...how to deal with these notifications?

I was wondering how to deal with UILocalNotifications that were created using my app but the app then got deleted.
Lets say that after creating a few notifications, the user decides to delete the app, but i've noticed that even though the app is deleted the notifications lived and they still fire in the correct time, but this doesn't make sense to me since the app is not existant in the phone anymore.
I understand how this is possible, but i would like to know if there a way to delete such notifications when the user decides to get rid of my app?
And does this happen as well if the app is being updated?
Thanks.
Another way is to use APNS (remote notifications) instead of local notifications.
This way, once your App was removed, pushed notifications will not get to the device anymore , nor to the user's attention.
At this stage you can be aware of the App's removal (using APNS feedback service) and cease your sending mechanism for that user (his push token..)

Friend request real time notification to recipient device

I want to notify a user if any other user wants to be friend with him. The only ways I can currently think of is notify through push notifications or recipients device will keep polling server for new information at certain frequency or device will check for new information only when it launches.
I have some problems with Push Notifications method to send requests
If device is offline only last notification will get processed
If app is not running, push notification will get delivered in Notifications and I don't know how can I extract information from there to my app.
Also, if device keeps polling for new information number of API calls will be very high which is not cost effective and alternately if device asks for new information only at start up launch it will not get real time updates.
Is there any way I can send information to device as soon as information is available?.
Any suggestions will be appreciated
Have you taken a look at Urban Airship?
They have a great framework set up for queueing and receiving push notifications, even when your app is offline. You can either queue the notification from the app itself or from your server hosting your account data. They also have the ability to compose and push rich content notifications.
The basic account for small apps gets 1 million free push notifications per month. Everything beyond that is fractions of a penny.
Hope this helps, Cheers!
Notifications is one such thing which can drain down battery if one takes polling route, thats one of the reasons Apple developed Push Notifications. I would recommend try to use Apple Push notification as much as possible as it would have been optimized to hell. If you have different flows for when the app is active & for when the app is not active (reg. notifications) you can do it like so -
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
if(application.applicationState == UIApplicationStateActive) {
// app active.
}
else {
// app not active
}
}
But if in any case Apples Technology does not suite ones needs one could always use third party services. In this case there are a few that can really help you.
Pusher has an Objective-C library and a REST API (along with a number of libraries) that would let you push realtime updates from your server into an iOS application.
OpenPush is another such service. Also check this link, here's a compiled list of realtime technologies in which I'm sure you'll also find technologies that meet your requirements.
All of these are better than polling.
Is there any way I can send information to device as soon as information is available?. Any suggestions will be appreciated
user1 wants to add user2 as friend.
from device, post information to server, in your webscript, process the friend request of user1 to user2 (insert/update information to database etc), when done. send the notification to user2. this will work if the device is offline, user2 will have real time update, if the app is running. you can run scheduled request that will check new notifications. say every 2 minutes, a method in your app runs. but thats not a very good idea. A reload button inside the app to check notification is better.
What you would normally do is to use the push request as a means of informing your app that new data is available. The user clicks on the push notification - the app is opened with the
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
you register that there was push, query your server and the server let's your app know that this list of new friend requests are there.
You can't really do the queuing of messages on the device - and you don't need to. It's much easier to just store the info on your server until the app queries it.

iOS Push Notifications to specific user in the same deviceToken

I am using Urban Airship to test push notification and it went well.
My problem is how do I specify which user to get the notification not just the device token.
I mean in some situations where one device has multiple users, so many users registered the same device token to server.
Or do I have to do the filter on the device (client side) itself?
There's no real way to do what you want unfortunately. In APNS there's only such thing as a device. You push a device and it shows a message / badge / sound on that device.
If your app can have multiple users associated with it then you'd need to work out from the push which user it relates to and handle it accordingly. How you do that would depend on your app but you could add in a custom key to the push which indicated the user it's for.
If your app only ever has one user logged in at once then I suggest that when you hand the push token to your server, the server first turns off push for the user that the token was originally registered for and subsequently turns push on for the new user.