?
They get to your page, I presume, by clicking a link, so you can structure the href in the link to include the encrypted credentials parameter you want to use. You have complete control over the URL that they are being told to add to their home screen. [If you wanted to, you could use javascript and a window.location change, but I'm not sure I see the point. You could also add this credential as a hashtag reference instead of a get parameter, either via javascript or not, but again, I'm not sure there's much point to that.]
For a very secure application, however, it's a little dangerous, because anyone else can use those same encrypted parameters on an installed iphone app, as well as being able to look at your code to see how you decrypt them (unless you decrypt them only on the server side).
For my app, security is minimal and there's no risk, but this isn't a very good solution for a proper app.
A better option might be to create a one-use credential on the server side, and to add a reference to that as a parameter in the link to the iPhone web app page. When the iphone app is installed and first run outside of Safari (window.navigator.standalone is true), then you can use the one-use credential parameter to look up the credentials, log the user in, and delete the one-use credential on the server side so it can never be used again.
Of course, your app will still require a way for the user to log back in somehow, but this would take care of a first time automatic logi in, and further communication could get credentials from the server into the web app's local storage, for future automatic log in, if you feel secure in doing so.