SyncManager iOS Offline

Hey all,

I have successfully integrated Sendbird into my iOS app, online only. I’ve been looking at the example for SyncManager to enable offline mode so that I can view messages in channels when I’m in airplane mode. It seems like in the example channels works this way but messages do not, the documentation makes sense though it is just a snippet. I just want to ensure that I am doing it the right way. In addition to that, I get the following warnings in Xcode when I use SyncManager. If anyone knows how to properly implement it in Swift 5 that would be super helpful!

CoreData: fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using “NSSecureUnarchiveFromData” or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using “NSSecureUnarchiveFromData” when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.
CoreData: warning: Property ‘filter’ on Entity ‘Chunk’ is using nil or an insecure NSValueTransformer. Please switch to using “NSSecureUnarchiveFromData” or a subclass of NSSecureUnarchiveFromDataTransformer instead.

1 Like

Hi Ben,

  1. To load the messages in the channel when the airplane mode is turned off, just call the method below in viewDidLoad():
self.collection?.fetch(in: .previous, completionHandler: { (hasMore, error) in
             
})
  1. Have you ever seen that warning while building the SyncManager sample project?
1 Like

Hello Ben,

I found that there’s some bug in SyncManager for the warning you mentioned. I will make sure to include the fix on next release. Thank you for the feedback!

3 Likes

Hello Ben, we released SyncManager v1.1.20. Can you try out and let me know if it is fixed for sure :slight_smile:

3 Likes

Thanks for making that fix Woo though I still get this:

fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using “NSSecureUnarchiveFromData” or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using “NSSecureUnarchiveFromData” when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.

CoreData: fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using “NSSecureUnarchiveFromData” or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using “NSSecureUnarchiveFromData” when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.

2020-05-01 13:02:03.296385-0400 Curtn[14728:3086596] [error] CoreData: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using “NSSecureUnarchiveFromData” or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using “NSSecureUnarchiveFromData” when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.

CoreData: warning: Property ‘filter’ on Entity ‘Chunk’ is using nil or an insecure NSValueTransformer. Please switch to using “NSSecureUnarchiveFromData” or a subclass of NSSecureUnarchiveFromDataTransformer instead.

What version are you using? There was a problem with build script and I released new version (1.1.21)

Sorry for the delayed response Woo, I had to do a pod update, I was on 1.1.20. It seems to not throw the warning anymore! Thanks!

1 Like