2

Currently, I got a task to explore google flatbuffers on iOS and OSX. I explored the documentation provided by Google.
Also found some libraries on Github on swift language like FlatBuffersSwift and others that implement the flatbuffers. So, I have mainly two concerns on that

  1. Will Apple approve my app if I used this in my iOS application?
  2. Is it possible to create schema on runtime from JSON ? or we must manually create schemas (.fbs) and use flatc library for creating model binaries (like .swift) files.

Any help please Thanks in advance

CoyBit
  • 1,592
  • 1
  • 17
  • 19

1 Answers1

1

1) There's nothing in the Apple approval process that has to do with your choice of serialization library. 2) To get the benefits of this library, you want to create a schema and generate code for it ahead of compilation time. If your use case is so dynamic that you want to be able to do everything at runtime, you're probably better off with a good JSON library.

Aardappel
  • 5,559
  • 1
  • 19
  • 22
  • thanks for your quick response . you said we have to create schema and generate code ahead of compilation time , so for our app we can convert our API response from JSON to flatbuffers binaries and our app consume response in flatbuffers binaries . do we take it right ? what do you suggest as we want to use flatbuffer in our ios and cocoa app. – Muhammad kumail Feb 13 '19 at 07:27
  • also for your second suggestion , please tell how facebook use flatbuffers for their apps as their data is also very dynamic and able to do everything at runtime ? thanks – Muhammad kumail Feb 13 '19 at 07:34
  • Yes, you should be able to do everything with FlatBuffers that currently works in JSON. You can try to use the Swift implementation, but that is not officially supported, you can alternatively interface with the C or C++ versions thru Objective-C. As for facebook.. no they don't use dynamic schemas.. that is not how you use these kinds of serialization system (FlatBuffers, Protobuf..) – Aardappel Feb 13 '19 at 15:41
  • thanks @aardappel . if we get our API responses in JSON , so how can we use this in our app using flatBuffers ? whats the best approach you can suggest ? – Muhammad kumail Feb 14 '19 at 11:57
  • I'd convert JSON to FlatBuffers even on the server.. you can do this using flatc, or even in-app using C++ code. Though best of course if your APIs generate FlatBuffers to start with. – Aardappel Feb 14 '19 at 18:21