Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use #4

Open
ximlu opened this issue Sep 26, 2023 · 6 comments
Open

How to use #4

ximlu opened this issue Sep 26, 2023 · 6 comments

Comments

@ximlu
Copy link

ximlu commented Sep 26, 2023

image I have followed the documentation to use it in my project, but the callback has not been captured. I'm not sure if it's a bug or an issue with my implementation. It would be great if there is a demo on how to upload and download data.
@ryanashcraft
Copy link
Owner

@ximlu Please check out @thillsman's project for an example (specifically look at KnapsackManager.swift). Also pay attention to what is getting logged with subsystem "com.ryanashcraft.CloudSyncSession"

@ximlu
Copy link
Author

ximlu commented Sep 27, 2023

I tried according to the configuration, but kept reporting errors. The following is the log of the project output

2023-09-27 10:43:37.727764+0800 Knapsack[1005:38787] [Sync Event] Start
2023-09-27 10:43:37.727913+0800 Knapsack[1005:38787] [Sync Event] Do work: Fetch
2023-09-27 10:43:37.727961+0800 Knapsack[1005:38787] [Sync Event] Do work: Create zone
2023-09-27 10:43:37.728002+0800 Knapsack[1005:38787] [Sync Event] Do work: Create subscription
2023-09-27 10:43:37.770861+0800 Knapsack[1005:38787] [Sync Event] Account status changed: Available
2023-09-27 10:43:41.090270+0800 Knapsack[1005:38787] Custom zone exists
2023-09-27 10:43:41.090747+0800 Knapsack[1005:38781] [Sync Event] Work success: Create zone
2023-09-27 10:43:43.196752+0800 Knapsack[1005:38789] [CK] Got a connection error for operation 884EF02AE430F6B5: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 969 named com.apple.cloudd was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service with pid 969 named com.apple.cloudd was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}
2023-09-27 10:43:43.202558+0800 Knapsack[1005:38782] Failed to check for subscription existence: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 969 named com.apple.cloudd was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service with pid 969 named com.apple.cloudd was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}
2023-09-27 10:43:43.204088+0800 Knapsack[1005:38789] [Sync Event] Halt

@ximlu
Copy link
Author

ximlu commented Sep 27, 2023

image
I created a RecordType using my own account, and used the public_database as I wanted to check whether the data was successfully synced on the CloudKit dashboard. However, I have been receiving errors and am not quite sure where the problem lies. Here is a configuration:

static let storeIdentifier: String = "xxxxxxxxx"
static let zoneID: CKRecordZone.ID = .default
static let subscriptionID: String = ""
static let log: OSLog = .default

@ximlu
Copy link
Author

ximlu commented Sep 27, 2023

I can basically confirm that there is indeed a problem with the framework, and I can upload it using the original API

@ryanashcraft
Copy link
Owner

@ximlu I am not sure. I can tell you that this framework has been used in production for my app. There is likely something environmental causing issues. Are you testing this on a simulator or an actual device? The error seems to be underlying in the CloudKit framework itself, and CloudSyncSession is halting as a result.

Have you tried setting subscriptionID to something that's not empty string?

@ximlu
Copy link
Author

ximlu commented Sep 28, 2023

@ryanashcraft I am using real device for testing, and the system is iOS16+. Therefore, I really hope that you can provide a demo without any issues. I highly doubt the reliability of the demo you mentioned for self-use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants