I have developed 3 iPad single window applications and my apps were rejected in app store because they belong to an organization. I have been searching solutions for publishing these apps in app store without distributing them through ad-hoc distribution. I came across some solutions like enterprise app development and having a username and password for the app. I decided go with the second option and I am unable to find any solution on how to set up username and password for this single window app, so that I can submit the apps to app store and our organization people can download it whenever they want.
-
2Can https://testflightapp.com/ help ? – Raptor Dec 20 '12 at 04:27
-
I am actually using it right now but they want the app store versions of apps so that they don't have to deal with sending me the device id every time when they want to add the device. – Gravity M Dec 20 '12 at 04:30
-
possible duplicate of [How to distribute an in-house app through App Store?](http://stackoverflow.com/questions/13387935/how-to-distribute-an-in-house-app-through-app-store) – matt Dec 23 '12 at 18:12
3 Answers
Create an entry for the username and password. When the user submits it, you can check the input against PHP or another online method. Save the username and password to the keychain and repeat this each time the app starts.

- 13,056
- 14
- 84
- 125
-
Mine is single window application. How can set up a username and password window in it? Is it possible through alertView? and how to add username and password to keychain? – Gravity M Dec 20 '12 at 04:59
-
An alert view will work. See this URL (http://useyourloaf.com/blog/2010/03/29/simple-iphone-keychain-access.html) for a tutorial on using the keychain. – Jack Humphries Dec 20 '12 at 05:01
-
-
I would say yes. I made an app for my school (and it requires a login) and it is currently on the store. – Jack Humphries Dec 20 '12 at 05:15
-
Do you have any example that I could use?? I am actually built my app as single window application. – Gravity M Dec 20 '12 at 05:24
-
What do you need an example of? Show an alert view with two text boxes, save the creds to the keychain using the code in the link, and sign into the web service. – Jack Humphries Dec 20 '12 at 06:33
-
Ok, I am saving username and password to keychain and using alertview to compare them when the app starts. Is it enough for the app store? Is this the way you implemented it for your school? – Gravity M Dec 20 '12 at 18:50
-
Yes, this should be acceptable for the App Store. The user will type their username and password into the alert view the first time the app starts. Then the app will save the creds to the keychain. Afterwards, you can grab the creds from the keychain and login to web service without presenting an alert view (do it in the background). You will only need to show an alert view again if the creds are incorrect. – Jack Humphries Dec 20 '12 at 19:22
-
I am sorry, I am new to app development. But you are using the term "Web services" but mine just just an app and I use the app document folder for all the operations and no other dbs are cloud contacts. Whenever the app starts fresh this alterview will appear. I dumping all code (http://stackoverflow.com/questions/13976232/how-to-store-username-and-password-in-keychain-and-verify-them-through-alertview) in the viewDidLoad method. Is it ok? – Gravity M Dec 20 '12 at 19:27
-
I think I understand. So you are hardcoding the expected credentials into the app, asking the user to sign in, and then comparing what the user gives you to what you hardcoded in the app (`if ([username isEqualToString:@"user"])`)? – Jack Humphries Dec 20 '12 at 19:31
-
Well, the only other way would be to send the credentials to a web service for verification, but you don't want to do this. When the app starts up each time, check to see if the entries in the keychain match up with what is hardcoded, and if so, don't show an alert view. – Jack Humphries Dec 20 '12 at 19:33
-
On a side note, be careful with hardcoding the credentials into your app. If someones decompiles the binary, they will be to see the username and password. Perhaps you can be a little more creative, such as by including an encrypted file in the bundle and seeing if a user's password opens it up correctly. – Jack Humphries Dec 20 '12 at 19:34
-
Ok great. One last thing, can you suggest any book or video tutorials (generally materials to learn building apps and ios programming)? for a 15 year old, you are very smart – Gravity M Dec 20 '12 at 19:38
-
Thanks a lot :) raywenderlich.com is a very good site, and I also like the iPhone Developer's Cookbook, which has a lot of code examples for everything having to do with iOS apps (http://www.amazon.com/The-iPhone-Developer¿s-Cookbook-Applications/dp/0321555457). – Jack Humphries Dec 20 '12 at 19:44
-
Cool man. Thank you. I will submit my apps today and hopefully they ll be accepted. I will comment here about it. Good Luck – Gravity M Dec 20 '12 at 19:50
-
My apps were rejected with the same reason saying my app is an in-house application. I used all your guidance and implemented Keychain username and password. Any other solutions? – Gravity M Jan 03 '13 at 21:28
-
Wow, I'm sorry about that. That was the specific reason why? My app for my school newspaper can only be used by students and faculty, and was approved with the login system. If you're unable to get it onto the store, I can't provide any other solutions, since there aren't any, besides signing up for the enterprise program. I suppose the B2B program doesn't apply to you since the company would be forced to pay for each app through the store. – Jack Humphries Jan 03 '13 at 22:52
-
Do you use internet to verify the login? Because for my apps, the requirement is that they should work in no-internet environment. – Gravity M Jan 03 '13 at 22:58
-
Yes, my app posts the credentials to a web service for verification. I don't think that would affect their decision though. – Jack Humphries Jan 03 '13 at 23:05
-
Like I said in my answer, why bother with app store when you can use Cydia! – Joe R. Jul 12 '13 at 07:09
Take a look at iOS Developer Enterprise Program
.
Its developer subscription made excetly for in-house app distribution. The registration is very easy. As of now, it costs 299 USD / year.
With Ad-Hoc disribution you are limited to 100 devices and after adding device each device you need to regenerate provisioning profile and repackage the app.
With Enterprise distribution you are not limited anything. The apps can be installed by simple tapping URL on your website or by email.

- 8,281
- 1
- 18
- 34
Use Cydia. Too many requirements and delays with App Store!
EDIT:
If you must use App Store then use the KeyChain
Notice that Keychain is the mechanism for authenticating UserName and Password for apps in the App Store.
/*
<codex>
<abstract>Localized strings for GenericKeychain</abstract>
</codex>
*/
"Username" = "Username";
"Password" = "Password";
"Account Number" = "Account Number";
"Show Cleartext" = "Show Cleartext";
"AccountNumberShared" = "The account number is shared between all apps from this developer.";

- 2,032
- 4
- 36
- 72
-
I am fine with the requirement. I just need a mechanism to set the username and password for the app so that the app store will accept my app. – Gravity M Dec 20 '12 at 04:32
-
I don't think these solutions work for me. All I want to do is using username and password to distribute through app store. Keychain doesn't solve my problem – Gravity M Dec 20 '12 at 04:46
-
-
You can with the user name and password. I read that here only. Some password mechanism to verify. – Gravity M Dec 20 '12 at 04:51