Post not yet marked as solved
Studying this session and trying to add code to add in-
App purchases to my App, currently free in the App Store. Referring to the Code at 14:10 - 19:37 the code references
await BirdBrain.shared.xxxxxxx
Where is explanation of the declaration of BirdBrain struct/class or function?
Post not yet marked as solved
On macOS Sonoma, when AitTags have been added to "FindMy" the AirTag detections are stored in /Library/Caches/com.apple.findmy.fmipcore/Items.data
On macOS Ventura, logged on with the same AppleId and Airtags added and visible, the com.apple.findmy.fmipcore directory doesn't exist on my macine.
Does anyone know if there is any rhyme or reason to the creation and location of teh Items.Data file?
Post not yet marked as solved
I am working on an app and everything including "distribute" works fine: new versions of the app always appear in "Testflight".
I went to another location (other country, other ip address, but the same macbook) and was able to "archive" a new version of the app, but when I did "distribute" a "credentials" error came. (I do not remember the complete error message, but it had to do with credentials)
I came back in the original location. I picked from the "organiser" the archive which I had created in the other location, tried "distribute" again, and now it worked: the new version of the app arrived in Testflight.
I use xcode, where all of the credential - stuff is automatically dealt with.
Why can't I distribute an archive in another location as where I work originally?
I did not have time to try things in the other location.
Post not yet marked as solved
Hello!
I'm in the process of creating an app for iOS. A part of the app relies on data that is collected as the user uses the app. This data is then stored in a .CSV file for easy storage, retrieval, and a small size even if it grows larger than expected.
The data is really simple and easy to traverse, however it won't be stored on a remote database, and only locally on the user's device. I've read that updating the app doesn't overwrite the data of the current version, but instead places the new version of the app in a new directory entirely while the other, older version is then deleted.
Is it possible to mark certain files to be transferred and not replaced entirely? I'd like to know if it's possible or not before I make the mistake and learn the hard way 😅
Also I'm open to any alternative ways to store such data that people may suggest!
Thanks a lot in advance! Help is much appreciated
Jack
Post not yet marked as solved
It's called on the main thread. So if it takes any time (e.g. compressing some data), your UI will lock up. Worse, it locks up your UI when auto-save kicks in (i.e. not in response to a user action). Same for ReferenceFileDocument.fileWrapper
Documentation says background thread:
Ensure that types that conform to this protocol are thread-safe. In particular, SwiftUI calls the protocol’s methods on a background thread. Don’t use that thread to perform user interface updates. Use it only to serialize and deserialize the document data.
Stack trace:
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1
* frame #0: 0x000000010e0cf634 AsyncSave`AsyncSaveDocument.fileWrapper(snapshot="Hello, world!\n\nTest auto save\n\n", configuration=$s7SwiftUI30FileDocumentWriteConfigurationVD @ 0x00007ff7b1e307d0, self=(text = "Hello, world!\n\nTest auto save\n\n")) at AsyncSaveDocument.swift:51:47
frame #1: 0x000000010e0cf9ca AsyncSave`protocol witness for ReferenceFileDocument.fileWrapper(snapshot:configuration:) in conformance AsyncSaveDocument at <compiler-generated>:0
frame #2: 0x00007ff84a271109 SwiftUI`___lldb_unnamed_symbol129907 + 146
Must be a bug eh?
With the newer concurrency stuff, I would think that your FileDocument would have to be Sendable. I tried making it Sendable in sheer desperation, but fileWrapper was still called on the main thread.
Post not yet marked as solved
I am following the iOS App Dev Tutorials on Adopting Swift concurrency and Persisting data.
On Adopting Swift concurrency, it is mentioned that we can call an asynchronous function using the await keyword. Because the asynchronous function can suspend execution, we can use await only in asynchronous contexts, such as inside the body of another asynchronous function. Adopting Swift concurrency, it is also mentioned that we can create a new asynchronous context with a Task to call asynchronous functions from a synchronous context. Based on this information, I concluded that the main added value of a Task is to enable calling an asynchronous function in a synchronous context.
On Persisting data, a Task object is created inside the declaration block of an asynchronous function:
func load() async throws {
let task = Task<[DailyScrum], Error> {
let fileURL = try Self.fileURL()
guard let data = try? Data(contentsOf: fileURL) else {
return []
}
let dailyScrums = try JSONDecoder().decode([DailyScrum].self, from: data)
return dailyScrums
}
let scrums = try await task.value
self.scrums = scrums
}
I didn't understand why it was necessary to create task. Based on what I learned from Adopting Swift concurrency, the context of load() is already asynchronous. Therefore, we can simply call asynchronous functions without the need to create a Task object. When I tried to run the code by removing the task, the app still worked the same, or at least that was my perception.
I believe that there is another reason to use Task in this example other than just enabling calling asynchronous functions. However, this was not explicitly explained in the tutorials. Could you please explain why we use Task here? What is the added value and how it would improve the behavior of this app? Please keep in mind that I am a complete beginner and had no idea about what concurrency was two weeks ago.
In case deleting task would not change anything, could you please confirm that my initial understanding was correct?
Post not yet marked as solved
I'm finding that in Xcode 15, NSLog statements (from Objective-C, in this case) will sometimes appear in Xcode's Console and sometimes will not.
This is making it difficult to debug using our existing logging, which for our REST API requests and responses has been working well for about ten years and is a tough thing to lose.
Is there any way I can restore reliable handling of NSLog in Xcode 15's Console without having to rewrite all (over 200) of our uses of NSLog to use OSLog?
Note: I am aware that Xcode 15's Console sometimes takes more than 30 seconds to start tracking app output, but it appears that in some cases the content of individual NSLog statements never will appear. (If this 30 second delay is news to anyone, it may be related to a spam of identical warnings that are okay which occur on launch of our app. I have suspected that Xcode 15 just gets a bit flustered with identical messages and gives up for a bit.)
Thank you!
Post not yet marked as solved
Hi there! I’m developing an iOS app which requires the user to connect to a Wi-Fi network broadcasted from a device. The problem arises when multiple devices are in the phone’s vicinity, as they all have the same SSID, and the phone randomly switches from one device to another; I need the phone to “fixate” on a single device.
Of course, the devices’ MAC addresses/BSSIDs are unique, so I thought I could use that information to differentiate between them and programmatically choose to connect to a single network. Is there any way I can obtain the BSSIDs of the available networks, and, within the app’s context, connect to a single one of them? Is there another way for the phone to “fixate” on a single BSSID that I might have missed?
It would be ideal for the solution not to require changing the device's firmware. Moreover, the device has to be able to connect to other non-Apple devices. Thanks in advance!
Post not yet marked as solved
App Store kept rejecting my app because the Manage Subscriptions Page says Cannot Connect when it's run on a Sandbox account. I'm using the manageSubscriptionsSheet(isPresented:) API, and I don't know how to fix this.
There are others dealing with the same issue and everything I found so far is saying it's iOS issue.
I responded to the App Store saying it's an iOS issue and included the following links:
Apple Developer Forums
Apple Developer Forums
Apple Support Communities
Apple Support Communities
They replied with the following generic message:
During our review, we found that your app displayed an error message when we tapped on "manage subscription". While we cannot provide technical assistance with the reported issues, we have put together the following resources which discuss common issues seen in apps during review.
To start, please see Testing a Release Build, which gives an overview of how to test your app to minimize the chances of issues occurring during review.
You may also want to review Designing for Real-World Networks, as all apps are reviewed on-device and in an environment that replicates real-world use of your app.
Is there a way to fix this? How should I respond back? Also, can I just take out the Manage Subscription functionality?
Post not yet marked as solved
Hello,
we have a pretty big macOS pkg (12 GB) that we upload on AppStoreConnect. When uploading manually via Transporter, everything works perfectly, but when we are automating this upload in script (via "xcrun altool --upload-app --apiKey"), the upload starts correctly, but we end up having an error after around 25 minutes.
Setting request length to: 511
Web service call (lookupSoftwareForBundleId) result: {
ErrorCode = 401;
ErrorMessage = "Failure to authenticate.";
Errors = (
"Failure to authenticate."
);
NSUnderlyingError = "Error Domain=MZJSONServiceClientErrorDomain Code=401 \"Failure to authenticate.\" \U2026";
}
When reducing the package size (to around 6GB), the same script runs perfectly.
Anyone else has that problem, or even better, a solution?
Post not yet marked as solved
Hello! I've been digging into this for a little bit now, and am hitting something of a wall. Our app is crashing occasionally, and googling the crash yields literally 0 results.
Tl;dr: Something related to adaptivePresentationStyle(for:traitCollection:) is resulting in our app crashing.
Context
In our app, we have a custom UIPresentationController that we use to present a small sheet of content overlaying other app content - similar to a UISheetPresentationController with a medium-ish size. So we have a custom UIViewController to present, and it conforms to the UIAdaptivePresentationControllerDelegate protocol. We also have custom present and dismiss animators.
The crash
However, we seem to be running into a really odd crash. I've attached a crash report as well, but here's what one sees in xcode on reproducing the crash:
The _computeToEndFrameForCurrentTransition block is nil inside the _transitionViewForCurrentTransition block, value of outerStrongSelf currently : <XxxYyyyyyZzz.PopupPresentationController: 0x12d017a40>. This most likely indicates that an adaptation is happening after a transtion cleared out _computeToEndFrameForCurrentTransition. Captured debug information outside block: presentationController : <XxxYyyyyyZzz.PopupPresentationController: 0x12d017a40> presentedViewController : <XxxYyyyyyZzz.SomeViewController: 0x12d03a690> presentingViewController : <UINavigationController: 0x12a817400>
2023-09-25_08-02-33.6523_-0500-7d355cd4a86427213389765ef070a777c4b4aaa3.crash
Whenever we present one of these view controllers, things work just fine. When we try to present another one though, if someone is aggressively changing the phone orientation, the app crashes. This crash occurs somewhere in between dismissing the old VC and presenting the new one. It occurs before I ever hit any breakpoints in the "present" animator for the second view controller.
I've narrowed things down a bit, and by commenting out our implementation of adaptivePresentationStyle(for:traitCollection:), the crash can't be reproduced anymore. The downside there being that the app no longer functions how we want it to. Our definition of that function (which causes crashes) looks like this:
public func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
guard forceUsingFullScreenIfCompact else {
return .none
}
return traitCollection.verticalSizeClass == .compact ? .overFullScreen : .none
}
A bit more testing, and it seems like if that function returns the same thing consistently, nothing crashes. Are we not allowed to put conditional logic in this function?
In the crash, we can see that it occurs due to a failing assertion internal to UIPresentationController:
Last Exception Backtrace:
0 CoreFoundation 0x1afa28cb4 __exceptionPreprocess + 164 (NSException.m:202)
1 libobjc.A.dylib 0x1a8abc3d0 objc_exception_throw + 60 (objc-exception.mm:356)
2 Foundation 0x1aa1b2688 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 172 (NSException.m:251)
3 UIKitCore 0x1b1d05610 __80-[UIPresentationController _initViewHierarchyForPresentationSuperview:inWindow:]_block_invoke + 2588 (UIPresentationController.m:1594)
4 UIKitCore 0x1b21f1ff4 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_3 + 300 (UIPresentationController.m:1228)
The question
This all leads us to wonder if we're doing something wrong, or if there could be a bug in one of the iOS APIs that we're consuming. Thus, posting here. Does anyone have any insight into how this could be occurring, or has seen this before and has ideas? Thanks!
Miscellaneous info
We target iOS 14+
We've seen this issue in debug and release builds from Xcode 14 and 15
We see the issue on users with iOS 15+, though it could be occurring on 14 in just incredibly low numbers
This is a re-post of https://developer.apple.com/forums/thread/738257, because I accidentally closed that out as resolved
Post not yet marked as solved
I asked a question here already and someone replied but then i had another question and no one replied so im making another thread.
I asked about what kind of information do i have to fill in when uploading my game.
When it comes to personal information is it just my nam?e, email?, phone?,bank account (can it be paypal or ebanks?), also do i need proof of address (can it be a p.o box? what else do i need?
I really want to know every single one of them. Thanks
Post not yet marked as solved
For the past few days, I've been experiencing errors when performing an Archive for distribution of my application.
The error occurs during the execution of GenerateDSYMFile, specifically in the extensions.
The complete error is:
error: cannot parse the debug map for
'/Users/-/Library/Developer/Xcode/DerivedData/-/Build/Intermediates.noindex/ArchiveIntermediates/-/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ExtensionName.appex/ExtensionName': No such file or directory
Versions that could previously be archived are now encountering this error. This issue is happening on two different machines.
I've tried complete cleanups of DerivedData and reinstalling Xcode 15.0 and 15.0.1.
Any idea what the problem might be?
Post not yet marked as solved
We have a set of Swift Packages with dependencies from one to another, and we need to build xcframeworks out of those. We currently iterate over each package and xcodebuild archives out of them, but this is really slow. It also seems that the dependencies are rebuilt for every package, and we're looking for a way to avoid that.
More precisely, say we have the following packages
CoreFoundation
Feature1, depending on CoreFoundation
We need to turn this into corefoundation.xcframework and feature1.xcframework. The problem is that when calling xcodebuild on Feature1, it seems to be rebuilding CoreFoundation even though it's already been built when building corefoundation.xcframework.
Anyone knows of a better way to do that ? Lumping it all together in a single xcframework doesn't seem to be possible.
Thanks for any input :)
Post not yet marked as solved
Hi,
We are strugling to find out why some numbers in AppStoreConnect does not mach eachother.
We have only 1 product - subscriptions in an app - nothing else.
Yet - AppStoreConnect gives us:
Payments and Financial report for oct: Sold - 1.545 units (which we translate as 1.545 subscriptions)
Trends -> State -> Month ending 31st Oct says: 1.360 active subscriptions.
I also went back to the very first months... Here I get:
Payments and Financial reports: Jun-21: 106 Jul-21: 130 Aug-21: 135
Trends -> State -> Month ending: 30-jun-21: 5 31-jul-21: 125 31-aug-21: 156
So sometimes the number from one report is bigger than the other - and other times it is the other way around.
I have read something about that it might be the dates, as the Apple calendar differs ... But that does not seem to explain things here, as I tried finding the exact date, where the Sold units from the payments report matched the state-report.
Payments Jun-21: 106 State date July 24h: 106
Payments Jul-21: 130 State date Aug 8th: 131
So maybe the two numbers are stating different things - but what?
It is of course important for us to be able to know which of the numbers we are to rely on when seeing the results of app-changes - and right now we know nothing, as there does not seem to be any logic to the numbers.
We really hope someone can help.
Best regards
Nina
Post not yet marked as solved
I am currently facing a problem where I want to localize the application's CFBundleDisplayName in Canadian English (amongst other languages and regions). It works well for all other use cases, including Canadian French. However for Canadian English, the app's name is just displayed in the main English localization (en).
To find out what is wrong, I set up a totally empty project and only localized the name - it doesn't work. I changed the type of localization from Strings file (legacy) to String catalog, same error. I summarized everything in this screenshot:
I've spent so much time already and still can't figure out what is happening. Can someone maybe quickly create a new project with the two localizations like in my screenshot and report if the same problem exists for English (Canada)?
TLDR: Localization of CFBundleDisplayName works for fr-CA but not for en-CA, problem exists even in minimal reproducible example (empty project with CFBundleDisplayName localization)
Post not yet marked as solved
Hello,
We have a few FAMILY_SHARED subscriptions which received a DID_RENEW notification, with all the cancellation fields completed, the expiration date in the future and no pending_renewal_info array in it.
We are not sure why did we get the DID_RENEW notification with the cancelation details, shouldn't we get a REVOKE notification?
We found this in the Apple documentation: The pending_renewal_info array is returned only for app receipts that contain auto-renewable subscriptions. If customers voluntarily cancel a subscription renewal while in the grace period, the App Store pauses billing retry, and removes the transaction from pending_renewal_info. The subscription is in the grace period if the key grace_period_expires_date_ms is present and the expiration date hasn't passed.
We do not handle any cancelation related logic for the DID_RENEW notification. Should we adjust the logic for this scenario or there should be a different notification type sent out.
This is how the latest element looks like from the lattest_recipt_info:
"auto_renew_status": "true",
"unified_receipt": {
"status": 0,
"environment": "Production",
"latest_receipt_info": [{
"quantity": "1",
"product_id": "product_id",
"transaction_id": "transaction_id",
"purchase_date": "2023-11-07 23:01:41 Etc/GMT",
"purchase_date_ms": "1699398101000",
"purchase_date_pst": "2023-11-07 15:01:41 America/Los_Angeles",
"original_purchase_date": "2021-10-07 22:01:42 Etc/GMT",
"original_purchase_date_ms": "1633644102000",
"original_purchase_date_pst": "2021-10-07 15:01:42 America/Los_Angeles",
"expires_date": "2024-11-07 23:01:41 Etc/GMT",
"expires_date_ms": "1731020501000",
"expires_date_pst": "2024-11-07 15:01:41 America/Los_Angeles",
"web_order_line_item_id": "web_order_line_item_id",
"is_trial_period": "false",
"is_in_intro_offer_period": "false",
"original_transaction_id": "original_transaction_id",
"cancellation_date": "2023-11-07 15:37:03 Etc/GMT",
"cancellation_date_ms": "1699371423020",
"cancellation_date_pst": "2023-11-07 07:37:03 America/Los_Angeles",
"cancellation_reason": "0",
"in_app_ownership_type": "FAMILY_SHARED",
"subscription_group_identifier": "subscription_group_identifier"
}
Post not yet marked as solved
Where do I place my code to instantiate my Project’s struct code within SwiftUI?
As you can see way below, I call:
_ = StaticObjects()
Within GameScene’s didMove
It seems the reason I don’t see the same #Preview image in my GameScene is that I am not explicitly returning a SwiftUI some View within my struct layout.
I do know that didMove is really called .. but I just don’t see anything within the Simulator
My #Preview works great:
The following code appears within GameScene.swift of my Xcode Project:
import SpriteKit
import SwiftUI
struct StaticObjects : View {
// some View is returned when our struct is instantiated
var body: some View {
let theBuildings = ["hotel",
"saloon",
"watertower",
"jail",
"farmhouse",
"barn"]
let theFigures = ["desperado",
"sheriff",
"space",
"space",
"horse",
"guy"]
VStack {
HStack(alignment: .bottom) {
ForEach(theBuildings, id: \.self) { theBuilding in
Image(theBuilding)
.resizable() // for rotation
.scaledToFit()
.zIndex(2)
Spacer()
} // ForEach
} // HStack for theBuildings
HStack(alignment: .bottom) {
ForEach(theFigures, id: \.self) { theFigure in
Image(theFigure)
.resizable() // for rotation
.frame(width: 120, height: 230)
.offset(x: 0.0, y: -50.0)
.zIndex(2)
Spacer()
} // ForEach
} // HStack for theFigures
// aligns vertically the entire struct to the top
Spacer()
} // VStack
} // body:
} // struct StaticObjects
/*
#Preview {
StaticObjects()
}
*/
class GameScene: SKScene, SKPhysicsContactDelegate {
override func sceneDidLoad() {
super.sceneDidLoad()
} // sceneDidLoad
override func didMove(to view: SKView) {
super.didMove(to:view)
physicsWorld.contactDelegate = self
_ = StaticObjects() // doesn’t work
} // didMove
func didBegin(_ contact: SKPhysicsContact) {
// ...
} // didBegin
} // class GameScene
Post not yet marked as solved
Launching lib/main.dart on iPhone 14 Plus in debug mode...
Running Xcode build...
Xcode build done. 65.2s
Failed to build iOS app
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC0D16DecodingStrategyO4blobyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC19KeyDecodingStrategyO14useDefaultKeysyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC19keyDecodingStrategyAC03KeygH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC20DateDecodingStrategyO6customyAE10Foundation0F0Vs0E0_pKccAEmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC20dataDecodingStrategyAC0dgH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC20dateDecodingStrategyAC04DategH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC23passthroughTypeResolverAA026StructureCodingPassthroughgH0_pXpvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC34NonConformingFloatDecodingStrategyO5throwyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC34nonConformingFloatDecodingStrategyAC03NonghiJ0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC6decode_4fromxxm_yptKSeRzlFTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC8userInfoSDys010CodingUserG3KeyVypGvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC0D16EncodingStrategyO4blobyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC19KeyEncodingStrategyO14useDefaultKeysyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC19keyEncodingStrategyAC03KeygH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC20DateEncodingStrategyO6customyAEy10Foundation0F0V_s0E0_ptKccAEmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC20dataEncodingStrategyAC0dgH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC20dateEncodingStrategyAC04DategH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC23passthroughTypeResolverAA026StructureCodingPassthroughgH0_pXpvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC34NonConformingFloatEncodingStrategyO5throwyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC34nonConformingFloatEncodingStrategyAC03NonghiJ0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC6encodeyypxKSERzlFTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC8userInfoSDys010CodingUserG3KeyVypGvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift38StructureCodingPassthroughTypeResolverP02isfG0ySbqd__lFZTq
Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)
Could not build the application for the simulator.
Error launching application on iPhone 14 Plus.
Post not yet marked as solved
hi,i want to create a NSFileProviderExtension , need add file for storage, but, i create a folder, xocde show a error :
[ERROR] List of user interactions is not an array