Can an iphone application recieve push notifications from a custom server? - iphone

This is a very basic question on push notifications.
I need to know whether an iPhone application can receive push notifications.
I want them to operate as follows.
User installs the application.
When the application is not running, the user notices that something has changed with the application.
This is indicated by the application icon changing.
User opens the application and a new screen comes up that says:
"You have 3 new items to download"
The application will need to communicate with a custom server to obtain changes. The changes will only be known by that server, not the Apple App Store.
Is the above possible to program?

Yes. Your custom server sends them to Apple for distribution to devices. Read Apple's Push Notifications documentation for more info.

Related

Flutter best way to store App Notifications?

Is there a way to store app notifications in a flutter app. Most of the time this app will be closed and the app notifications will not directly be hitting the app. I would like to store app notifications in a notifications received section. I know I can get the notifications if the app is opened, but for if the app is closed and it just shows as a status, I can't get them in the device unless the user clicks on the notification message. and it opens the app. What options do I have and is what I am wanting to do even possible?
First interpretation of your question: If I read your question correctly, you're saying its not possible to have text in your notifications when the app is not open. This is definitely possible, almost all your apps create notifications on the device with more than just 'status'.
Another interpretation of your question: In response to a firebase cloud messaging message, you might want to save data or do some other background task, instead of just creating a notification the user sees. This is not enabled by default. There's lots more instructions on enabling and using this in the README
By default background messaging is not enabled. To handle messages in the background:
The golden nugget of information is _firebaseMessaging.configure(onBackgroundMessage: yourBackgroundMessageHandler) which is not listed under the receiving messages section.
Let me know if I misread. What do you mean by status?
You can use background Fetch to make the app stay in the background. The package will awaken an app in the background about every 15 minutes.

How Apple Push Notifications Deliver to the User in iPhone app?

Am developing an iPhone app. In my current iPhone app i want to integrate APNS that we want to send a messages to the user. I gathered information about APNS. But, still i have some doubts on the APNS.
How APN works that means how the push notifications showing to the user?
If our iPhone app get closed from Background, the Apple push notification will work or our app should be in run?
What will happen if we send a notification to the user but,if the user is in offline. The message will deliver to the user once the user gets online (Get network connection) or the message won't show to the user?
Push Notifications will be show the user if the user doesn't open the app in their iPhone?
Can anyone please guide me on these doubts? I hope on you friends. Please help me. Thanks in advance.
I think you did not follow Apple developer library instructions. I have doubts about your understanding of APNS and its working.
When you send the notification to user, and his cell is off or not connected to the internet, he/she will get message/notification when his/her cell will turn on or connect to the network.
And Push Notifications also work when your application is in backGround or user is not using the application.
Hope this information can clear your confusion, you should look in to the apple developer videos and SDK about push notifications.
Also this is SOreadytohelp.
You asked quite a few questions. I'll try to answer some of them as well as I know:
How APN works: You send a message to Apple's servers with the specific device ID. Apple will deliver that message to the iOS device. (You likely want a more specific answer, so please ask.)
If your app has been allowed background app notifications, then they will be delivered in the background. (The user can enable/disable this)
If the particular iOS device is not connected to the network, notifications will be queued. But, identical notifications will get discarded and only the most recent will get delivered. See: Quality of Service
Yes (basically the same answer for 2).

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.

Apple push: does it need an application at all?

Do we need to install an app to receive some push from a service ?
Is there a way to register an iphone somewhere (website / apple server) without having an app installed on the iphone to register to the push service ?
Apple Push Notification Service is to be used with native iOS applications. Without an application APNS cannot be used.
you are saying you want to push a message to a particular iphone, but not have it related to any app? This is basically a text message, and you could do this from a server remotely using SMS.
Yes, if you want to use Apple Push Notification Service, you will need an app.
But go have a try at notifio.com