You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use MAS region instead of macOS region on macOS 10.15+.
macOS 10.13 - 10.14 will continue to use the macOS region.
This is only for reading the MAS region to pass as a country query string parameter value to the iTunes Search Web API queries (in mas info, mas search, and other commands that call the API), as all other places use Apple private frameworks that internally use the MAS region without mas directly seeing it.
This is not about setting the region, either for the MAS (the source is read only; for setting the region, see #75) or for an individual run of any mas command (e.g., via a --region option; see #444).
I think we should also add an mas region command to output the region that mas uses, so users can easily see that. Note that this minimal version of the command will not take any arguments, and will not currently set any values, just display info. The same command can be used to implement #75 by allowing it to accept appropriate arguments.
Implementation
SKStorefront (available on macOS 10.15+, deprecated on macOS 12, but seemingly still around on macOS 15) provides the region used in the MAS via its countryCode read-only property. (annoyingly, it provides an ISO 3166 alpha-3 3-character region code instead of an alpha-2 2-character region code that is used by the iTunes Search Web API, so I had to depend on a library to map from alpha-3 to alpha-2).
If you are logged out of the MAS, it seems to return the most recent region set in the MAS.
SKPaymentQueue.default().storefront provides the current SKStorefront.
Storefront is the macOS 12+ alternative for SKStorefront, but it uses Swift Concurrency. If we later learn how to use Swift Concurrency without Swift Concurrency cascading out of an if #avaialble(macOS 12, *) {…} block, or if we increase the minimum required macOS to 10.15, we can start to use Storefront for macOS 12+, but not probably worth the effort now.
There are a few ways to structure this. Will want to discuss the exact implementation after I submit my PR.
The text was updated successfully, but these errors were encountered:
Overview
Use MAS region instead of macOS region on macOS 10.15+.
macOS 10.13 - 10.14 will continue to use the macOS region.
This is only for reading the MAS region to pass as a
country
query string parameter value to the iTunes Search Web API queries (inmas info
,mas search
, and other commands that call the API), as all other places use Apple private frameworks that internally use the MAS region without mas directly seeing it.This is not about setting the region, either for the MAS (the source is read only; for setting the region, see #75) or for an individual run of any mas command (e.g., via a
--region
option; see #444).I think we should also add an
mas region
command to output the region that mas uses, so users can easily see that. Note that this minimal version of the command will not take any arguments, and will not currently set any values, just display info. The same command can be used to implement #75 by allowing it to accept appropriate arguments.Implementation
SKStorefront
(available on macOS 10.15+, deprecated on macOS 12, but seemingly still around on macOS 15) provides the region used in the MAS via itscountryCode
read-only property. (annoyingly, it provides an ISO 3166 alpha-3 3-character region code instead of an alpha-2 2-character region code that is used by the iTunes Search Web API, so I had to depend on a library to map from alpha-3 to alpha-2).If you are logged out of the MAS, it seems to return the most recent region set in the MAS.
SKPaymentQueue.default().storefront
provides the currentSKStorefront
.Storefront
is the macOS 12+ alternative forSKStorefront
, but it uses Swift Concurrency. If we later learn how to use Swift Concurrency without Swift Concurrency cascading out of anif #avaialble(macOS 12, *) {…}
block, or if we increase the minimum required macOS to 10.15, we can start to useStorefront
for macOS 12+, but not probably worth the effort now.There are a few ways to structure this. Will want to discuss the exact implementation after I submit my PR.
The text was updated successfully, but these errors were encountered: