Sending msg to iOS app from server manually - iphone

I'm kind of starting programmer and on Objective-C. So I want to make an app for iOS that receives messages from a server. These messages are inputed manually, and send to all iOS connected to the server. People connected will receive a Push Notification, if they aren't connected to internet they will receive when they do and run the app.
So my question is: do I need to use a server to do this (sending messages for multiple iPhones)? In case of yes, with is the best server? TCP/socket?

If your only purpose behind using is to send push notifictaion message, then you dont need to spend on that. There are some service providers available which allow you to send notification from there website. for ex: you can use urbanairship. You need to register device token from your Xcode project using their SDK, and then you can send notification from their website.
Thanks!

Related

Notify Firebase app server of messages between devices

Is it possible to configure Firebase app server to receive notification when there are messages exchanged between two other devices over Firebase Cloud Messaging?
So for instance I want to save these messages via my app server to the database. Currently I do it with additional REST request when I receive message on target phone.
However I want to avoid two jobs on target devices(listening/receiving the message and sending a request to save it) I'm thinking there must be an option where User sends a message from their phone and it not only arrives at target device but also notifies server?
There is no way to register your own observer that hooks in to Firebase Cloud Messaging's message sending mechanism.
There is also no capability to send messages directly from one device to another. There is always a piece of code that you deploy to a trusted environment (e.g. an app server of Cloud Functions) involved in sending so-called downstream messages to devices.
Two approaches that may accomplish the same need are:
Implement an XMPP server that sits between the devices sending messages and the FCM server that delivers messages to devices
Implement an intermediate service where the devices send the message, which then in turn calls FCM. This is a more generic approach of the previous one and is described in this blog post and in this use-case in the Cloud Functions for Firebase documentation.

Refreshing firebase when in background

I am currently making an app where users can send messages to their counselors at camp, without releasing their phone numbers. If the user sends a message, how can I check on the counselors app if they received a message, and if so, display a push notification, even if the app is in the background.
You will need to use Apple Push Notification Service (APNS).
To do this you will need a BaaS server with some PHP code and certificates to access Apple's servers. Each device authenticates to the APNS server when the app is loaded and provided a key. Then the device sending a message will send a request to your server and the server will process the data through Apple to whichever remote tokens you have specified in the payload.
Great write up here... https://blog.serverdensity.com/how-to-build-an-apple-push-notification-provider-server-tutorial/

iPhone Push notificaton

Is it possible send push notification without server side?
For example my device cominicates with apns directly without server?
While technically it is possible, it isn't something you would want to do.
You would have to embed your certificate inside your app. This would be a BadThing. Anyone who wanted to could then extract your certificate and start sending push notifications pretending to be you.
The apns is only there to push notifications out to the devices. It isn't a two-way communication thing other than the devices register with it. Once they have registered, the apns sends messages when you request them.
If you don't want to write your own server, there are others available that are already written like the excellent (I don't work for them - just a happy user) Urban Airship.

Push notification in iPhone from outside XMPP server

I create application and i want to use push notification in it. But application use outside servers (i nave not access to config this servers), e.g. XMPP server(xmpp.org, jabber.org etc.).
As i understand from apple documentation, for get notification, i must send notification with token to APNS from server (my server). Isn't it? How i can send notification from outside server?
I know it is possible, for example IM+.
its not possible to create it without sending notifications to apple server... but if you think out of the box you can create a layer with your own server which will act like a mediator between your app and your outside server. now you have control over this mediator server here you can send message to apple server to send push notifications to server..

Sending and receiving sms in backend of iPhone

I am new to iPhone application development. In the application that I am developing for iPhone there is a module which sends the sms without knowing to the user to my sms server and gets the response and displays the result. Is there any way to send and receive sms message in app?
Thanks in advance.
You should use data instead of SMS.
SMS are not a way to send information between a client and a server, but Internet is. And by using data, you also get a much more reliable transfer protocol (SMS aren't).
You shouldn't send SMS without the agreement of your users, because it can become really costly. Imagine you have a user on vacation in another country, and think that your app is using wifi, while it is using SMS. This user will be really mad when he will get is cellphone bill.
So even if you can do it, I think you shouldn't. And if you really need to do this, be sure that it is really clear to the user that your app is going to send SMS from his phone (with the charge of a normal SMS).
This is not possible with the iPhone SDK as it stands. It's probably not possible with any mobile platform without the user knowing about it as it's an obvious security hole.
I am also working on GPS-based application and I can have the device stop sending SMS back to the user every time the user send an SMS command. I think as long as the SMS is sent, it should be fine.
If the user wants to see the status of the device, then I might have to establish communication between my server and the device via TCP/UDP and have the iPhone app "parse" the information and display the status. Perhaps the best way is to have the server respond to the iPhone app saying "The device received your SMS command" and display it on the app so that the user knows his/her SMS were sent.
But yes, if we could get the location via SMS, then I could send those coordinates to the Google Maps app in the iPhone itself and it would display it for you.
I am the author of an App on Android which does this, called ImHerePlus. Check it out and see if it helps.