Hi
I wrote BroadcastExtension which uses ReplayKit 2 for screen recording and encoding. Then i want to send this data to the main app. My first thought was to use UserDefaults with suit name (app group), set data to the specific key, and the main app can receive this data. But the problem is, this data is large (it can be even 500Kb per frame, if this is I frame). And here there is a race when the extension can write faster than the application receives a notification about it. I fell like i'm doing something wrong.
So my questions is:
-
What is properly way to send often frequently changed large data (up to 500Kb size) and up to 60 updates per second to the main app? And then the main application would receive this data in strict accordance with how they were sent. If I write each time new data into one UserDefaults key, then i got the race. Maybe i should split the new data by different keys, but idk is there is good way to send so large data using UserDefaults ? I guess it wasn't made for that.
-
Is there any way to use some like IPC between main app and broadcast extension? I didn't find is there a way to do this? I just want to transfer data in one direction, without saving it to a file or somewhere else as fast as i can.