Post

Replies

Boosts

Views

Activity

Reply to External purchase region
[quote='824230021, Ivan_developer, /thread/824230, /profile/Ivan_developer'] If a customer originally purchased a subscription while their App Store country was France (so we reported France as the tax country), and later updates or renews that same subscription while located in Hungary, which country should we report going forward? [/quote] Can you clarify what you mean by "report"? Report to who/where? I'm not 100% sure, but I believe Apple collects sales taxes based on the user's current registered App Store country, so I guess subscription renewals would be in the new country (assuming the user has actually changed the country/payment details). Apple's commission is fixed, so it would be unaffected.
Topic: App & System Services SubTopic: StoreKit Tags:
6d
Reply to StoreKit 2: Transaction.all and Transaction.currentEntitlements return empty for valid non-consumable purchases in production
@JackB321 Yeah, this is very frustrating. The local cached transaction record should be rock solid, but it seems like that's not the case now, which has got me rethinking things. I already persist an isPremium flag to UserDefaults on successful purchase, so (assuming we don't get some kind of clarity from Apple soon), I'm planning to rely on my flag rather than the transaction record at launch (at least temporarily). It's not really ideal, but my app does authorization checks on the server side anyway, so for my purposes this is a viable option. Do you have any clarity on whether this bug is still happening today? I can't tell if this was a temporary thing a few weeks ago (and I'm only just seeing the ramifications now) or if it's still an ongoing problem.
Topic: App & System Services SubTopic: StoreKit Tags:
1w
Reply to StoreKit 2: Transaction.all and Transaction.currentEntitlements return empty for valid non-consumable purchases in production
I'm experiencing something similar in production, but I don't have a good enough view into what's happening on the users' devices to say if it's the same issue. I check Transaction.currentEntitlements and Transaction.all on launch for a valid subscription, and fallback to a nonPremium mode if I fail to find a valid transaction. I've seen a small number of users being bumped out of premium mode even though they have a valid subscription and I've been going round in circles trying to track down the bug. This seems to have started some time in the last few weeks for me, and I'm not seeing any particular pattern regarding iOS version number, which makes me wonder if this is a server-side App Store issue. I have not made any recent changes to my StoreKit2 code.
Topic: App & System Services SubTopic: StoreKit Tags:
1w
Reply to Create ML fails to train a text classifier using the BERT transfer learning algorithm
We tried your macOS/Xcode but still can't reproduce your error, unfortunately. Okay, well thanks for trying. You'd just need to set language: nil to get the behavior of latin/automatic. But then how would I select the CJK/Automatic or Cyrillic/Automatic options? As far as I can tell, the CreateML framework doesn't distinguish between language and language family, so it's unclear how the Create ML app is able to make this distinction or what the distinction actually means. From the WWDC video I linked to previously, it sounds like there is one model per language family, which would mean there's essentially no difference between choosing Latin/Automatic and Latin/English, or CJK/Automatic and CJK/Japanese. Can you clarify what the difference it? Possible theories include: The language selector menu is just there to reassure users that they made the right choice of family, but it makes no difference under the hood. Picking a specific language changes how the data is tokenized before training. There are in fact separate BERT models trained on monolingual data, as well as models trained on multilingual data.
Jan ’26
Reply to Create ML fails to train a text classifier using the BERT transfer learning algorithm
Hi @Frameworks Engineer thanks for looking into this. Yes, here are the relevant version numbers: Tahoe Version 26.1 (25B78) Xcode Version 26.2 (17C52) Create ML Version 6.2 (175.7) MacBook Pro (M1 Pro, 32 GB) I did wonder if maybe I don't have the model assets on my machine, but note that I can successfully run the BERT option using the framework directly (with the above code). Although it's a little less convenient, I could simply build the models using the framework, but to do so I was hoping to get confirmation on two points: Is there a specific way to select the Latin/Automatic option to get the multilingual model which I can train with multi-language training data? If not, should I simply set the language to e.g. .english to get the multilingual model. If I do so, does that mean that all languages will be tokenized with the "wrong" tokenizer, or could there be some other problem in doing this? Many thanks for any guidance you can provide.
Jan ’26
Reply to Create ML fails to train a text classifier using the BERT transfer learning algorithm
@tjia Thanks for looking into this. Here's some small example data that you can use to test it – I don't think the data really matters – it seems to fail whatever I put in. Save this as a JSON file and create a new Text Classifier project with default settings and the BERT algorithm. For me, the training stops immediately after the feature extraction phase with no error other than "Training stopped". [ { "text": "Pinus contorta", "label": "animalsAndPlants" }, { "text": "Rabbit", "label": "animalsAndPlants" }, { "text": "Brochoadmones", "label": "animalsAndPlants" }, { "text": "Zebra", "label": "animalsAndPlants" }, { "text": "Oak", "label": "animalsAndPlants" }, { "text": "Campanula rotundifolia", "label": "animalsAndPlants" }, { "text": "Black wood pigeon", "label": "animalsAndPlants" }, { "text": "Colorado potato beetle", "label": "animalsAndPlants" }, { "text": "Corvidae", "label": "animalsAndPlants" }, { "text": "Honey bee", "label": "animalsAndPlants" }, { "text": "Pablo Picasso", "label": "artAndDesign" }, { "text": "Paul Cézanne", "label": "artAndDesign" }, { "text": "Marcel Duchamp", "label": "artAndDesign" }, { "text": "Proto-Cubism", "label": "artAndDesign" }, { "text": "Vincent van Gogh", "label": "artAndDesign" }, { "text": "Cubism", "label": "artAndDesign" }, { "text": "Rococo", "label": "artAndDesign" }, { "text": "Art", "label": "artAndDesign" }, { "text": "Interior design", "label": "artAndDesign" }, { "text": "Typography", "label": "artAndDesign" } ]
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
@Frameworks Engineer Could you provide the version of your operating system where this issue was seen? I'm using the iOS simulator (iOS 26.2) running on Tahoe 26.1. I could try updating to Tahoe 26.2, if you think that would help? I have not tested this on device. @Apple Designer The best work-around I can offer for now is just add a verification in your tool call itself. Thanks, yes, I experimented with this, but I found that the model sometimes just persistently keeps calling the tool with the same invalid argument, sometimes appearing to get stuck in an infinite loop. I've also tried listing the valid section names in the instructions, but even with that I've observed that the model will still try to call the tool with invalid arguments. (This new world of non-deterministic engineering sure is an adventure!) More general question (assuming there was no bug)... would you recommend listing the valid arguments in the instructions? Or would that be redundant because the valid arguments are listed in the schema definition (which I presume is fed to the model behind the scenes). In other words, how does anyOf actually work: anyOf lists all the options in the schema that's presented to the model. anyOf constrains the generation of a string at prediction time. anyOf does both of the above. I'm asking because I presume it's important that the model knows all available options in advance of the prediction of an input argument. So, if anyOf does not do (1), then I guess it would be important to list the valid options in the instructions.
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
Thanks – I didn't even think to test that because I assumed it must be something to do with creating a dynamic schema at runtime. Do you have any ideas about a workaround? Is there some other way of defining a schema at runtime with guided enum-like behavior? Or do you have any ideas about a timeframe for the bugfix (I mean, is this an iOS 26.3 type thing, or an iOS 27 type thing)?
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
I'm dealing with encyclopedic articles, and quite often the model will request the "Introduction" section, even though no such string appears in the sections array. Sometimes it also hallucinates sections that it thinks ought to exist based on the prompt. While I was debugging this, I constructed a simpler toy example. It might be easier if we talk about that instead. Here's a playground I made to demonstrate the issue: import Playgrounds import FoundationModels #Playground { struct CityInfo: Tool { let validCities: [String] let name: String = "getCityInfo" let description: String = "Get information about a city." var parameters: GenerationSchema { GenerationSchema( type: GeneratedContent.self, properties: [ GenerationSchema.Property( name: "city", description: "The city to get information about.", type: String.self, guides: [.anyOf(validCities)] ) ] ) } func call(arguments: GeneratedContent) throws -> String { print(arguments.generatedContent) let cityName = try arguments.value(String.self, forProperty: "city") let cityInfo = getCityInfo(for: cityName) return cityInfo } func getCityInfo(for city: String) -> String { switch city { case "London": return "Some info about London..." case "New York": return "Some info about New York..." case "Paris": return "Some info about Paris..." default: return "Unrecognized city!" } } } let citiesDefinedAtRuntime = ["London", "New York", "Paris"] let tools = [CityInfo(validCities: citiesDefinedAtRuntime)] let instructions = """ You are a travel guide. Your job is to pick a city for the user to travel to based on their requirements. Once you've picked a city you should provide some information to the user about the city and why it's a good choice. To help you, you can use the getCityInfo tool to get information about a city. """ let session = LanguageModelSession(tools: tools, instructions: instructions) let response = try await session.respond(to: "I want to travel to a big city in China") } When I run this, it usually tries to request info about Beijing (the generated content is {"city":"Beijing"}). Or, if I change the prompt to "I want to travel to a big city in Japan", it will try to request info about Tokyo, etc. You might need to run it a few times to reproduce the issue. My understanding is that this should not be physically possible with guided generation. So, I'm wondering if I've set up the GenerationSchema correctly?
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
Thanks, @Apple Designer. I greatly appreciate any help you can give me. I think this is not the issue because I initialize the Tool at the same time I initialize the session, and the article/sections are not supposed to change for the lifetime of the session. So, I do this: let tools = [SectionReader(article: article, sections: articleSections)] let session = LanguageModelSession(tools: tools, instructions: prompt) So, I believe it should be fine for the parameters property to be computed at initialization time (the sections are known at initialization and do not change).
Jan ’26
Reply to Defining a Foundation Models Tool with arguments determined at runtime
I found a simpler way to set up the tool with an argument that's defined at runtime: struct CityInfo: Tool { let validCities: [String] let name: String = "getCityInfo" let description: String = "Get information about a city." var parameters: GenerationSchema { GenerationSchema( type: GeneratedContent.self, properties: [ GenerationSchema.Property( name: "city", description: "The city to get information about.", type: String.self, guides: [.anyOf(validCities)] ) ] ) } } However, the LLM will still try to generate cities that are not valid. For example, the model will happily generate content like {"city":"Tokyo"} even if "Tokyo" is not in the validCities array. Have I misunderstood what .anyOf() is supposed to do? The documentation says "Enforces that the string be one of the provided values.", but in my testing this is not true. Is this a bug, or is .anyOf() just a strong recommendation rather than a guarantee?
Jan ’26
Reply to External purchase region
[quote='824230021, Ivan_developer, /thread/824230, /profile/Ivan_developer'] If a customer originally purchased a subscription while their App Store country was France (so we reported France as the tax country), and later updates or renews that same subscription while located in Hungary, which country should we report going forward? [/quote] Can you clarify what you mean by "report"? Report to who/where? I'm not 100% sure, but I believe Apple collects sales taxes based on the user's current registered App Store country, so I guess subscription renewals would be in the new country (assuming the user has actually changed the country/payment details). Apple's commission is fixed, so it would be unaffected.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
6d
Reply to StoreKit 2: Transaction.all and Transaction.currentEntitlements return empty for valid non-consumable purchases in production
@JackB321 Maybe you could try requesting direct code-level support: https://developer.apple.com/support/technical/ This would at least get the issue in front of someone who could figure out the problem or escalate it with the relevant team.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
1w
Reply to StoreKit 2: Transaction.all and Transaction.currentEntitlements return empty for valid non-consumable purchases in production
@JackB321 Yeah, this is very frustrating. The local cached transaction record should be rock solid, but it seems like that's not the case now, which has got me rethinking things. I already persist an isPremium flag to UserDefaults on successful purchase, so (assuming we don't get some kind of clarity from Apple soon), I'm planning to rely on my flag rather than the transaction record at launch (at least temporarily). It's not really ideal, but my app does authorization checks on the server side anyway, so for my purposes this is a viable option. Do you have any clarity on whether this bug is still happening today? I can't tell if this was a temporary thing a few weeks ago (and I'm only just seeing the ramifications now) or if it's still an ongoing problem.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
1w
Reply to StoreKit 2: Transaction.all and Transaction.currentEntitlements return empty for valid non-consumable purchases in production
I'm experiencing something similar in production, but I don't have a good enough view into what's happening on the users' devices to say if it's the same issue. I check Transaction.currentEntitlements and Transaction.all on launch for a valid subscription, and fallback to a nonPremium mode if I fail to find a valid transaction. I've seen a small number of users being bumped out of premium mode even though they have a valid subscription and I've been going round in circles trying to track down the bug. This seems to have started some time in the last few weeks for me, and I'm not seeing any particular pattern regarding iOS version number, which makes me wonder if this is a server-side App Store issue. I have not made any recent changes to my StoreKit2 code.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
1w
Reply to Menu in the bottom bar flies to the top of the screen
@RAULRS97 Thanks for the confirmation. Your idea to simply disable the button for one second is helpful – at least I can use that for now until they fix this.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Feb ’26
Reply to Create ML fails to train a text classifier using the BERT transfer learning algorithm
We tried your macOS/Xcode but still can't reproduce your error, unfortunately. Okay, well thanks for trying. You'd just need to set language: nil to get the behavior of latin/automatic. But then how would I select the CJK/Automatic or Cyrillic/Automatic options? As far as I can tell, the CreateML framework doesn't distinguish between language and language family, so it's unclear how the Create ML app is able to make this distinction or what the distinction actually means. From the WWDC video I linked to previously, it sounds like there is one model per language family, which would mean there's essentially no difference between choosing Latin/Automatic and Latin/English, or CJK/Automatic and CJK/Japanese. Can you clarify what the difference it? Possible theories include: The language selector menu is just there to reassure users that they made the right choice of family, but it makes no difference under the hood. Picking a specific language changes how the data is tokenized before training. There are in fact separate BERT models trained on monolingual data, as well as models trained on multilingual data.
Replies
Boosts
Views
Activity
Jan ’26
Reply to Create ML fails to train a text classifier using the BERT transfer learning algorithm
Submitted feedback: FB21730591
Replies
Boosts
Views
Activity
Jan ’26
Reply to Create ML fails to train a text classifier using the BERT transfer learning algorithm
Hi @Frameworks Engineer thanks for looking into this. Yes, here are the relevant version numbers: Tahoe Version 26.1 (25B78) Xcode Version 26.2 (17C52) Create ML Version 6.2 (175.7) MacBook Pro (M1 Pro, 32 GB) I did wonder if maybe I don't have the model assets on my machine, but note that I can successfully run the BERT option using the framework directly (with the above code). Although it's a little less convenient, I could simply build the models using the framework, but to do so I was hoping to get confirmation on two points: Is there a specific way to select the Latin/Automatic option to get the multilingual model which I can train with multi-language training data? If not, should I simply set the language to e.g. .english to get the multilingual model. If I do so, does that mean that all languages will be tokenized with the "wrong" tokenizer, or could there be some other problem in doing this? Many thanks for any guidance you can provide.
Replies
Boosts
Views
Activity
Jan ’26
Reply to Create ML fails to train a text classifier using the BERT transfer learning algorithm
@tjia Thanks for looking into this. Here's some small example data that you can use to test it – I don't think the data really matters – it seems to fail whatever I put in. Save this as a JSON file and create a new Text Classifier project with default settings and the BERT algorithm. For me, the training stops immediately after the feature extraction phase with no error other than "Training stopped". [ { "text": "Pinus contorta", "label": "animalsAndPlants" }, { "text": "Rabbit", "label": "animalsAndPlants" }, { "text": "Brochoadmones", "label": "animalsAndPlants" }, { "text": "Zebra", "label": "animalsAndPlants" }, { "text": "Oak", "label": "animalsAndPlants" }, { "text": "Campanula rotundifolia", "label": "animalsAndPlants" }, { "text": "Black wood pigeon", "label": "animalsAndPlants" }, { "text": "Colorado potato beetle", "label": "animalsAndPlants" }, { "text": "Corvidae", "label": "animalsAndPlants" }, { "text": "Honey bee", "label": "animalsAndPlants" }, { "text": "Pablo Picasso", "label": "artAndDesign" }, { "text": "Paul Cézanne", "label": "artAndDesign" }, { "text": "Marcel Duchamp", "label": "artAndDesign" }, { "text": "Proto-Cubism", "label": "artAndDesign" }, { "text": "Vincent van Gogh", "label": "artAndDesign" }, { "text": "Cubism", "label": "artAndDesign" }, { "text": "Rococo", "label": "artAndDesign" }, { "text": "Art", "label": "artAndDesign" }, { "text": "Interior design", "label": "artAndDesign" }, { "text": "Typography", "label": "artAndDesign" } ]
Replies
Boosts
Views
Activity
Jan ’26
Reply to Defining a Foundation Models Tool with arguments determined at runtime
For anyone who's stuck on this issue, see my other post: https://developer.apple.com/forums/thread/812501
Replies
Boosts
Views
Activity
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
@Frameworks Engineer Could you provide the version of your operating system where this issue was seen? I'm using the iOS simulator (iOS 26.2) running on Tahoe 26.1. I could try updating to Tahoe 26.2, if you think that would help? I have not tested this on device. @Apple Designer The best work-around I can offer for now is just add a verification in your tool call itself. Thanks, yes, I experimented with this, but I found that the model sometimes just persistently keeps calling the tool with the same invalid argument, sometimes appearing to get stuck in an infinite loop. I've also tried listing the valid section names in the instructions, but even with that I've observed that the model will still try to call the tool with invalid arguments. (This new world of non-deterministic engineering sure is an adventure!) More general question (assuming there was no bug)... would you recommend listing the valid arguments in the instructions? Or would that be redundant because the valid arguments are listed in the schema definition (which I presume is fed to the model behind the scenes). In other words, how does anyOf actually work: anyOf lists all the options in the schema that's presented to the model. anyOf constrains the generation of a string at prediction time. anyOf does both of the above. I'm asking because I presume it's important that the model knows all available options in advance of the prediction of an input argument. So, if anyOf does not do (1), then I guess it would be important to list the valid options in the instructions.
Replies
Boosts
Views
Activity
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
Thanks – I didn't even think to test that because I assumed it must be something to do with creating a dynamic schema at runtime. Do you have any ideas about a workaround? Is there some other way of defining a schema at runtime with guided enum-like behavior? Or do you have any ideas about a timeframe for the bugfix (I mean, is this an iOS 26.3 type thing, or an iOS 27 type thing)?
Replies
Boosts
Views
Activity
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
I'm dealing with encyclopedic articles, and quite often the model will request the "Introduction" section, even though no such string appears in the sections array. Sometimes it also hallucinates sections that it thinks ought to exist based on the prompt. While I was debugging this, I constructed a simpler toy example. It might be easier if we talk about that instead. Here's a playground I made to demonstrate the issue: import Playgrounds import FoundationModels #Playground { struct CityInfo: Tool { let validCities: [String] let name: String = "getCityInfo" let description: String = "Get information about a city." var parameters: GenerationSchema { GenerationSchema( type: GeneratedContent.self, properties: [ GenerationSchema.Property( name: "city", description: "The city to get information about.", type: String.self, guides: [.anyOf(validCities)] ) ] ) } func call(arguments: GeneratedContent) throws -> String { print(arguments.generatedContent) let cityName = try arguments.value(String.self, forProperty: "city") let cityInfo = getCityInfo(for: cityName) return cityInfo } func getCityInfo(for city: String) -> String { switch city { case "London": return "Some info about London..." case "New York": return "Some info about New York..." case "Paris": return "Some info about Paris..." default: return "Unrecognized city!" } } } let citiesDefinedAtRuntime = ["London", "New York", "Paris"] let tools = [CityInfo(validCities: citiesDefinedAtRuntime)] let instructions = """ You are a travel guide. Your job is to pick a city for the user to travel to based on their requirements. Once you've picked a city you should provide some information to the user about the city and why it's a good choice. To help you, you can use the getCityInfo tool to get information about a city. """ let session = LanguageModelSession(tools: tools, instructions: instructions) let response = try await session.respond(to: "I want to travel to a big city in China") } When I run this, it usually tries to request info about Beijing (the generated content is {"city":"Beijing"}). Or, if I change the prompt to "I want to travel to a big city in Japan", it will try to request info about Tokyo, etc. You might need to run it a few times to reproduce the issue. My understanding is that this should not be physically possible with guided generation. So, I'm wondering if I've set up the GenerationSchema correctly?
Replies
Boosts
Views
Activity
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
Thanks, @Apple Designer. I greatly appreciate any help you can give me. I think this is not the issue because I initialize the Tool at the same time I initialize the session, and the article/sections are not supposed to change for the lifetime of the session. So, I do this: let tools = [SectionReader(article: article, sections: articleSections)] let session = LanguageModelSession(tools: tools, instructions: prompt) So, I believe it should be fine for the parameters property to be computed at initialization time (the sections are known at initialization and do not change).
Replies
Boosts
Views
Activity
Jan ’26
Reply to Defining a Foundation Models Tool with arguments determined at runtime
I found a simpler way to set up the tool with an argument that's defined at runtime: struct CityInfo: Tool { let validCities: [String] let name: String = "getCityInfo" let description: String = "Get information about a city." var parameters: GenerationSchema { GenerationSchema( type: GeneratedContent.self, properties: [ GenerationSchema.Property( name: "city", description: "The city to get information about.", type: String.self, guides: [.anyOf(validCities)] ) ] ) } } However, the LLM will still try to generate cities that are not valid. For example, the model will happily generate content like {"city":"Tokyo"} even if "Tokyo" is not in the validCities array. Have I misunderstood what .anyOf() is supposed to do? The documentation says "Enforces that the string be one of the provided values.", but in my testing this is not true. Is this a bug, or is .anyOf() just a strong recommendation rather than a guarantee?
Replies
Boosts
Views
Activity
Jan ’26