1

I have an iOS app that communicates with a web service, this product will be licensed to customers for their employees. Each customer will have to install the web service on their own server and provide an IP/URL for the iOS app to communicate with. Right now, the web service URL is coded in the app. I won't know the customer's web service URL before giving them the compiled app.

I don't know enough about enterprise distribution to know how to do this. Do if I need to compile the app for each new customer with their specific web service URL, then give them the app? Or is there is another way this should be done? I was thinking a plist file or manifest that can be configured with the URL but I'm not sure. How do they update that and get the app to use that? I had a developer make this app for me and they said the URLs shouldn't be in manifest/plist files.

I can't find any information about this on the apple developer site or on this site.

Heinrich
  • 1,711
  • 5
  • 28
  • 61
  • Off topic, but perhaps you should format it as **iOS** and **enterprise distribution** instead of `iOS` and `enterprise distribution`. – Nicolas Miari Oct 01 '15 at 01:30
  • Are you providing the exact same binary to different customers? Do you get to know the actual URL for each customer at some point before deploying the app? – Nicolas Miari Oct 01 '15 at 01:33
  • @NicolasMiari The only thing that will be different for each customer app is the base web service URL. I won't know the URL before deploying app to the customer. I would like to send the same binary and have them set the URL somehow. – Heinrich Oct 01 '15 at 01:39
  • 1
    I can not think of any means of having the customer set the base URL for **all** its users automatically (i.e., not having each user have to enter it manually on first launch) without some sort of MDM... On a less sandboxed environment, you could have the app read the URL from a text file saved to a fixed location... – Nicolas Miari Oct 01 '15 at 01:48
  • 1
    It depends a little on the relationship you will have with the customers. If you know who they are then you can sell via the B2B program and provide a customised app for them; This also requires that the customer join the B2B program so may not work. The other option I can think of (aside from configuring each individual device) is the one suggested below where you run a server and users have to enter a "client id". Your app then access your server and retrieves the web service URL for that client id. You can do that with something like Parse.com very quickly – Paulw11 Oct 01 '15 at 02:10

2 Answers2

1

You can just add text field in your app settings or at the start where user can define its server URL like www.abc.com For all your customer rest of your path (webservices/yuorservice or what ever you use)will be same . Then you get this url and save in your user defaults to use it for the future for that user. Using this approach you only need to compile app one time for all the customers.

Imran
  • 2,985
  • 19
  • 33
  • 1
    I was thinking to do something like this but I want one admin to be able to configure the URL for all users instead of making each user do it. This still might be the best solution besides using an MDM. If I make the URL an entry in a plist file, will the app pick that up when the customer distributes it to their users? – Heinrich Oct 01 '15 at 01:36
  • 1
    Well then how the admin will know the user as user is not connected to the server as you still have to define. Like you company A have 60 employees al downloaded your app how you will know you need to define for company A. TO over come this either user should define base URL or In the start who ever downloads app should be connected to one server central then user enter company name on base of that name your central server return url to app and app save it for the future communication with that server. – Imran Oct 01 '15 at 01:41
  • 1
    I think either of this approach should work for you I use same when My app was also enterprise and have to distributed to different hospitals all of those have their own DB and web services. – Imran Oct 01 '15 at 01:44
  • 1
    Using a settings bundle and NSUserDefaults may work best - if the client has MDM then they can pre-configure the default when they deliver the app - https://developer.apple.com/library/ios/samplecode/sc2279/Introduction/Intro.html and if they don't then they can simply manually configure the app – Paulw11 Oct 01 '15 at 02:13
  • @Paulw11 The client has an MDM, I'm not sure which one but I think it's MobileIron. I will have the developer look at the sample project link you sent. If you add NSUserDefaults to the app are all of those accessible and compatible by all MDMs? Or is there more to it than that? – Heinrich Oct 05 '15 at 20:01
  • Mobile iron should be able to support managed app configuration. Apple made it available some time ago so I would expect major mdm vendors to support it by now – Paulw11 Oct 05 '15 at 20:11
1

App has no knowledge of manifest file

Your developer is right--you should not include any app-configuration information in the manifest file, since the app has no knowledge of the manifest file or web page that it was downloaded from. Here is a link to an answer I gave regarding this topic.

Enterprise deployment rules

Apple only allows enterprise deployment internally within a company. So, distributing an App through your enterprise license to multiple companies is prohibited.

Approach

I can think of one option that might work for you, given that you have a URL that should change for different customers.

This assumes that you will employ a login.

Devices

Your login web service response to the device can include the URL that is configured for that customer. This URL can be one piece of data inside a configuration file in JSON format.

Web Server Admin Page

You can optionally employ an Admin page, also accessible through login, where your customer can set the URL, and any other settings. The advantage of including an admin page for your customers is that they are able to manage the product on their own, without the need for additional product support.

Community
  • 1
  • 1
Sheamus
  • 6,506
  • 3
  • 35
  • 61
  • I am not distributing through my own enterprise license. I am developing the app and web service and selling it to different companies so they can distribute using their own enterprise licenses. There is no central server under my control. The whole solution, ios app and web service is the product that each customer will control. That's why I will have no knowledge of the web service URL. They need to install the web service and give the iOS app the URL. – Heinrich Oct 01 '15 at 01:56
  • 1
    I would recommend that you at least set up an Admin page, which would make the installation and setup a smooth process for your customers. You would incur the extra cost of maintaining server-side logic and a domain name, but I think it would be worth it. It would also provide you with more scalability as your customer base grows. – Sheamus Oct 01 '15 at 03:13
  • I'm not clear about using the admin page approach. If they enter their URL (for the app's web service) through my admin page, do I take that request and manually recompile the app with that URL before the IPA is sent to them? Or is there an automated process you're thinking of when suggesting this? So I don't have to be involved in every admin request. – Heinrich Oct 01 '15 at 15:21
  • Yes, you don't have to get involved. The admin page can be hooked up to a back-end that stores the URL to a database. The value is paired with the customer's ID. So, after a URL is stored, the user will login, your login service will look up the customer ID from their login, and get the correct URL that was stored for that customer. At this point, the server would then return the URL to the device, which would in turn get the contents of the URL. This is a very straight-forward process, which I could assist you with. – Sheamus Oct 01 '15 at 15:35