Integrating frameworks without bloating the size of iOS app - ios

Is there a way to avoid bloating of my app in appstore if my app wants to support more integrations. For example i have 10 barocde integartions done in my app either as a single framework or multiple frameworks. But the user needs only one integration out of 10. So is there a way to provide the only integration required by him without unnecessarily downloading all 10 integrations either though on-demand or achieving it through inter app communication by providing each integrations as a separate app and communicating between them without any hassle or anything like services in android can be achieved in iOS so that service will run at background and broadcasts the data to the app once it receives.

Related

Technical differences between PWA and Hybrid App

What are the differences between a PWA and a hybrid app? This question was asked before but I haven't found found a proper answer to my question.
I know a PWA runs in the browser and you get a hybrid app from an app store.
But both are using JavaScript with HTML and CSS and both enable offline support and I can access native features like camera and local storage.
Once I have added a PWA to my Homescreen, it uses a web view to render the app right? And a hybrid app uses a web view as well, so what exactly are the differences between PWA and a hybrid app?
With Ionic I can even use the exact same code for a pwa and a hybrid app...
Roughly it is like this below:
web app (PWA) is just a web-site that declares certain capabilities using manifest file etc which can get it some special treatments (like leverage service worker, sign up for web notifications, go full screen etc IF target browser supports it). As a web-app it is super limited in its "privileges" on a system level (like persistence quota etc)
hybrid app (like Cordova for example) is a binary code that is "wrapping" your web-code and exposes certain "native" SDK capabilities via plugins. You can potentially also write your own plugin and in theory access any native SDK API this way. But since your main app code is still a web-app that runs inside of a webview it still has a lot of penalties like performance etc. But at least you can get things like storage etc.
native app is a binary build using target platform's SDK. That in
theory gives you max access to capabilities and performance at
expense of having to write separate code for each platform.
Makes sense?
Progressive Apps
Today, these apps only work on Opera, Chrome, and the Samsung mobile browser. However, these browsers take up only less than half of the mobile browser market.
In some devices, some of the features will not work. For instance, notifications on iOS devices will not work.
In some apps, cameras, fingerprint scanner, and GPS may not work or work with glitches.
Cordova/ Ionic based hybrid apps
Making the hybrid apps run efficiently on multiple platforms is no easy task. In some instances, it could cost almost the same as running native apps. The cost will depend on how close you want to get to the native app experience.
Since these apps will launch using a browser-like component, they are only as good as the component on which they run. Earlier, Google and Apple did not agree on the WebView. While it has vastly been improved, it does not have the same efficiency as running a native app.

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.

Sharing info between multiple iOS apps

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.

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