how to send data from airwatch to ios app - ios

I'm a junior ios developper trying to communicate with the MDM server : air watch.
I found lot of topics talking about getting the data from the MDM server in my app (like Using MDM To Configure An Enterprise App Via NSUserDefaults and https://www.devexpress.com/Support/Center/Question/Details/T224565) but I cannot find any tutorials on how air watch send data to ios app.
Does anybody face the same problem or have links to help me get through ?
Thanks in advance !

This will work: AppConfig
Implementation in iOS is much simpler than Android

I am not sure what data you want to send down to the app, but syncing application data is usually not the domain of an MDM/EMM solution. I would use either use Apple APNS to publish to the app (directly or through a 3rd party provider) or use periodic polling initiated from your app to fetch you data. A common pattern is to publish a small payload to the app (e.g key-oriented data) and then let it fetch the real application payload using the Apple networking stack
If you use APNS and your enterprise is averse to opening your network to the internet (very common), consider a 3rd party provider like UrbanAirship, Azure,... They handle the initial token handshake as well as provide nice group messaging and other features. Good luck.

Related

iOS/Swift: Quick & dirty way to send a notification to another device?

I'm trying to write a super-simple iOS app, just for personal use (i.e. it doesn't need to conform to any App Store stuff). I want it to do the following. Assume it's installed on two devices, both of which I own/control.
On device 1, it has a button that, when pressed, will immediately cause a notification to pop up on device 2.
I'm fine with hardcoding specific apple IDs, device IDs, whatever; it's also fine if this only works when the two devices are on the same LAN/Wifi. all I want is for the above to work, in the easiest way possible, and preferably without needing anything to run on a server anywhere.
How simply can this be implemented? I've set up a whole push-notification system once before, but that required some server-side stuff. Hoping to be able to do this without any of that.
====
Update: realized I wasn't clear in the original post that I need the notification on Device 2 to pop up whether or not the app is currently open/running on that device.
I think that what you are searching for is multipeer connectivity framework.
The Multipeer Connectivity framework supports the discovery of
services provided by nearby devices and supports communicating with
those services through message-based data, streaming data, and
resources (such as files). In iOS, the framework uses infrastructure
Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area
networks for the underlying transport. In macOS and tvOS, it uses
infrastructure Wi-Fi, peer-to-peer Wi-Fi, and Ethernet.
source: https://developer.apple.com/documentation/multipeerconnectivity.
You can also check those tutorials:
https://www.ralfebert.com/ios-app-development/multipeer-connectivity/
https://www.hackingwithswift.com/example-code/networking/how-to-create-a-peer-to-peer-network-using-the-multipeer-connectivity-framework
Send sms to port is a way (the protocol will become SMS): https://developer.apple.com/documentation/foundation/nsportmessage
and Maybe Firebase Remote Config can help you: you can get your data in FCM remote config (key-value) from the app :
https://www.raywenderlich.com/17323848-firebase-remote-config-tutorial-for-ios
https://firebase.google.com/docs/remote-config/get-started?platform=ios
, and you can modify your data whenever you want, and the app can fetch it.
I have similar requirements, and it seems like APNS (Apple Push Notification Service) is required for this because it's one of the only ways to 'activate' an application that is in the background.
As a result, then the question is how to make APNS as painless as possible? It seems like combining Firebase Cloud Messaging (or FCM) (to manage APNS / sending messages), and Firebase Functions (to help manage FCM server-side requirements) is one decent option.

Using Firebase Notifications cross platform

I'm searching for a solution for push notifications. For me Firebase is really attractive.
My question now is can I use it cross platform?
I think Firebase is a google service and thus will require the Google PlayServices, right? How can I consume Firebase Cloud Messages / Notificataion in my iOS App or Windows Store app.
I have a own backend where all the auth stuff and data is, but because I want to save time I don't want to implement a own solution
Is this possible or not? Or can you recommend me any other framework/service?
Yes, it's possible. FCM routes all of your iOS notifications to APNs, so by the time these notifications reach your iOS device, they look just like any other iOS notification.
If you want all the nitty-gritty details, this video might help.
In addition to Todd's answer
I think Firebase is a google service and thus will require the Google PlayServices, right?
Yup. For Android devices.
How can I consume Firebase Cloud Messages / Notificataion in my iOS App or Windows Store app.
Like Todd said, FCM forwards the messages for iOS devices to APNs. There is currently no Windows Phones client for FCM.
I have a own backend where all the auth stuff and data is, but because I want to save time I don't want to implement a own solution
To use FCM effectively accross different platforms, specially between Android and iOS, it is important to note that the behavior of message types are different to both.
Update: A recent feature was added for FCM that gives an option to provide specific params for supported specific platforms, called Platform Overrides.

iOS communication with backend using APNs

How do I send push notifications to my iOS app? I need to send small messages even when the application is in the background or not running.Is there a simple tutorial. I searched a lot and only found third party solutions. Is there a direct way to access APNs, and if not which third party should I go for.
To send remote notifications, you need your own server that is authorized (you can grab a remote notification certificate from your developer account from developer.apple.com). Then you just follow Apple's API to send a notification to a specific device.
I followed a Ray Wenderlich guide a while back and found it useful.
However, you might not want to set up your own server and stuff. This is where third-party solutions come in. I've worked with Parse's push notification system and found that it is pretty easy to set up.

iOS Push Notification not sent from server (Jetpack)

I'm implementing an iOS application to manage my self-hosted website. My app make use of the many features already built for WordPress-iOS app, but it has differences and extra features.
One of the problem I'm currently having is that push notification was not sent from Jetpack (WordPress.com server) to Apple's APNs, because I'm not getting any notification on my device. I have already registered successfully my device token with Jetpack during app launch.
My problem could be the certificate key (.pem) file not getting uploaded to Wordpress.com (which I do not have access). Is this the reason why I'm not receiving any push notification to my iphone?
Additionally, I'm not getting any result on the NotificationsViewController. I do not have Simperium account setup yet. Could that be my problem for getting no results in NotificationsViewController?
Many thanks.
Sorry about the delay!. For the time being, i'm afraid that WordPress iOS doesn't support 3rd party apps integrations with its Notifications stack.
Meaning that if you'd like to handle Push Notifications support, you'd need to implement a WordPress.org plugin to handle the APN message delivery.
As per the Simperium side, there is no 3rd party app support -at least for now!- due to security restrictions.
If there's anything we could help you with, you may find us on the WordPress Slack (#mobile channel!).
Best,
Jorge

Is Inter Process Communication possible between iOS applications using Sockets?

I have gone through a lot of articles on internet and most say that IOS applications allow IPC using protocol handlers (URL Schemes). But, Can't we achieve IPC using sockets, if one application opens a port and the other tries to connect to it ?
iOS8 introduced IPC support by exposing mach ports for so called "application groups". Check out this great tutorial:
http://ddeville.me/2015/02/interprocess-communication-on-ios-with-mach-messages/
It requires a bit of setup (to define application groups in dev portal, generate proper entitlements, etc..) but is not really so difficult and Xcode 6 does most of the job automatically (just enable "App groups" in general capacities section).
I can confirm, it works (I was able to create 2 apps sending messages to each other).
On iO7 there is no official support for IPS, but If you do not plan to upload your app to AppStore, you could try to exploit inter-app audio communication to achieve this.
Check out Apple's code sample, which demonstrated inter-app sound data stream between 3 apps:
https://developer.apple.com/library/ios/samplecode/InterAppAudioSuite/Introduction/Intro.html
Associated WWDS video:
https://developer.apple.com/wwdc/videos/#602
I haven't try to exploit it for non-audio usage but can't see the reason why shouldn't it work. Data rate is great, and sound data are just bytes and do not have to be redirected to the speaker, but interpreted however you like.
Of course, it will be rejected in AppStore review, but it is still fine for enterprise or own usage.
No, it is not for several reasons. 1) Apple does not allow this internally and has security layers to prevent this. 2) Applications fire applicationDiD/WillEnterBackground after a short delay, at which point the way you can interact with it plummets.
If you really want to send data between applications, set up a server with certs to match your app so you can use APN (apple push notifications) to send data in silent pushes to applications. Then, set up endpoints on the server that trigger those sends, and have apps consume the API that the server exposes.

Resources