Post

Replies

Boosts

Views

Activity

Pay attention to StoreKit Configuration settings
It's not a question, I just want to share my experience of resolving a bug. We where adding a new product to the app and couldn't get why it's not loading. StoreKit 2 simply did not return the product, so we switched to StoreKit 1 to get invalidProductIdentifiers from the response. The product was there of course. So many time was spend... We checked App Store configuration, everything was approved. Checked id, localization, multiple devices. Everyone start to get mad, we filled issues for RevenueCat and Apple. Then we uploaded a TF build (because product wasn't loading when running from Xcode). And, suddenly the product did appear there! I understood that it can be connected to StoreKit Configuration, since it works only in debugger mode (Debug or Release), but not in TF. But there was no any .storekit files in the project folder. I search it many times - no success. And finally the bug was resolved when I checked Run Scheme. As you can see on the screenshot, it has red value under StoreKit Configuration. That means there where a file before, but than it was removed. So I changed it to None and the product started to work in debug. Great! I hope this post helps, don't fall to the same error as me! Related article: Setting up StoreKit Testing in Xcode
0
0
444
Jul ’24
Extract metadata from a .watchface
Hello, fellow developers! How would you approach .watchface file to extract it's metadata? I need to know in which version of the app the face was created, to prompt the user to update the app if necessary. Looking at binary I suppose that a .watchface file consists of a PNG previews and JSON metadata and it all packed in one file somehow. Probably archived with gzip.
0
0
389
Jul ’24
Xcode Preview Broken
On May 1 I started to see this image instead of watch UI preview. It worked well before. I didn't update Xcode, neither I deleted or installed any new simulator OS. It was harmful to my work, since simulator download is 4GB and I need to wait when it downloads, instead of reviewing PRs and closing tasks. Did anyone had the same issue? Do you know how to prevent it?
2
0
601
May ’24
Search app by bundleID - PARAMETER_ERROR.ILLEGAL
Trying to get the relevant app (it exists and published) by this endpoint: https://api.appstoreconnect.apple.com/v1/bundleIds/{id}/app Receiving error 404: "errors" : [ { "id" : "ec7b1469-fe54-4ad5-9f2b-f665c31a6358", "status" : "404", "code" : "PATH_ERROR_REALTIONSHIP", "title" : "The URL path is not valid", "detail" : "The relationship 'app' does not exist on resource 'bundleIds'" } ] Doing everything according to documentation. Tried to pass both Bundle ID id and Bundle ID itself. What could be the problem?
1
0
514
Apr ’24
My experience with Technical Support - Total Disappointment
Recently, our team bumped into a crash that we cannot resolve. We looked for help everywhere. I asked people here on forums, team asked about 10 fellow developers and the question on SO was created. Nobody knows the reason for the crash, nobody can find a workaround. So, as the last resort, I called for Apple Technical Support (aka code-level support). I assumed that people there understand how things work under the hood. Considering that this service is limited (2 TSI per year, otherwise paid), I expected the quality to be high. In fact, it didn't help us to resolve the problem, and I was disappointed how irrelevant the provided support could be. TLDR: The dev didn't even open the test project! I described the memory crash with WidgetKit-based complication. I spend my time capturing video, finding watch logs on my iPhone and creating a sample project. I attached console output, stack traces and a couple of screenshots. I even provided a .watchface file, so they can reproduce the configuration. This together took about 6-8 hours of work. I explained what happens in detail: steps to reproduce, what I've tried. I asked the support to recommend me way to present only the specified complications. Then I submitted the issue and started to wait. It took them 1 week to responsd. I pointed my sight on the email with excitement, expecting to finally get the resolution. But what I found there was disappointing. The software engineer, Rico, quoted only a couple of sentences from my list. His letter contained only 4 lines of text (not including greetings and cheers). In the first line he recommended to use preprocessor macro to enable only necessary complications, which is nonsense. Of course we need to change complications dynamically, when the user selects them. I two next lines he recommends to use if statement in WidgetBundle to dynamically unlock the complications. I already knew that it isn't possible. Because, quote: "if statements in a WidgetBundleBuilder can only be used with #available clauses" @available(*, unavailable, message: "if statements in a WidgetBundleBuilder can only be used with #available clauses") public static func buildOptional<W>(_ widget: W?) where W : Widget The last line cancelled everything before, Rico said that this can't be done at runtime. Probably, he added that after reading the documentation, but forgot to edit his previous statements. I didn't give up completely. I decided to skip the design discussions and get the info that Rico could probably have, due to his access to the software. Why the extension using so much memory? I also asked him, if he was able to build the project and reproduce the bug. Another week passed. I'm sending a follow-up message. That worked, after another 3 days I got the response: Finally some useful information! Timeline and views are being archived to disk (all simultaneously), that's why the memory usage is so high. Basically, a widget design issue. But anyway, we have what we have. Then next line, he has written this: "Complications are deprecated". What? But wait, he thinks that we use ClockKit, and recommends migrating to WidgetKit. So Rico completely forgot that we discussed WidgetBundle and SwiftUI before 🤡 He honestly tells me that he didn't open the project. Why? Because "Complications are unlikely to be supported", he says. So he "forgot" WidgetKit on intention, this gave him an excuse to ignore the sample project. My time was invested for nothing! I believe there's no need in further conversation with Rico. I will provide the detailed feedback to the Apple. And I'm posting it publicly to make sure that Rico gets the attention he deserves. If you want to know more technical details about the issue, you can check the following links: https://stackoverflow.com/q/77855303/1746142 https://developer.apple.com/forums/thread/744726
1
1
656
Feb ’24
Aggregated Data Table (Reporting Table) in CloudKit database
I need to track user actions, for example video view count. Then the data is used to get most popular videos for last 7 days, 30 days and for a year. For this purpose I have created a Downloads table with timestamp and video fields. Each time user opens the catalog, I'm running queries to get Downloads and sort the videos based on them. This is a working, but not the efficient solution. A good option is to add aggregated data table storing summary counts for the popular queries - countFor7Days, etc. This will improve query performance. But it requires a job that would update the aggregate table every day. The question is how to implement this job in CloudKit? Is there are such built-in feature, or I need a custom service running somewhere?
3
1
660
Feb ’24
How to reduce complication extension executable size?
Hello! I'm working on the watchOS app that provides user with multiple fancy complication sets. There are about 50 widgets in our WidgetBundle now. With this amount we reached memory limit and the app crashes: Thread 1: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=15 MB) I inspected complicationExtension.appex content and find out that most volume is occupied by the executable: Localized strings (12 langs) altogether - 165 KB Assets.car - 1.1 MB Imported fonts TTF files altogether - 866 KB complicationsExtension executable file - 8.2 MB Why it takes so much space and how can it be made smaller?
8
0
1.7k
Jan ’24
Unable to Verify App while Network Link Condition is on
Hi! I wanted to test my app with Xcode and see how it handles network errors. So, in Devices and Simulators I activated Network Link Condition - 100% packet loss. Then I run the app and see the popup saying that it's unable to verify app for obvious reasons: Unable to Verify App An Internet connection is required to verify trust of the developer "Apple Development: Vladimir Kelin (<#teamid#>)". This app will not be available until verified. How do I run the app with network condition, then?
0
0
449
Jan ’24
CKModifyRecordsOperation records limit?
I'm trying to delete many records with one CKModifyRecordsOperation and getting this error: <CKError 0x600000dbe4f0: "Limit Exceeded" (27/1020); "Your request contains 552 items which is more than the maximum number of items in a single request (400)"> This obviously means, that Modify Operation has record limit of 400 which is equal to CKQueryOperation.maximumResults. The good solution here would be to chunk the array of records into subarrays with length less than 400 and add multiple delete operations to the database. The only problem is that the limit for CKModifyRecordsOperation is neither documented nor provided with a constant, so it's basically a magic number. In hope that my prayers would be heard I want to ask to add maximumResults constant to CKModifyRecordsOperation.
3
0
698
Dec ’23
What is `classNamed(_:)` for?
There is a such method in Bundle: func classNamed(_ className: String) -&gt; AnyClass? The description says it loads the Class object for className. It's, obviously, an Objective-C stuff. I started from Objective-C but didn't used it, preferring NSClassFromString. Now I suddenly tested it in various applications. I was surprised that it doesn't work in iOS apps neither in Playground: import Foundation class TalkingFruit {   func greet() {     print("Hello, playground")   } } @objc class LagacyFruit: NSObject { } print(Bundle.main.classNamed("TalkingFruit") ?? "no class") // no class print(Bundle.main.classNamed("LegacyFruit") ?? "no class") // no class print(Bundle.main.classNamed("NSObject") ?? "no class either") // no class either And now I have a question: Does it even work? And how it's supposed to be used? Working use case example would be great.
2
0
1.3k
Jan ’22