Facebook push notification on my iphone app - iphone

i have developed facebook chat app for iphone using XMPP.
But the app can not get push notification from Facebook. How can i get push notification from Facebook on my application?

Rather than polling continuously, you should try to use Facebook's realtime updates API where applicable.
https://developers.facebook.com/docs/reference/api/realtime/
It's only applicable for certain kinds of content, but if it covers what you need, it'll be more efficient than polling like prasanna suggests.
Basically Facebook will send a request to a URL on your server whenever an event happens. The handler for that URL should then be responsible for sending the push notifications.

You can't bring Facebook to send a push notification to your app, you would have to set up a web server that continuously polls Facebook for changes and then sends a push notification to the iOS device when it detects a change.

Related

How to send notification to all users when new version is uploaded in appstore?

I want to send notification to all user when application is release in appstore without using push notifcation.Is there any method I can notify to my users.
there is no way to send notification to alert user with out APNS or socket (backround running ). with out APNS, you can check only when the app is opening and call an apple API or your api for getting latest app version and then you can trigger a local notification .

Facebook Mobile Notifications

I'm trying to send notifications to user through an app, but they don't show in any mobile device.
For example, the user makes an action that sends a notification o other user. If he is on a Computer browser he can see the notification, but in iOS/Android/Mobile Facebook the notification don't show up.
Can you guys help me?
Regrads,
Elkas
Are you talking about the Notifications API where you make a POST request to /{recipient_userid}/notifications?
If so, this is intended behaviour. From the docs:
Note: Only apps on Facebook.com can use the Notifications API. Also
these notifications are only surfaced on desktop version of
Facebook.com.

iPhone Push notifications via mobile safari

Is there a way to simulate push notifications by pushing data to mobile safari? Here are 2 scenarios.
I make a web app via phonegap and dont want to use APNS but rather make a web-socket connection and push data to the device myself. On the device end is there a "alert" function I can call to emulate a pop up when a user is not in the application?
Lets throw web app out the window. Is there a way I can do this in native mobile safari? Im not talking about a plain old JS alert window that would only come up if the user was in the app, but be able to do so with it backgrounded.
You cannot run background tasks with mobile safari so for #2 you can't do true push notifications or alerts. However you can send a user an SMS if you have the user's phone number. This can have a hyperlink to a part of your web site (which can contain some sort of payload). You can use a service such as Twilio to help you send SMS'es. However this costs money. APNS does not.
For scenario #1 I'm assuming you're talking about a native app using a phonegap solution. In this case when the app is backgrounded you cannot access any UI at all and wake up the app and show a UIAlert. In fact unless an app is registered for location updates or background music, the app is effectively not going to respond after a set period of time (it only can "finish" certain operations it had started before). So the websocket solution will only be effective if the user has the app opened.
You could register a local notification that runs at some predetermined time which will show an alert. But that is not being pushed from the server so its probably not what you want.
APNS is your best solution for scenario #1. Its not that hard to implement and its pretty inexpensive. Check out urban airship if you want to avoid building out your own server-side components for it.

Facebook chat in iPhone app with push notifications

We're planning an app which, among other things, is supposed to integrate a facebook chat.
We're discussing about the push notifications for receiving messages while the app's in background. What comes to mind is a proxy server for the chat, that'd actually connect to the facebook chat, and the iPhone app would connect to the proxy.
Then, it's easy to have the proxy server act as a push notification server.
Is this the only way to go, or are we making this more complex than it needs to be?
Any input is appreciated. Thanks.
To do push notification (App is closed, user receive a message and an alert appear on the iPhone), that's the only way, because every app need an unique certificate to send push notifications. This mean that official Facebook servers can't push for third-party applications. You need a proxy that keep a connection open to FB and push alerts to Apple's Push Notification Server when needed.
Inside the app, instead, you can connect directly by opening a socket to Facebook's servers and use a Jabber library for ObjC. This allows another approach: Local Notifications. They're similar to Push, but they doesn't need a proxy server: it's the application running on user's device that keep an open connection (even when the app is in background) with Chat Server.
This is the documentation that covers both type of notification: Local and Push Notification Programming Guide
Facebook's chat system is a Jabber server, so I think you are making it more complex than you need to.

iPhone: Is it possible to send Push-Notifications from a website?

I'd like to be notified of certain events on my webserver with a push notification from my website to my iPhone. Is this somehow possible, or do I have to install/create a special App for this?
In order to use Push Notification it would have to be a native iPhone app on your phone. You might be able to set up some sort of email notification coming from your website and turn on push notifications for your mail client on your iPhone.
In regards to #gnuf's post (Sorry it wouldn't let me comment on your post) Your web server can act as the Provider of Push Notifications but will still require a native application on the phone to receive the notifications.
You can definitely send notifications triggered from a website: you just have to hook up the backend to do so. See this previous post for more information.