Latest 1.0.4
License MIT
Platforms ios 8.0, requires ARC


Google Protocol Buffer v2.6 API auto packer




Using AFNetworking call API:

Using SILManager:

Using Python-packer:

How to use:

  • Step 1: Prepared the .json file which contains the API spec definition and the related .proto files which contains the protobuf messages that API spec needs and put all of them into /python-packer/input.
  • Step 2: Execute the python and generate the code you need. If found some errors, please fix them and try again.
  • Step 3: Import the iOS or Android SDK files into your project.
  • Step 4: If your iOS project is default set to ARC, you need to add MRC flag "-fno-objc-arc" to the *.pbobjc.m at your build target because the fils generated by protobuf was default in MRC)
  • Step 5: Put the generated code into your project.
  • Step 6: Done! just try call the method in your code to request data from an API you defined.

Project contains:

  • java-android
    • Http API Request Android Framework
    • Demo of silver ProtoBuffer usage
  • objc-ios
    • Http API Request iOS Framework
    • Demo of silver ProtoBuffer usage
  • python-packer
    • API packer python script
    • Input Container
    • Output Demo
  • server-sample
    • A server sample code based on Spring Boot Framework that can be used for the demos above


  • iOS Part
    • TODO prefix
    • TODO id


  • iOS SDK
    • The requester part was based on AFNetworking, but AFNetworking only support sending the NSDictionary as parameters, so I modified some code of it to support sending the serialized protobuf binary data.
  • Android SDK
    • Based on AsyncHttp, because AsyncHttp didn’t support cache, so currently didn’t add the cache related feature.
  • For the packer
    • There have some code to remove and add the "objc_class_prefix". Because there Google Protobuf 2 complier didn’t support iOS prefix but in the Google Protobuf 3 support it.
    • Need to install both protobuf and [email protected] in brew. Because the .java files generated under the brew protobuf 3.x environment can’t be integrated into protobuf 2.x projects, so there are some code do the link and unlink.
    • Now didn’t support the "import" in .proto file so need to fix some build break in the generated files.

Problems found

  • Protobuf import syntax support



  • Release the iOS framework


Email: [email protected]

By Junchao/silver6wings

Latest podspec

    "name": "SilverProtoBuffer",
    "version": "1.0.4",
    "summary": "A networking framework based on Google Protobuf v2.6 & AFNetworking that can help you pack APIs",
    "cocoapods_version": ">= 1.0",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "silver6wings": "[email protected]"
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "1.0.4"
    "requires_arc": true,
    "source_files": [
    "subspecs": [
            "name": "AFNetworking+Silver",
            "source_files": "objc-ios/AFNetworking/*.{h,m}"
            "name": "Protobuf260",
            "requires_arc": false,
            "source_files": [
            "exclude_files": "objc-ios/GoogleProtobuf/GPBProtocolBuffers.m"

Pin It on Pinterest

Share This