Best Way to Store Device Configuration for iOS Application - ios

I am developing an iOS application that is more of a permanent install type application, and it will be different per client. So, I'm looking for the best way to install some type of a configuration on the device that the app can detect and in essence 'lock' it into a specific setting for a client. I want this to persist even if an application is deleted.
Something like a mobileconfig file would be neat, but I don't think those can contain undefined variables or be read by the applications.
I'm curious what the best and cleanest approach would be for this.

As the other answer and comments have said this cannot REALLY be done without the device being jail broken. However... There is a possible alternative.
You can use OpenUDID or SecureUDID to create a unique identifier, then create the configuration in your server database. The application will connect to your server to obtain the global configuration should the configuration file not exist. This way, if the user uses your application, then deletes the application and then reinstalls it, you will still have their configuration which the application can redownload and store locally on the device.

Related

How to pull init configuration and updated code in IOS application from backend server?

I am a new IOS developer. When designing the application, i figured that it will be probably wise to pull most of the configuration from the back-end server upon app init. In addition, i was thinking that instead of constantly upgrading the application (a hassle for users and developers) i might insert some way to update my code also on the system init.
my question - Is this approach do able? common? are there good practices for doing it (or best practices for that matter)?
Thanks a lot!
First welcome to ios programming
It is not a good practice to do so, and as far as I know it's not possible to change the code of your app after it's send to the appstore review team.
Before including your app in the appstore, Apple will create an executable file of your app which's code can't be changed.
You can use a backend service to provide different configuration options, example: you develop a chat on the app, but you want it to be shown when you change some config file on the server, so a web request to your server can be made to determine the content of the file and if has changed you could use a simple .hidden = false to unlock your chat feature
Hope it helps

Is it possible to substitute a server backend using Dropbox?

I am developing an iOS application (to be deployed on the App Store) that requires content updates on a weekly basis.
I understand that the best way to achieve this would be to use a server, where the app would query for new data and download responses in JSON. However I am not knowledgeable when it comes to HTML, PHP or MySQL and therefore am endeavoring to find an alternative.
Here's an idea: using Dropbox to substitute for a server backend. My app connects to one central Dropbox account, checks for new files, and downloads them if present.
Is this idea feasible? If not, are there any alternatives?
Dropbox cannot be a dependable substitute for your server/backend for following reasons:
Dropbox uses OAuth for authentication, which needs user interaction. You do not want your app users to go through Dropbox authentication with your 'common' credentials.
Users who have a Dropbox account or the app installed, will most likely use their own credentials to login which completely breaks your flow.
Drobox, although a good way of sharing and syncing files is not meant for more meaningful data like web services etc or user/database interaction etc. Just syncing JSON file may suffice your app's needs for now but from a long term perspective you want a proper back end.
As suggested in the comment by #tkanzakic you can use one of the substitution services if you don't want to get too technical on the backend.
I am pretty late to the party, but this is possible and not necessarily a stupid idea (though this depends on what you need). You might want to have a look at remote storage for example, which allows you to use Dropbox among other providers as backend.
For sure, you can use the Dropbox Sync API to achieve this (https://www.dropbox.com/developers/sync).

Secure Persistant Caching in an iOS Static Framework

I am currently in the process of writing a static iOS framework that connects developers to my API and returns to them objectified information at their user's requests. However, in order for this framework to be worthwhile, one of the requirements is that this framework must be able to cache the information locally and return an offline copy when a network connection is unavailable. I am aware that I can store this information in NSUserDefaults but there may be a case where the information that is cached may be private and the local developer should not be able to have access by guessing the proper key. I believe that best approach will involve some sort of encryption but I wanted to see if there were any other storage options available to a static framework other than NSUserDefaults.
I would like to keep my data in an objectified format if possible. Two solutions I would be interested in exploring would be to save my offline data in either SQLite or CoreData. However, with both of these approaches I am concerned about how these files would be stored in the framework (I already have an embedded framework) and the security issues of having the schema for these files available in the bundle for the developer to see.
Another solution that I am looking into would be to see if iOS supports any tools such as gzip that could be used to password protect my files until they are used by the framework.
Has anyone successfully overcome any of these issues? Is there anything else I should be looking into besides the previously mentioned possible solutions? Any advice will be warmly welcomed.
Thanks.
P.S. Does anyone know of any resources I could go read relating to iOS Security or static frameworks? Either would be very helpful.

Setting up a file server for integration with iOS apps

I need to set up a server so that files can be uploaded from an iOS app. I don't know how best to proceed. I thought about FTP but not sure if there is a better option.
any ideas appreciated
GC
Also I must add that I will be building the iOS app so can use server APIs in my code.
It's not ideal to set up a blind File/FTP server and hardcode the details into your app because all it takes is one person to intercept the login details and they have access to your server where they can upload (and potentially execute) bad things.
A possible idea could be to set up an API frontend on your server in a language of your choice (PHP, Ruby, Python or similar) where you can 'POST' images to the server. With the API frontend, you can also do validation to ensure that only valid images are being uploaded and all nefarious stuff is thrown away. Then, in your iOS app, you can set up code to interact with your API frontend and send the actual images which will then be stored on your server.
This is a fairly conceptual idea rather than an absolute implementation idea. It does require some thinking/reading and more setup/coding on the server side.
Edit: Just to add, if you only want a central location to store/get your images without controlling it on a per user basis then you may want to look into Amazon S3 as a File Server.

iPhone: Sharing data between native and webapp

I would need to share data (not necessarily a large amount) between a native iPhone app, and a safari/webkit javascript app... Do you know how this could be done ?
I considered sqlite.. But it seems an application can only read/write inside its own bundle (so, not in the webkit databases directory), and the other way, i guess javascript can't access an application directory.. right?
Could there be a shared folder that both could access? Not necessarily with sqlite..
I thought also of pasteboards, but they don't seem to be interoperable; and moreover, another app could overwrite the pasteboard in between...
Do you have some other ideas?
You really can't. You can get some data from the JS app to a native app by having the JS app use a custom URL that the native app has registered to invoke, but aside from that you won't have much luck.
You can, of course, share the data through a server somewhere else.
The simple answer that you probably already thought of but decided against would be to have the iPhone and web application both download information from an external source (say, the web site that you're hosting the webapp on). Of course this means that your data is external to the phone which is probably why you're asking this question.
Another approach might be to register your native application as a protocol handler. Not sure how that would work as I've not played with that functionality.

Resources