I have a Mac application and an iOS application. I need to display a notification on iOS, coming from the Mac app.
Is there any easier way to do it than using Push Notifications or network sockets (UDP or TCP)? Maybe Apple provides it away?
I need to make sure that the user hears this notification. The application should launch in the background and start playing sound.
If they are on the same network you can use bonjour ( https://developer.apple.com/bonjour/index.html ) for communication between mac app and iOS app.
If they are on different network you have to use a server, the server will be connected to both mac app and iOS app via tcp, and you can send msgs via the server. And if the iOS device is locked or app is in background you have to implement push notification for sending data to the iOS app.
Not sure of your use case, but using Apple's push notifications to serve notifications for your app seems like a suitable choice. Again, not sure of your use case, but an alternative may be to send a text-message using the Twilio API.
There is another option known as BLE .With BLE you can interact between mac and iOS using core bluetooth framework.
When you receive any message from mac to iOS using this framework you can show a local notification and can wake an app, since BLE also works well in background mode.
For mac to act as peripheral there is a good open source project over here.
you can find more information about BLE here.
Hope this helps.
I think the only acceptable solution is to send push notifications via APNS from mac to iOS device due to limitations on app lifetime on iOS. There is nothing hard in implementing APNS, there are lots of ready implementations, like NWPusher - you may copy it to your project and setup the environment - keys, device tokens - and you're done. To transmit tokens from iOS to your mac app, you may use tons of ways. For example, implement simple web-service on mac and send tokens via http/https.
You may also use a ready server-side implementations, like parse.com, to send push notifications.
Related
We are in the process of developing a PWA that should send out notifications that are visible outside the application and even when the application is closed. In other words, like when a native app would send out notifications.
However, at the moment this is only possible on Android devices, on iOS this is not yet possible.
So we are looking for ways to work around this problem.
One theory is to create a very small native app for iOS with the soul purpose to send out notifications.
Our PWA would create the notification and make it available via an API call.
The native app would do a request every x seconds to retrieve the notifications and display them on the phone.
The part where we are a bit in the dark about is if it is possible to make the notification that is displayed link to the PWA instead of the native app?
Yes maybe with OS X Push Notifications for Websites: https://developer.apple.com/notifications/safari-push-notifications/
I'm attempting to automate the testing of my push notifications using XCTest and Continuous Integration with Xcode Server.
As far as I can tell, I have correctly configured my push notifications, as I receive them correctly when the app is running. The issue is, when I run a test (even on a physical device) I don't receive the notification. I have confirmed on both the sending device as well as the backend that the push notification has been sent. As far as I know, you cannot receive push notifications on iOS simulators, but I am running the test on an actual device, so I was assuming this would be different.
Obviously I can check manually to see if the information is consistent through the sending device, backend and receiving device, but I was hoping to automate this entire process.
Thanks for the help.
While there is no way to deal with PNs on Simulator with Apple-provided instruments, there is magic 3-rd party toolset to help on it:
https://github.com/acoomans/SimulatorRemoteNotifications
SimulatorRemoteNotifications is a library to send mock remote notifications to the iOS simulator.
The library extends UIApplication by embedding a mini server that listen for UDP packets containing JSON-formated payload, and a service to send notifications to the mini server.
This project includes the iOS Simulator Notifications MacOSX app to help you send the mock notifications.
The new version of Pushbullet app (https://itunes.apple.com/us/app/pushbullet/id810352052?mt=8) for iOS and Mac can show you all the notifications you get on your phone inside their Mac app.
Not just the notifications going to the app itself - all notifications from all applications.
How did they manage to do that? I can't figure out which APIs they are using to do this.
In General, Apple device gives the access to Notification to BLE, so that Notifications can be shown on any onboard system like Car's Dashboard. So I think they are using ani API related to that.
This might be helpful
https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Introduction/Introduction.html
I would like to explore the connectivity options for domotics software to connect hardware on a house compatible to iOS (iPhone/iWatch/iPad).
My first thoughts go to RFID tags applied to the devices or hardware transmitting Wi-Fi signal. However I am not sure that iOS is a system "open" enough to receive external signals.
For example when developing an App is not possible to let it access the main background thread whilst in background so it would be difficut to receive notifications from external hardware. My solution would be to send those notification to the device using the push notification system and paired to a server.
Could anyone help me clarify the reality of this?
Any useful link or resources? What are the latest advances as of iOS 8? And what are the best practices for this type of problems? What are the SDKs available for RFID?
Is there a way to know when the device is rebooted in ios, like "BOOT_COMPLETED" permission in android. Went through internet and could not find and appropriate answer. Any help would be appreciated.
https://github.com/lithium3141/BootLaunch
You can refer this page but one think, if your app doesn't have voip feature means Apple will reject your application.
Apple State in their document:
https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW1
UIBackgroundModes
voip-The app provides Voice-over-IP services. Apps with this key are automatically launched after system boot so that the app can
reestablish VoIP services. Apps with this key are also allowed to play
background audio.
remote-notification-The app uses remote notifications as a signal that there is new content available for download. When a remote
notification arrives, the system launches or resumes the app in the
background and gives it a small amount of time to download the new
content.
This value is supported in iOS 7.0 and later.
voip key is the technique used most of the voip applications like skype.