iOS Inter App Communication in Background - objective-c

There is a platform application which connects to the remote server and stores required information in its local repository, that is in CoreData. I want to develop my application over this platform app. Since it is not possible to access its local storage, I have to communicate with it somehow. I am able to send/receive data using URL Schemes; however it's frustrating for user to switch between apps constantly.
Is it possible to communicate with another application via URL Schemes (or any other way) without bringing it to foreground?

With few exceptions, such as receiving CoreLocation data in the background or being notified to wake up by a local notification, it is not possible in iOS for an application to "run in the background"

This is a pretty common query on Stack Overflow, the official iOS reply can be found here
There are SO articles here and here.
Background data exchange is however not going to be a thing as there are restrictions on background app rules (so the URL transfer is going to foreground your second app)

Related

Is it possible to receive MT4 alerts in code-readable form (E.g. webhook, API call, file etc) instead of as a push notification?

I'll be using a 3rd party MT4 EA or Indicator which can send push notifications or display an alert on the MT4 desktop screen. Is there a way to access these alerts somehow in code that I have running on a standard web server (for example by my code somehow receiving the push notification instead of my phone), or alternatively running e.g. in Python or whatever on the same VPS (or physical PC) that I have MT4 terminal running on, and reading the filesystem (if alerts are written there?) or communicating with the MT$ process somehow?
Thanks

How does apps like Whatsapp or telegram listen to the incoming call/message events on Android?

I built a VoIP calling app which maintains a persistent connection with the server to listen to any incoming calls. I implemented a background service to do this.
But since Oreo, this running code is now broken because of the introduction of Background Execution Limits
After looking into forums, I found that some people are suggesting
Convert Service to JobService and let android schedule it
Doing so, my app won't be able to receive calls when it is stopped
Run your operations in foreground services
It is annoying for some users to see a constant notification in the notification bar. So these above-mentioned options aren't working for me to fix my code for Oreo.
How does WhatsApp get the incoming (VOIP) call in Android (Oreo onwards) working around the Background Execution Limits?
(Sticky) foreground services are not affected by the restrictions. So you could use one those as replacement for background services on Oreo.
But foreground services have two disadvantages: They are less likely killed by the system in order to reclaim resources compared to background services, and hence affects the Android system's self-healing capability. And they require you to display a permanent notification. But Users are able to suppress the notification, somewhat mitigating this disadvantage.
I am assuming that you are using SIP to establish the connection and initiate calls. Without a service constantly re-sending REGISTERs, the app doesn't receive INVITEs when the server sends them.
A workaround for this problem is what is called the "push notification strategy". It works as follows, when the server sends a INVITE, it also sends an FCM notification to your app, This wakes up your app which then sends a REGISTER to your server, which in return forks the call to your app. Here is a video that better explains this strategy
There are two options:
use platform push services (APNS or FCM)
maintain persistent socket connection and exclude application from battery optimisations.

ios 7 fetch offline message from xmpp server

I am developing chat application using XMPP protocol.
My development target is iOS 7.0
Every think is working fine user can able to communicate only when they are online.
But I want to notify user message has come when they are offline.
I have tried iphone XMPP App run background
But it doesn’t work for me.
First think it is possible or not?
Using what VIOP, background fetch or some other way?
If yes please let me know. how?.
The thread you are referring mention declaring that your app is a VoIP app to be allowed to constantly run in background.
It is technically possible but has two drawbacks:
If your application does not do voip, Apple will reject it (as misleading).
Battery consumption will be excessive as you will stay connected.
The state of the art is to fallback to Apple push notification service when the TCP connection between the client and the server is not established. This is battery efficient and provide a very good way to notify the user of new messages.

IBM Worklight Offline Support

we have an app which uses JSONStore to support offline, if device is offline and user submit data it stores it offline, now when device is online and when user login to the app it sync with server and submit all data to server.
the question is, Is it possible when device comes online then my offline data sync with server without user open my app ?
Does worklight support that? Or I have to do something else?
please advice
Like Idan said, Worklight does not support this, but depending on the OS, it could support it.
For instance, on Android, you could use BroadcastReceivers to detect changes in network connectivity, and execute an action when it happens, regardless of whether your app is closed or not.
Here is the API for the receiver: http://developer.android.com/reference/android/content/BroadcastReceiver.html and here is a SO answer explaining how to use it to detect WiFi connectivity: https://stackoverflow.com/a/22626736/2245921 So you can modify this BroadcastReceiver to run the sync code that you would normally do if your app was already open.
If you are using any other platform (iOS, Windows) there might be an equivalent that you can use.
Also, keep in mind that if you are doing a hybrid application, you can create your own Cordova plugin to execute native code from Javascript. Here is the documentation on how to do so: http://cordova.apache.org/docs/en/3.5.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide

Interact with Metro application from Win32

I have a traditional Win32 program which gets some data using WMI (and it cannot be fetched using API available to Metro apps). Now I want to make a tile with part of this information. As I've understood, it's impossible to simply send this data from Win32 program to the Metro application. What's the preferred way to do such thing?
There is no direct app to app communication method. What you want to do can be accomplished in several ways, however. Your Win32 app could write data to a location on the file system that a Metro style has access to. Also, you could synchronize your Win32 app with your Metro style app using the cloud. You need to be careful, however, as this might violate some of the app certification requirements.
If you are simply writing something for yourself (not concerned with publish your app), you might consider taking the functionality that currently have within your desktop app and encapsulating it within a wcf service running on localhost. Metro apps can call wcf services.
One option would be to have your Win32 program create the tile XML and deposit in Windows Azure storage (or really anything accessible via a URI) and then your Windows 8 Store application could subscribe to that tile via a Periodic Notification.
There are some constraints here which may or may not be relevant to your application - like the refresh rate of the tile (discrete periods from 30 minutes to 1 day) and the machine must be connected to the network when the poll from the URL is made.
You might be able to incorporate a background task to do something similar.