iosobjective-cotaopenurlcustom-url

OpenUrl and itms-services with credentials


I want to install an app from inside another app. I know it is possible with the following code:

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",@"itms-services://?action=download-manifest&url=",self.plistURL]];
[[UIApplication sharedApplication] openURL:url];

My problem is that that the .plist is located in an area on the server where the user has to enter user credentials to access it. So when I execute this code, the user is asked for the credentials in Safari. But I don't want that. I want the app to enter the credentials.

I already tried to open the custom url scheme with an AFNetworking operation but it seems that it can´t handle custom url schemes because I get the error:

"Unsupported url"

So my question is: is there any way to use itms-services with user credentials or is there a workaround?

I also considered that maybe downloading the plist and executing it from an internal url could solve the problem, but I wanted to make sure that there is no easier way.

Thanks for reading my question!


Solution

  • After some time of experimenting I dont think it is possible to use itms-services with credentials. I ended up passing the credentials directly in the url with:

    https://Username:Password@plisturl
    

    In the plist I also added the credentials to the ipa URL. I don´t think it is a clean solution to add the credentials in clear text but it is the only solution I see at the moment.

    Keep me updated if someone has a better solution.