Sending push notifications between devices using Parse and Swift - swift

I have configured my app to receive push notifications through Parse, which I can send from the Parse dashboard, but I would like to send notifications between devices, specifically when a button is clicked from either device. I cannot find documentation about this...wondering if anyone has experience doing this.

You have to store the current user into Installation class then send push notification using PFInstallation Query and PFPush.
Please refer this parse documentation for more details to send notification.
https://parse.com/docs/ios/guide#push-notifications
or refer this site Swift Parse : How to Push Notification To a Specific Device/objectId

Related

How to remove a specific push notification from notifications center Swift

my App is an app like Uber app, I sent a task to all my drivers this will be by a push notification.
But when a driver accepts the task first I need to remove the sent push notifications from all drivers devices so it won't be show in the notification center.
I search a lot about this issue, but no answers!
anyone try to delete a specific push notification from the notification center after sent it?
thanks.
You need to send a silent push-notification that triggers a local notification with a specific identifier.
This identifier should be send inside the silent push notification, that also should carry all information the driver should see in the local notification.
you need two types of push-notifications: show, hide.
got the point?

How to test if Geoloqi push notifications are working or not?

For normal push notifications, when something new is added to a site, a push notification is sent to the device.
So if I want to test if push notifications work how do I do that?
I tried creating triggers and Geonotes on the console with the present location I receive on my iPhone. And then tried running the triggers hoping to receive a push notification, but unfortunately I am not getting any push notification.
What am I doing wrong?
I hope someone can help me with this.
You can use the message/send method to test sending a message directly to a device.
The simplest way is to log in to your own Geoloqi account from within your app, and then use the API console to send a message to your device. You can of course also send messages to other accounts, just take a look at the doc page for message/send.

How do push notifications on the iPhone determine which users are notified?

I'm just trying to understand push notification more.
Let's say I have a web service that my app connects to that needs a user to sign in with a username and password. And this all works fine when running the app.
Now... how does the web service determine which user to send the push notification to?
I'm really unsure on how it works with users with usernames and passwords. It would be great if someone could enlighten me to this. A better understanding could improve my apps in the future. Thanks!
I'll give a brief over view of how push notifications work:
First, your app will call the registerForRemoteNotificationTypes: method. This will check that your app is allowed to send and receive the types of notifications you requested, and contact Apple's servers to register your device. You will get back a special token used to uniquely identify the device.
Your app needs to send this token to your server along with the details of the account that the user is logged in with, so your server can associate that token with the user.
When you want to send a push notification to a user, you lookup the token you received previously for that user and use that when sending the notification to Apple's server. This will forward the notification to the appropriate device.
It's probably a good idea if you read the Apple documentation here: Apple Push Notification Service. This will give you a clearer understand of how it all works.
Here is the wonderful tutorial explains in detail, http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
For login procedures, you don't even need push notifications. If you need a general introduction, you will find one here
Below I have mentioned 2 links.
https://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html
http://mobiforge.com/developing/story/programming-apple-push-notification-services
Now coming to your question, push notification is pushed from a server. Now for a particular user the server side should maintain the database such that whatever changes made to a specific user should be pushed to that device id.
Hope this help.
Push notification is awesome feature of iOS apps. It works like your application needs to register for Push notification as
//Your application registeres for push notification using following line
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
This will tells you application to handle generation of device token failure/success by delegate methods
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
//Your application registered for push notification i.e. allowed by user.
//You need to take device token and pass it to your webservice and store it in database.
}
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
//Your application registered for push notification i.e. not allowed by user.
}
So, Now what after you have device token ? .. Its simple now use it for sending push notification. You can find different code for that using PHP as well as .Net. Search around and you will get plenty of them.

Apple Push Notifications to specific Users

as far as I understand APN's I can only send them to the app not a specific user that uses my app.
Is there a way of sending APN's only to specific users that use my app? I can't think of a way of doing this...
Greetz
APNS is not a broadcast medium. As it says in the documentation:
Apple Push Notification service transports and routes a notification
from a given provider to a given device.
When you send a notification from the server, one of the paramters is the device ID.
Apple's Push Notifications are always sent to specific 'users' (a specific device being an iphone, ipad)
What you do when you want to use APN is register the application for push notifications. Then you get a token that links the user's device to the notification service. You then use this token to 'push notifications' to APN which will in turn send a notification to that device. Notifications are pushed by 'Providers'.
Here's apple's documentation on the matter: Apple Push Notifications
Look up 'Registering for Remote Notifications' to register the device
and 'Handling Local and Remote Notifications' to handle the incoming notifications.
Read up on how to send notifications here: Providers
It is possible. I use Easy APNS and in newMessage() you can specify the PID (saved in a MySQL database) of the user.
Have a look at http://www.easyapns.com/

How to create push notification when the RSS feed gets updated in iPhone?

I need to display a push notification on new updates in the xml feed.
Had gone through http://mobiforge.com/developing/story/programming-apple-push-notification-services and tried that sample code successfully.
But what should I need to do ,to create push notification while new entries come in RSS feed?
You need to write a push notification provider server that sends the actual remote push notification as well.
I suggest you have a look at this link
http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/