Sharing info between multiple iOS apps - ios

By "legally" I meant methods which will be accepted to App Store.
I have read this one, but I feel that it could be out-date (a question and most answers are dated back 2008)
How to share custom data between iPhone applications?
And these provides minimal info:
Sharing files Between Apps on iOS Devices
Sharing data between different apps in the same iOS device
As I understand these methods are
Completely legal
1) UIApplication openURL
2) Keychain can be used if both applications are developed by the same team
3) iCloud could be used if both application are developed by the same team
Grey area.
4) Global notification using CFNotificationCenterGetDarwinNotifyCenter, CFNotificationCenterAddObserver, CFNotificationCenterPostNotification
5) Use TCP/IP sockets (if one of applications run in background)
6) Use Unix sockets (if one of applications run in background)
7) Use custom UIPasteBoard
Did anybody got rejected or accepted who used this?
Does anybody know any other methods?
-- Update 1--
Both apps will be running on the same device.
There is a chance that one of the apps will be running in the background (VOIP)
Apps will be developed by different teams (won't be signed with the same certificates).

i would recommend using icloud because apple sends the files to all devices, and you can get the files in both apps using it. if you want to do it with someone elses apps, you would have to ask that developer. but icloud is probably the easiest and fastest way.

What about using a service like dropbox? It's used by quite a lot of apps, and I think they provide a rich API.

Related

Is it possible to run an iOS app store?

I would like to know that is it possible to implement and run a new app store for iOS apps? I know, iOS devices must download apps only from AppStore, but is there any way to run an independence iOS AppStore website or app?
The answer is NO. period.
3.2.2 Unacceptable
(i) Creating an interface for displaying third party apps, extensions, or plug-ins similar to the App Store or as a general-interest collection.
App Store Guidelines
Jailbreak app stores: something like Cydia. You can do pretty much anything with / on jailbroken devices.
You can easily create a website that is a subset of the official AppStore with different filters / rankings / search capabilites etc. In the end you can only support the apps available in the real AppStore since that is the only place to install apps from
Create an entire development environment and ecosystem to create apps which can be installed inside your new AppStore2.0 app. But good luck doing that complex task and good luck getting it through the apple review process.
Enter to Apple enterprise program - https://developer.apple.com/programs/enterprise/

Host native iphone app on server

I have a native iOS application, I want to host it on my own server, and provide a link to download it. I am relatively new to this field and dont have much experience with hosting apps on server. So it would be great if somebody could help me with the steps.
Thanks
Why not just let Apple host it in the store?
Consider taking a look at distributing the app using OTA (Over the Air) assuming you have an Enterprise Apple Developer Account.
There's a guide here: http://aaronparecki.com/articles/2011/01/21/1/how-to-distribute-your-ios-apps-over-the-air
Or here: https://longtrieuquang.wordpress.com/2014/08/01/how-to-distribute-your-ios-app-ota-with-enterprise-account/
For various reasons, it is terribly bad practice to host iOS apps on your own. For starters, there is absolutely no quality or signature control. There is also no assurance for the user that what they are downloading is safe.
For this reason, Apple pretty well has it locked down that you HAVE to have your app in THEIR store, and nowhere else.
Even if you could provide the binary, good luck getting people to ever download and install it.
Android is very similar in this respect. I host my own apps from my own servers. But only for development purposes. Production is all handled by Google Play (and Amazon). I never expect anyone will actually download the local version. And I don't blame them.

Can iOS apps communicate via sockets?

I'm going to develop few apps for iOS. Can they communicate to each other via sockets? Let's say one app runs as server (even in background mode) and another as client connects to server app and perform some communication. Does it violate any App Store rules? Any available IPC in iOS if my idea is not working for some reason?
Of course you can and it doesn't violate any rules.
Just just the CoreFoundation libraries.
There's no point in me describing it to you if it already has been all written in the official Apple documentation:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/UsingSocketsandSocketStreams.html
You can find here examples, all approaches and things you can and cannot do.
EDIT:
You didn't make that clear but it seems like you wanted the apps to run on the same device. You can do that but that would mean that one app has to run in background, and to do that you need some kind of hack (for example: background updating location mode ON) and that won't get past apple store. You need a very good reason to have your app ran in background (music in background, update location in background for fitness apps etc.)
Besides, it's a duplicate question:
iOS - Is it possible to communicate between apps via localhost?
As long as your apps are in the same app group, then yes, socket IPC is allowed. If not, then no. Sockets map to file descriptors (Berkeley sockets), and these files are sandboxed to the app or app group. More info: http://ddeville.me/2015/02/interprocess-communication-on-ios-with-berkeley-sockets

iOS - Screen sharing in Perfecto Mobile

We were exploring various test suites for mobile automated testing and ran into this company called Perfecto Mobile. One of the features that blew me away was they are able to (without jailbreaking) effectively perform a "Remote desktop" on a physical iPad.
So, the iPad's screen is mirrored within a web application, it can register touch / swipe events on the web app and perform them on the device. The only relevant technical detail I have is that all this is being performed using commands sent over the USB cable.
I'm really curious as to how this is implemented and details on relevant Private APIs if any.
Thanks,
Teja
I'm not familiar with PerfectoMobile, but I can give you a few pointers on how this can be accomplished:
For the mirroring, one way would be to look at using AirPlay, the APIs are pretty well documented, but not to do what we're talking about which would require some serious reverse engineering, but it's definitely possible, these guys have done it. A different approach would be to run a background app that would periodically take snapshots of the main screen, and send them over a socket connection to a client. You could do this as a VNC server, and to incorporate the remote view in a web app, you could use noVNC. As far using a USB connection, in the case of the background app talking to a client over TCP, you could to a port forward.
To actually perform on the device the touch events sent from your remote viewer, most people have been using the GSEvent group of functions from the GraphicsServices private framework without needing to jailbreak the device. Again, a background app would receive over a socket an instruction such as "Tap there", instantiate the GSEvent, and inject it so it gets processed in the run loop of the most front app.
These few possibilities, at least, have been implemented successfully in different iOS apps up to iOS 6.1 (iOS7 is a different animal). You won't find any such app in the App Store, since Apple clearly prohibits the use of private frameworks in 3rd party apps, instead people deploy them in-house using Enterprise and ad-hoc provisioning profile. On Android however, there's VMLite available in the Play Store.
If you looking to share screen from ios / android, check out skreen.me. They have sample apps you can try out, also they provide libs for mobile app integration.

What is Sandbox in iOS? Can I transfer data between one app to another app?

Is there anything like sandboxing an iPhone Application, what are the benefits on using sandboxes and do they allow me sharing data between one app and another?
I found this link while searching but not able to understand as I'm new to iOS development.
http://www.iphonedevsdk.com/forum/iphone-sdk-development/56207-what-is-sandbox-in-iphone.html
From The iOS Environment
For security reasons, iOS places each app (including its preferences
and data) in a sandbox at install time. A sandbox is a set of
fine-grained controls that limit the app’s access to files,
preferences, network resources, hardware, and so on. As part of the
sandboxing process, the system installs each app in its own sandbox
directory, which acts as the home for the app and its data.
one solution to transmit data from one to another app is via URL Schemes
Mobile device application developers use the sandboxing capability of iOS to ensure the security of the user data and to ensure that the application don't share data with other applications installed on the same device.
The sandbox forms and maintains a private environment of data and information for each app.
The sandbox can minimize the damage that can be done from a potential hacker but it can't prevent the attack from happening.
Although Apple has built robust sandboxing features into iOS , it is upto the developer's to ensure that their apps are written securely.
When an app is installed on a mobile device, the system creates a unique directory for it.
Sandboxing only prevents the hijacked app from affecting the other apps and also other parts of the system.
iPhone apps are all sandboxed, meaning there is no sharing of files between applications.
There are some ways of transferring data between applications but they're very limited. Look at URL schemes.
http://wiki.akosma.com/IPhone_URL_Schemes
The apps are in sandbox by default. You do not need to worry about putting it in a sandbox manually.

Resources