Is it possible for dynamic branding of the application - ios

I have the application that will connect to different servers. Each server is like different client and I want my app to look different (as far as I can) depending on which server it is connected to. I thought that I can have a ZIP that on handshake will be returned from destination server and use details from it e.g. Images, settings etc.
Is it possible, if so what is the limit?
Edit
I'm thinking about the images for logo etc. and some color lists that I can then use with fallback to defaults.

You can make all resources (images, string files, NIBs, storyboard...) be downloaded from the client server.
Also, there are several project developed exactly for dynamic design using CSS-like mechanisms:
http://www.pixate.com
http://www.freestyle.org
https://github.com/robertwijas/UISS
https://github.com/tombenner/nui
There are some project to run Javascript as well. This may allow you customise some business logic.
http://www.bignerdranch.com/blog/javascriptcore-example/
https://github.com/kishikawakatsumi/JavaScriptBridge
So, yes. It's possible, but you'll find some limitation, like the root view controller, the app delegate, etc.. You'll have to be creative.
I've never done something similar, so I can help any further then this.

It's possible for almost all elements of the application except:
Application name
Application icons
Application splash
screens
Those 3 items are bundled into application and can't be changed in runtime.
Rest of the items have so called appearance selectors that can be used to implement dynamic branding.

It is definitely possible, as I have worked on an App like this myself. We did it basically the same way you described. On startup the user selects a server to connect to and we download a zip file that contains all the assets for that client. After the download, the UI is loaded with the custom images. You can customize any UI element the system lets you, which is pretty much everything, except for minor details like the system StatusBar. You're gonna need some helper classes that make your life easier and support methods like, for example, [UIButton themedButtonWithImage:].

Well, it's possible — in one extreme, you could have an app which consists entirely of a UIWebView (plus some mechanism for selecting which server the app is talking to) that gets almost all it's content from the server.
There are performance considerations if you do (internet connection reliability, cost, and speed), and Apple may object to certain things being done on any app distributed through the app store, but assuming you follow their guidelines or distribute outside the store, the only limits that I know of are the app icon, the startup screen, and the app identifier, which have to be included in the bundle.

Related

Alternative to custom protocols (URI schemes)

I have been extensively using a custom protocol on all our internal apps to open any type of document (CAD, CAM, PDF, etc.), to open File Explorer and select a specific file, and to run other applications.
Years ago I defined one myprotocol protocol that executes C:\Windows\System32\wscript.exe passing the name of my VBScript and whatever argument each request has. The first argument passed to the script describe the type of action (OpenDocument, ShowFileInFileExplorer, ExportBOM, etc.), the following arguments are passed to the action.
Everything worked well until last year, when wscript.exe stopped working (see here for details). I fixed that problem by copying it to wscript2.exe. Creating a copy is now a step in the standard configuration of all our computers and using wscript2.exe is now the official configuration of our custom protocol. (Our anti-virus customer support couldn't find anything that interacts with wscript.exe).
Today, after building a new computer, we found out that:
Firefox doesn't see wscript2.exe. If I click on a custom protocol link, then click on the browse button and open the folder, I only see a small subset of .exe files, which includes wscript.exe, but doesn't include wscript2.exe (I don't know how recent this problem is because I don't personally use FireFox).
Firefox sees wscript.exe, but it still doesn't work (same behavior as described in my previous post linked above)
Chrome works with wscript2.exe, but now it always asks for confirmation. According to this article this seems to be the new approach, and things could change again soon. Clicking on a confirmation box every time is a big no-no with my users. This would slow down many workflows that require quickly clicking hundreds of links on a page and, for example, look at a CAD application zooming to one geometry in a large drawing.
I already fixed one problem last year, I am dealing with another one now, and reading that article scares me and makes me think that more problems will arise soon.
So here is the question: is there an alternative to using custom protocols?
I am not working on a web app for public consumption. My custom protocol requires the VBScript file, the applications that the script uses and tons of network shared folders. They are only used in our internal network and the computers that use them are manually configured.
First of all, that's super risky even if it's on internal network only. Unless computers/users/browsers are locked out of internet, it is possible that someone guesses or finds out your protocol's name, sends link to someone in your company and causes a lot of trouble (possibly loss too).
Anyway...
Since you are controlling software on all of the computers, you could add a mini-server on every machine, listening to localhost only, that simply calls your script. Then define host like secret.myprotocol to point to that server, e.g., localhost:1234.
Just to lessen potential problems a bit, local server would use HTTPS only, with proper certificate, HSTS and HPKP set to a very long time (since you control software, you can refresh those when needed). The last two, just in case someone tries to setup the same domain and, for whatever reason, host override doesn't work and user ends up calling a hostile server.
So, links would have to change from myprotocol://whatever to https://secret.myprotocol/whatever.
It does introduce new attack surface ("mini-server"), but should be easy enough to implement, to minimize size of that surface :). "Mini-server" does not even have to be real www server, a simple script that can listen on socket and call wscript.exe would do (unless you need to pass more info to it).
Real server has more code that can have bugs in it, but also allows to add more things, for example a "pass through" page, that shows info "Opening document X in 3 seconds..." and a "cancel" button.
It could also require session login of some kind (just to be sure it's user who requests action, and not something else).
The title of this blog post says it all: Browser Architecture: Web-to-App Communication Overview.
It describes a list of Web-to-App Communication techniques and links to dedicated posts for some of them.
The first in the list is Application Protocols, which I have been using for years already, and it started to crumble in the last year or so (hence my question).
The fifth is Local Web Server, which is the one described by ahwayakchih.
UPDATE (this update follows the update on the blog post above mentioned)
Apparently I wasn't the only one thinking that this change in behavior was a regression, so a workaround has been issued: the old behavior (showing a checkbox that allows to remember the answer) can be restored by adding these keys to the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
"ExternalProtocolDialogShowAlwaysOpenCheckbox"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
"ExternalProtocolDialogShowAlwaysOpenCheckbox"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium]
"ExternalProtocolDialogShowAlwaysOpenCheckbox"=dword:00000001

Where to store and access additonal content for iOS app from own server

I am trying to understand something that is not clear to me about the storage and access of additional content downloaded from my own server to my iOS app. Clearly this is possible, see the section called Downloading Content from Your Own Server . I understand how to process receipts and how to make a call to my server. What is not understood is:
When I initiate a download from my server what file type does the download need to consist of? Can it be anything I want?
Where I am a supposed to store it on the device considering the app bundle is not allowed to be updated?
How does my app access the data?
In the simplest of cases, say I am delivering an xml or json file I guess most of the above would work like this: store the file in the documents directory, use filepaths in the app to access and load the data.
However what if it is something more complex that includes say images and other data that should be accessible just like other resources in the app bundle are accessible?
The crux of what is not clear to me is what type of data can be delivered, if it is anything I desire (which I presume it is) and I have complete control of the data type, where should this data content be stored and how can I enable my app to access this data as seamlessly as possible. For a concrete example suppose I am making a game, the first level is included in the app bundle, I deliver the second level via my own server, now, can I load that level the same way I load the one in the app bundle?
If there is a link or documentation I can pointed to that would be helpful but I have not found anything just yet, perhaps it is the concept of the app bundle that is most confusing because on a regular program I can do whatever I wish and things are not so unclear.

Share objects between people who are using the same app in real-time (push)

I'm pretty new to objective-c, so i came up with this..I've found other similar questions, like mine, but there were all different at some point..
So, i have a tableview which contains cells, and the cells are containing data (NSManagedObjectModels). I have this app on 1 device, and I'd like to share these cells, i mean data, with other people, who are using the exact same app (i'd like to use only wifi or network connection).
Just like in Reminders (in iOS pre-installed app) when i create a new list, i have the option to share it with someone else(s), and the person who i've shared with, can see the list i created-immediately.
Is there a simple, or any way to accomplish that?
The simplest way would be to send a push notification to all users with a URL linking to data you want to share.
But even that means that you'll have to have a server store away details of push tokens (so you can push to each device) and then provide some way for users to group different devices...
I would look the sessions on CloudKit and see if from that you can see a way to do what you want, otherwise look at libraries that provide easy server integration to make passing data up to the server easier.

iOS phonegap app built mainly on AJAX calls

I am thinking about architecture of my new iOS app. I don't know how much of the parts of the app build as native parts of the app and how much dynamically loaded via AJAX calls.
For example admin area. I can create all the admin area as native part and load only data via AJAX. But If I want to add another form field later I will have to publish update of the application. I can avoid this by loading all the admin area via AJAX calls (not only data but also HTML structure). It would be very flexible. But it would increase amount of transferred data and I don't know if this is acceptable for Apple.
Is this structure of highly AJAX called app okey for Apple?
Thanks.
I think you don't need worry because my app has same structure than you, it loads some data via AJAX and I had no problems on App Store.
You actually can build an app like so, but this would result in a higher download for your users later on.
I agree that building an app in that way might be a solution to stop going past Apple for every update.
Kind regards,

iOS multi module application

Is it possible to create a business application (not public, like other public application in the app store) which will have a multiple dynamic modules, i don't want to keep this modules inside the app, instead i want to download it through network based on user role, save it on file system and load it dynamically, and for next time load it from file system. Is it possible also to use a In app purchase to take some fee for this module?
The iOS security model is designed to prevent you from executing code that was downloaded off the internet. Windows/Mac/Linux have had huge security problems because of their ability to execute any code presented to them, and iOS is designed from the ground up to prevent it.
Jail breaking completely disables all that security, and if you have an Enterprise developer account you'll be able to punch a few very small holes in it...
But generally, no — what you're trying to do is not possible unless the modules are written in javascript and executed by the built in WebKit engine.
You'll just need to compile it into the app. If you've got an enterprise account, then you can check for a new version on every launch and force the user to install the latest version before they can use it (create an xml file describing the new version and with a URL to the actual ipa file, tell the system to open the URL to the xml file, the user will be asked to confirm the app install, and then it will install itself).
With regard to in-app purchases, I don't think so. You'll just have to set a price low enough nobody will hesitate to buy it twice.

Resources