Kevin Lieser
Kevin Lieser

Reputation: 987

Transfer object via WatchConnectivity from iOS to watchOS

I am trying to transfer EventKit Data like EKCalendars / EKEvents / EKReminder from iOS to watchOS via WatchConnectivity.

The connection works but I cannot push these objects directly in response. I also cannot use NSKeyedArchiver since EKCalendars (example) are not able to get converted to Data.

So, any Idea how I can transfer simple EventKit Data from iOS to watchOS?

An additional hint: I am already fetching these data within watchOS (so no solution) but if the device has an MDM profile it cannot fetch anything but the holiday calendar so I just wanted to test if the iPhone can fetch more (since the MDM profile is stored on iPhone, not on watch) but I can't transfer these data trough WatchConnectivity.

Upvotes: 0

Views: 109

Answers (1)

MykolaSharhan
MykolaSharhan

Reputation: 406

You can serialize objects to String, transmit, and deserialize back to the object you need. Probably not the best way, but worked for me.

Upvotes: 0

Related Questions