Git Product home page Git Product logo

svmp-ios-client's Introduction

SVMP iOS Client

Building

Building the iOS Client

  1. Checkout the SVMP client into a directory of your choice

    cd ${SVMP}
    git clone https://github.com/SVMP/svmp-iOS-client.git
    
  2. Download the submodules

git submodule update --init
  1. Open up the Xcode project at svmp-iOS-client/ios-example/Svmp-iOS-Client.xcodeproj
  2. Click the run button

Building the Protobuf

  1. Build protobuf

Download protobuf 2.5.0 here

tar zxf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0.tar.gz
./configure
make
make check
make install
  1. Download and build objective c plugin

A plugin is used to allow objective c code to be generated. Clone the github project here: https://github.com/Packetdancer/protobuf-objc

git clone https://github.com/Packetdancer/protobuf-objc.git

Build the plugin

cd protobuf-objc
./autogen.sh
./configure CXXFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
make
make install
  1. Download the SVMP Protobuf source
git clone https://github.com/SVMP/svmp-protocol-def.git
  1. Generate the objective c code
protoc --plugin=/usr/local/bin/protoc-gen-objc --proto_path=<path/to>/svmp-protocol-def/ --objc_out=./ <path/to>/svmp-protocol-def/svmp.proto

There should be an Svmp.pb.h and Svmp.pb.m file in the current directory now.

  1. Fix the code

Unfortunately, there is an error in the objective c code generated by the plugin.

You must comment out a for loop within the storeInDictionary method within the Svmp.pb.m file.

- (void) storeInDictionary:(NSMutableDictionary *)dictionary {
  if (self.hasAction) {
    [dictionary setObject: @(self.action) forKey: @"action"];
  }
  for (Intent_Tuple* element in self.extrasArray) {
    NSMutableDictionary *elementDictionary = [NSMutableDictionary dictionary];
    [element storeInDictionary:elementDictionary];
    [dictionary setObject:[NSDictionary dictionaryWithDictionary:elementDictionary] forKey: @"extras"];
  }
  if (self.hasData) {
    [dictionary setObject: self.data forKey: @"data"];
  }
  NSMutableArray * flagsArrayArray = [NSMutableArray new];
  NSUInteger flagsArrayCount=self.flagsArray.count;
  for(int i=0;i<flagsArrayCount;i++){
    [flagsArrayArray addObject: @([self.flagsArray int32AtIndex:i])];
  }
  [dictionary setObject: flagsArrayArray forKey: @"flags"];

  // V-- Comment this out otherwise you will get an error stating 'use of undeclared identifier 'output''
  /*for (NSString* element in self.categoriesArray) {
    [output appendFormat:@"%@%@: %@\n", indent, @"categories", element];
  }*/
  [self.unknownFields storeInDictionary:dictionary];
}
  1. Copy the generated protobuf code into the SVMP project
cp Svmp.pb.* <path/to/svmp>/svmp-iOS-client/ios-example/AppRTCDemo/

Building Webrtc

TODO

License

Copyright (c) 2012-2014, The MITRE Corporation, All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

svmp-ios-client's People

Contributors

dkeppler avatar gavin-black avatar jznadams avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.