Can I have an app inside another app? - iphone

I am having an issue integrating iPhone apps. In one of my previous posts, I asked about creating a static library from an Xcode project..
As an alternative, I am searching for a way to put an app inside another app. Because both are large apps containing lot of classes, images, sound files etc. Most of the class names and resources names of the both apps are same. So the static library concept will lead to name conflicts, which is very very tedious for me to fix. So I am trying to switch to this app-inside-app concept.
Consider I am having an app. I want to put my second app inside the app by putting the ".app" file of my second app inside my first app's ".ipa" file or somewhere inside the first app. Now I want to call my second app from my first app to run independent of the first app.
My concept is, both my first and second apps are seperate apps. I want to put them in a single ipa file. Only one app (ie., my first app) is shown when I install the ipa file. My second app is also gets installed but its not shown, because it is inside my first app. So that I can call my second app only from my first app.
This is what I need to do..
Any suggestions..
Thanks..

You can't do this. The method of putting apps on an iphone is fairly strict about how it works. And you cannot put 2 apps in a single bundle on the app store. You would have to ship 2 apps, instruct the user to install both, and then one app could launch the other app via a registered url protocol. And that sounds lame for this case.
And as you found, ObjC's lack of proper namespacing makes merging this code sort of hard. Perhaps you could simply prefix all of the libraries classes. A simple find and replace should be able to do that. This is the general approach for sort of fake namespacing code in a C dialect that doesn't support real namespacing.
Instead of Person and Person, you would have Person in your main app code, and MLPerson in your lib where ML is a cool 2 letter prefix for your library (I abbreviated MyLib to get ML).

Related

iPhone : Manage localization from server not from bundle

Adding strings localization files in iPhone bundle is very simple and perfectly fine but there is only one drawbacks every time we need to upload new build on AppStore when we add new language in app.
Is there any other way like we can manage Localization from server, when we start app we download all label string and Localiza image from server and stored in document directory and run accordingly. Download data according to language...
So can we do like this and the main things Apple can reject that kinds of scenario ?
Yes. Actually we used that way and there were no issues with Apple.
I confirm no problem with Apple too, just note that you won't be able to override the localizable.strings file. You have to create your own way to store and read the strings. It means if your app is already in development, there will be some effort for an application-wise refactoring.

Is a Dynamically Linked Framework possible on iOS?

The keyword here is possible. I know of a few resources that talk about this and how to create static frameworks - here: https://github.com/kstenerud/iOS-Universal-Framework and here: http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/
I'm interested to see if it's possible to create a dynamically linked framework in an app that will not be submitted to the app store. I know it's impossible to write to the application bundle on a device without jailbreaking it. Is it possible to say, download a compiled framework file, put it in the documents directory and then access it via the application (think plug-in architecture). I know that if it is, you would be turned away from the app store for submitting it, but let's say this was an enterprise app, or an ad-hoc distributed app where Apple would not have to approve.
In my initial research I haven't found anything supporting that it is possible, but I feel like this may be such a fringe case that no one has published anything about it. Looking for a guru to give me a definite "no" before I give up.
not sure if this is what you are after but according to Apple there dynamically linked libraries even usable in iOS - for example the system libraries... XCode contains copies of them and references them via symbolic links...
see near the end of this http://developer.apple.com/library/ios/#documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/iPhoneOSFrameworks/iPhoneOSFrameworks.html#//apple_ref/doc/uid/TP40007898-CH6-SW3
just an idea:
put the .dylib + include files you want to use into the respective folders where XCode expects the system libraries... use themn and then put symlinks into your bundle on deployment... let the symlinks point where ou copy the .dylib
I believe the answer is no. Apps on the iPhone are sandboxed. That is, aside from Apple supplied frameworks, an app cannot access anything outside of its own build.
This is possible now with IOS 8 Xcode 6.

xcode project with apps in app

I am somehow new to objective-c and iOS.
My question is as follows:
I have created 5 iphone apps until now. What I need now it to create a new project that will include all other applications in it. So the user would by 1 application and then from a uiviewcontroller he could launch the individual apps bundled in the application. Like an application bundle for the iphone. I have seen lots of this on the app store especially with games.
I have been searching for an answer for a week now. The only thing closely related that I found is related to targets, but how am I supposed to launch the individual targets from within the main app (if this is even possible).
Can someone please point me to the correct direction? A tutorial or an example would be great.
Thank you all in advance.
Cheers!
Check for any duplication in naming classes and resources in all your projects. Since you want all your projects in one project, you have to eliminate duplication.
Copy the classes and resources to your new project (please keep things organised by using folders for your classes and resources).
Identify the root view controller of each app (where the app starts) call it from your new root view controller.
You need to keep every mini app separate, get rid of all of the app delegates when you copy them in. Each mini app needs its own way of launching, most probably through present modal view controller.
Just have the main app handle all the loading and app delegate stuff.

Unable to have two versions of the same app on the one iphone

I have two versions of my app. I'm trying to keep a copy of each on my iPhone for testing purposes.
In my build settings, my bundle display name is ${PRODUCT_NAME} and I've given each version of my app a different product name (eg "v92" and "v10"). When I install each version to my iPhone, they both appear side by side with different names, however one will work normally, and the other will immediately close the moment it's opened. If I delete the version that works normally, the other will start working.
Does anyone know what's going on?
I think the apps are distinguished on the device by the App Id and not the product name. I dont know how you were able to install two apps only by changing the product name. When i mistakenly installed a different app with same app id but different product name the original app was overwritten.
Try creating a separate app id for the new version only for testing. That might solve your problem but make sure you use the correct app id when you submit your app.
EDIT: It might not be the right solution if you are doing some app id specific stuff (like APNS) in you app.
I ran into this one too and eventually solved it. I know the solution had to do with changing something in the information property list, but I'm not sure exactly what. I would suggest making sure that all of the following are different for your two versions:
bundle display name
executable file
bundle identifier
bundle name
At least you can create two app id's and two provisioning profiles in your developers account. Then you'll be able to install your 2 versions like a two different apps. It's an ugly solution, but it definitely works.

How do I make iPhone SpringBoard show two or more icons for one application bundle?

It seems like Info.plist file has an ability to declare different roles for the same application bundle through the UIRoleInfo key. SpringBoard can recognize these roles after installing an app and may display separate icons for each application role.
For instance, iPhone shows MobileSlideShow.app as 2 different programs: Photos and Camera.
Unfortunately, there is no official Apple documentation about the subject at the moment. Would anybody advise how to organize the same behavior in a custom app?
This feature is going to be used in the Enterprise product for ad hoc distribution.
This isn't a supported feature, so if you do this you might have a hard time getting your app through the approval process. I wouldn't recommend using it.
Have you tried it to see if it works? If it doesn't work, you could create a second app that does nothing but launch the first one, with a custom URL scheme. The first app can recognize when it is being launched with that URL. This is not ideal as you will see the second app launch & quit (though it should be really fast).