Latest 1.0.1
Homepage https://github.com/Gruveo/gruveo-ios-sdk
License MIT
Platforms ios 9.0
Dependencies GoogleWebRTC
Authors

Gruveo SDK for iOS

The Gruveo SDK for iOS and a sample project.

Pod Installation

To add the Gruveo SDK for iOS to your app, you will need CocoaPods, which is a dependency manager for Objective-C. You can install CocoaPods with the following command:

$ gem install cocoapods

Podfile

To integrate the Gruveo SDK into your Xcode project using CocoaPods, add the GruveoSDK pod to your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

target 'TargetName' do
pod 'GruveoSDK'
end

Then, run the following command:

$ pod install

Application Setup and Usage

  1. Add NSCameraUsageDescription and NSMicrophoneUsageDescription to your application’s Info.plist
  2. Set “Enable Bitcode” to NO in Target -> Build Settings -> Enable Bitcode
  3. Import GruveoSDK to the AppDelegate and your ViewController class:
    @import GruveoSDK;
  4. Register your сlient ID after application startup:
    [GruveoCallManager setClientId:@"demo”]
  5. Set delegate for GruveoCallManager in the viewDidLoad function:
    [GruveoCallManager setDelegate:self]
  6. Implement creation of the Gruveo call screen:
    [GruveoCallManager callCode:@"hello" videoCall:YES onViewController:self callCreationCompletion:^(CallInitError creationError) {
    if (creationError != CallInitErrorNone) {
        // Show error here
    }
    }];
  7. Implement the delegate function for token signing. Warning: The sample implementation below uses a signing endpoint provided by Gruveo and will only work for the demo client ID:

    - (void)requestToSignApiAuthToken:(NSString *)token {
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api-demo.gruveo.com/signer"]];
    [request setHTTPMethod:@"POST"];
    [request setValue:@"text/plain" forHTTPHeaderField:@"Content-Type"];
    [request setHTTPBody:[token dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
    NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration delegate:nil delegateQueue:nil];
    
    [[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
        if ([data isKindOfClass:[NSData class]]) {
            NSString *signedToken = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
            [GruveoCallManager authorize:signedToken];
        } else {
            [GruveoCallManager authorize:nil];
        }
    }] resume];
    }
  8. Implement the other useful delegate functions:
    - (void)callEstablished {}
    - (void)callEnd:(GruveoCallEndReason)reason {}
    - (void)recordingStateChanged {}
  9. Build and run your application.

Latest podspec

{
    "name": "GruveoSDK",
    "version": "1.0.1",
    "summary": "GruveoSDK is framework to make call using Gruveo API",
    "description": "The Gruveo SDK for iOS lets you quickly and easily add a white-label screen with a video calling UI to your iOS app. It is the ready-to-use solution you need to add video and voice calling to your iOS app in minutes.",
    "homepage": "https://github.com/Gruveo/gruveo-ios-sdk",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Gruveo": "art@gruveo.com"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/Gruveo/gruveo-ios-sdk.git",
        "tag": "1.0.1"
    },
    "dependencies": {
        "GoogleWebRTC": [
            "~> 1.0.136171"
        ]
    },
    "vendored_frameworks": "GruveoSDK/GruveoSDK.framework"
}

Pin It on Pinterest

Share This