Possible to read the enterprise iOS download link plist from within the app?
Asked Answered
R

5

8

I'd like to distribute an Enterprise iOS app such that by the time the user opens it, it is already displaying their name and other info, even though the .ipa is the same .ipa that every other user downloads. I figure that I could do this by giving the user an app download URL specific to them and generating the required Enterprise download plist to include some user data, but my question is:

Is it even possible to access/read the Plist from the download link from within the app? If so, how?

Ready answered 30/7, 2015 at 21:30 Comment(4)
Please, take a look at this [stackoverflow link][1] [1]: #9530575Bathelda
@JavierCalatravaLlavería that is the app-info.plist built into the .IPA; what I need is the plist provided along with the public URL to download the .IPA from.Ready
@AlexanderWallaceMatchneer you might consider using a tool like Branch.io. You can create custom URLs that can pass data to your app post-installation. It does work with IPAs hosted privately. Two issues with using it: 1) You have to use their SDK 2) Anything you add to the URL will be sent to Branch.io.Minnie
@AlexanderWallaceMatchneer Did you manage to figure out how to accomplish this?Nimrod
K
7

There is a way to read the enterprise download link from within the App (but I'm sure you're not asking for the code to download and read a file), but there is no way to display something different in the App based on a parameter on the index page or manifest file, without changing the IPA itself.

Unfortunately, the installed App has no knowledge of the manifest file or index page that it was downloaded from.

EDIT with References / Sources

This link, under the section, titled "Exporting Your App for Testing Outside the App Store": Exporting Your App for Testing (iOS, watchOS), discusses manifest files, but makes no mention of any chain of data from web deployment to the app.

I also spoke to a senior Apple adviser, who confirmed that there is no mechanism that gives an App any knowledge of where the App was installed from.

Kazbek answered 1/9, 2015 at 15:18 Comment(1)
Are there any links/sources/technical notes that back up this answer?Ready
M
2

The only way I could think of doing this is sending all users the same link ( examplesite.com/ios/download) and also send them a unique user identifier "SG5JD5J". When the app is downloaded and opened for the first time, prompt the user to enter their unique user identification code. At which point your app can then update their plist and progress into the app.

Unfortunately the way you want to do it would require private API's or a jailbroken iOS device so that you can look at the web browsers history, find your URL (example site.com/ios/download) with a unique identifier at the end and update the plist as need be.

If you find a solution to this, please comment as I would be interested to see.

Mccarty answered 2/9, 2015 at 9:16 Comment(0)
B
1

I can think of two options:

  1. You could create "personalized" IPAs. In other words, when a user requests to download the IPA your server would generate a plist containing all of the user info, save the file inside the IPA, and run codesign. Then just serve the IPA to the user.
  2. Use MDM to inject the information directly into NSUserDefaults: https://developer.apple.com/library/ios/samplecode/sc2279/Introduction/Intro.html
Blockbusting answered 2/9, 2015 at 5:12 Comment(0)
M
0

No this is not possible. Plist is for iOS to find information such as download path, version and app name so iOS would know what to prompt to the user.

Your code can execute only after app has been installed in the device and at that time it has no information about that plist anymore. And there's no way for an app to find its download path information.

Mucoprotein answered 2/9, 2015 at 5:3 Comment(0)
M
0

There is no way to read any file from the IPA if it is not yet installed in device.

What you can do is get the user info from your website, i.e. let user fill a form in your download page. Then save the data to your server along with a GUID that you can generate from your download page.

Once the the app is installed and running, the app should recreate the GUID and then query your server to find the user info associated with the GUID.

Your app can then pre-fill the user info.

The challenge is how can your download page create a GUID that will also be recreated by the installed app? Well you can create the GUID by using browser information. Check this out on how to create the GUID using browser information:

https://andywalpole.me/#!/blog/140739/using-javascript-create-guid-from-users-browser-information

Moderation answered 2/9, 2015 at 10:55 Comment(6)
Which device IDs? afaik Apple changed device IDs to be per-application, per-install since iOS 5 or 6. And how would you get that from the browser?Ready
If device UUID is not possible anymore, you can create the GUID from JavaScript. See here on how to do it: #105534Moderation
So how would both the browser and app generate the same guid?Ready
The download page will create the GUID. The app will re-create the GUID by creating a UIWebView and execute the JavScript that will recreate the GUID.Moderation
But... creating a GUID uses Math.random() ?Ready
Perhaps you can use another trick: by using browser info. Read it here: andywalpole.me/#!/blog/140739/…Moderation

© 2022 - 2024 — McMap. All rights reserved.