Time taken to send iOS GameKit message - ios

So I am trying to write a simple app that will connect to another iPhone and send messages over bluetooth, and it seems like the best way to do this is using the GameKit. If I am wrong, please point me in the right direction now before you read this whole question, haha.
The two requirements are:
iPhone to iPhone, same application (easy)
I can get the time it took to send the unreliable message (not easy)
I am going to assume this is not possible over GameKit based on the (little) research I have done, and I have not yet found a good guide to the CoreBluetooth framework. Once again, if you could point me in the right direction that would be appreciated.
TL;DR: Is there a way using GameKit to get how long it took the small unreliable message to be sent? If not, can I do this with CoreBluetooth?
-Jake

This feels like a strange question, you want to know, how long it took to send the message between the two phones?
The way to this is to set up a ping between client and server, the server will ping the client, then the client immediately sends the response back to the server, and the server divides the total time by 2.

Related

Can I send a push notifiction from ios to ios, without a server?

In my research, I see this question has been asked a few times, but generally the response seems to be somewhere between "why would you do this?", "it's theoretically possible but not practical" and "yes, but there are technical issues".
I have a real world case where push messages will originate on an iphone and terminate on another iphone. The app is designed for family/couples, who can scan each other's phones to get device tokens, and store them within the app.
Most of the questions I found around this subject are pretty old and mentioned Apple's requirement to keep the APNS connection open for as long as possible, however I am not sure if this still holds with the HTTP2 interface that is now available.
Another comment is that it is difficult, but I'm not worried about that - I've written the server side for APNS and HTTP2, so it's "just" a case of rewriting it in objective C.
I realize that certificates are an issue, and might require users to update regularly to keep it working, although I wonder if there's some way to store them and just have the app update them automatically, without needing to update the whole app. No biggie either way.
So my question is, in 2018, is it possible to implement an iphone to iphone push notification and (taking into account what I said above), are there reasons not to? I could easily make a server for it, but the less third parties the message has to pass through, the better it is from a privacy/transparency perspective, hence peer to peer would be the ideal option.

Inputs on methods for developing a VoIP application in Swift 3

I'm developing a VoIP app where I want to stream audio captured from the microphone as Data to the server. From the server side I want to send the Data out to all the participants in the conversation.
My first thought is to use AVAudioEngine and then install a tap on the microphone, convert the AVAudioPCMBuffer to Data and then use the Alamofire framework
Alamofire.upload(data: Data, to: URLConvertible) method to upload each audio frame and then sending this out to all the clients. This comes with some complications though on the client side, like establishing the connection and so on. It feels like with this solution I need to send out thousands of messages from the server all the time saying "more packages are now available".
Anyone out there that can shed some light or input on good solutions around this? Or is this actually a good way to go?
Any help, input or thought is very much appreciated.

Detecting outgoing emergency call vs Developing custom dialer app

My goal is to listen only and not modify the outgoing call event and send GPS coordinates to server from background. I'm not even interested in phone number being dialed, what I only need to know is whether the current call is Emergency call.
I've accomplished this easily in android, by following this tutorial.
However some googling showed that, this is a big pain in the ios world.
The only solution I think is to write dialer app from scratch and manage all the events by myself (if that's even possible), but I think it's too overcomplicated
I'm completely new to ios and please let me know, how would you solve this problem guys?
There is no way this will be possible on iOS unless you were planning to release and app for jailbroken phones (and even then I'm not sure it is). The Core Telphony framework has the methods you can use: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CoreTelephonyFrameworkReference/index.html

GameKit peer to peer connection issue. It takes long time to deliver an invitation to another device

I'm using GameKit peer-to-peer connection in my app and I'm experiencing the following issue: when using GKPeerPickerController sometimes it takes too long time to deliver an invitation to connect from one device to another. Sometimes devices just don't see each other. What can i do about that? Is it better not to use GKPeerPickerController at all and present custom interface?
Depending on the type of app you are trying to make, it may be more beneficial for you to have one device act as a Server and another as a Client. I've noticed from personal experience that having both devices act as Peers can take considerably longer, or just flat out not work.
The only disadvantage with the Server / Client perspective is that your users will have to specifically choose one or the other, and you will have to create your own user interface. But if you can work with that then you'll probably get better results. Good luck!

How can my iPad app subscribe to a RESTful web service so it would update automatically?

I am looking for ways where my RESTful web service can let my iPad app know to update its cached data when the server's data has been updated. The server is running on Tomcat & Apache Jersey.
Is this doable? And not using Apple Push Notification (APN)?
There are essentially two options: heartbeat check from the app to the server (on a timer) or something that keeps the line of communication open, such as web sockets. Here is an open source web socket for iOS, but I have not personally experimented with it:
http://code.google.com/p/unitt/wiki/UnittWebSocketClient
I'm not sure why you want to avoid APN, but this really sounds like what it's made for.
If you want to update only when your app is running, there are other options (straight forward polling comes to mind), but if you want the user to be notified even when the application isn't running, there isn't really any other Apple approved way to do it.
Can reverse the design around and make your device a client and pull data from a REST service at a regular interval?? With all the support one gets from REST, it might be helpful to know you will have complete control of when data is being pulled by the device from server and exactly the data that might goto device.
I'm curious to know your thoughts, Thanks.
I'll be building a web-syncing iOS application soon, and we're going to use RestKit. Take a look, it might be a big help.

Resources