How do I test the credentials which saved in IOS keychain? - iphone

As a tester, I want to test the credentials which saved in IOS keychain.
scenarios which App can not contact the keychain, Crashed credentials (how to crash?), does the correct credentials use in all the times, Does the credentials remove when the app close and uninstall... etc. How do I do that as a tester?
thanks

Related

Will I lost my Keychain with a new certificate?

I have an application already in the store that use Keychain to store passwords.
I want to publish an update of the application, the problem is that I don't have the original certificate anymore (it was expired and I created another).
Reading Apple's documentation it says:
Note: On iPhone, Keychain rights depend on the provisioning profile
used to sign your application. Be sure to consistently use the same
provisioning profile across different versions of your application.
If I edit my provisioning profile with a different certificate, will my users lose their passwords when I will upgrade the application?
Thanks
if you can upload the app into the store (so update the old one), the users will not recognize anything of this ;)
What's saved in their keychain will be bound to the Bundle an stays at least until the application is deleted.
You can revoke and re-create your cert, and assign it to your provisioning profile without any further consequences.

iOS app needs logged in after iphone restart

May be it will be a too startup question.
We have developed an iPhone application and its uploaded in the Appstore. We have our own login mechanism, facabook login, and twitter login. Our users reporting an issue that, when the app is started and the iphone device is restarted (switched off), the application is also logged out. And users needs to login again. We have checked Facebook app. It keeps logged in when the device is restarted (switched off). We also want to do like that. Can you have suggest mechanism to do like that.
Store the Username and password in the keychain. When the app starts up, then grab the username and password from the keychain and execute the method for login.
John
You can can Store your acessToken (facebook) with NSUserDefaults, CoreData or FileSystem. I will not suggest you to save your login/password inside your app. If you need to do this, its better save data user(name,address,celphone...) but not the access, like login/password. Its more safe. Of course, you can use KeyChain, but will each in what are you thinking doing with the app.
NSUserDefaults
Save string to the NSUserDefaults?
File System - apple guide
http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html
Core Data
Save and Load Data - CoreData

iOS - How often to check keychain credentials

After validating and storing a users credentials in the keychain, how often do I need to check if they are still there or still valid? Should I call a method on each ViewDidAppear and check if they are bad or don't exist then show the login modal?
Note : Once you stored users credentials in the keychain successfully then keyChain credentials persist after your app is deleted. So need to worry about checking if they are still there or still valid
Also don't forget remove users credentials from the keychain before application gets uninstalled
Refer keychain demo link.

Ad-Hoc Distribution of app and revoking access

If I create an ad hoc distribution profile and successfully sent out an app in an ad-hoc fashion to a number of users, does deleting that profile then remove the app from that user's device or stop it from being used?
Thanks
Once the .mobileprovision is installed on the device, that version of the app will continue to work on the device until the provisioning profile expires. If you delete the profile from the device the app will no longer function, but will remain on the device. They will get a warning saying they don't have valid provisioning to run the app if they try and launch it.
No, it does not.
There is no way to remove the app from the users device, other then either asking them or wait until the profile will expire.

Problem generating APN SSL certificate after submitting to apple store

I'm having trouble getting Apple to generate an APN SSL certificate for my app ID. I've submitted the application to the Apple store, and it is pending review.
I tested the application using an Ad Hoc app ID "${bundle_id}.adHoc" and everything went fine. I submitted to the Apple store with app ID "${bundle_id}.release".
Now I want to generate my production APN SSL certificate for use with my release application ID - but the developer portal doesn't want to. When I upload my certificate request, it sits for about a minute before telling me:
"We are not able to generate your Profile at this time.
Please try again later or try using the Provisioning Portal"
Is it impossible to generate your certificate while the application is under review or something? Should I have generated it prior to submission?
The problem was indeed that I was trying to enable for push while the app was in review. Once the app was approved, I was able to get my push certificate. However, apparently you MUST enable for push BEFORE you generate your distribution provisioning profile, otherwise your app will not actually be able to register with the APN server when it is downloaded from the store.