Tinder / sign-here

A straightforward tool that enables the creation of Provisioning Profiles and Certificates for deploying Apple based software
35 stars 7 forks source link

removes a validation to consider universal bundle ids #19

Closed omarzl closed 4 months ago

omarzl commented 4 months ago

Hello! I am setting up an example workflow with sign-in tool 😄

While creating a new provisioning profile I had this error:

Error: [iTunesConnectServiceImp] Unable to determine iTunesConnect API ID for bundle identifier
- Bundle Identifier: com.omarzl.bazel.sample
- Platform: IOS

I added a print for listBundleIDsResponse.data and I found out that the bundle id has the platform type UNIVERSAL 🤯:

[SignHereLibrary.ListBundleIDsResponse.BundleId(id: "XXXX", type: "bundleIds", attributes: SignHereLibrary.ListBundleIDsResponse.BundleId.Attributes(name: "Bazel Sample", identifier: "com.omarzl.bazel.sample", platform: "UNIVERSAL"))]

I temporary removed the queryItems in the request to list all my bundle ids and I found out that I have these 3 types: IOS, MAC_OS and UNIVERSAL.

I went to ASC and I discovered that it doesn't allow you to select the platform, it automatically sets all of them. So my guess is that all new bundle ids are now UNIVERSAL, and old ones still preserve the IOS/MAC_OS types 🤔

Screenshot 2024-05-23 at 16 16 52

Fix: Since the network call already has a constraint in the platform filter (Sources/SignHereLibrary/Services/iTunesConnectService.swift:241):

.init(name: "filter[platform]", value: "IOS")

I think that the best solution could be to remove this validation to support these UNIVERSAL bundle ids.

After removing this line, the provisioning profile was created 🎉

omarzl commented 4 months ago

I debug a little bit more and I see that I have a bundle id obtained from the API that has the platform IOS but in ASC it shows all the platforms: iOS, iPadOS, macOS, tvOS, watchOS, visionOS

The same applies to a bundle id with the platform MAC_OS in the API but in ASC it shows all of them. Actually in ASC all my bundle ids show all the platforms

And the docs for the API doesn't mention nothing about the UNIVERSAL type https://developer.apple.com/documentation/appstoreconnectapi/bundleidplatform