//
//  CDVAppVuze.m
//  appVuze PhoneGap Cordova Plugin
//
//  Created by Maksim Orlovich on 9/26/16.
//  Copyright (c) 2016 appVuze, Inc. All rights reserved.
//

#import "CDVAppVuze.h"
#import <appVuze/appVuze.h>

@implementation CDVAppVuze

- (void)initializeSdk:(CDVInvokedUrlCommand*)command
{
    // Replace YOUR_APPLICATION_KEY with a key obtained from https://appvuze.io dashboard
    // Remember to enclose application key string in @""
    [appVuze initializeSdkWithApplicationKey:YOUR_APPLICATION_KEY];
}

- (void)beginHelpSession:(CDVInvokedUrlCommand*)command
{
    NSArray *arguments = command.arguments;
    NSString *personName = [arguments count] > 0 ? [arguments objectAtIndex:0] : nil;
    NSDictionary *customData = [arguments count] > 1 ? [arguments objectAtIndex:1] : nil;

    [appVuze beginHelpSessionWithPersonName:personName
                                 customData:customData];
}

- (void)setNetworkConnectivityRequiredMessage:(CDVInvokedUrlCommand*)command
{
    [appVuze setNetworkConnectivityRequiredMessage:[command.arguments objectAtIndex:0]];
}

- (void)setInAppSupportServiceUnavailableMessage:(CDVInvokedUrlCommand*)command
{
    [appVuze setInAppSupportServiceUnavailableMessage:[command.arguments objectAtIndex:0]];
}

- (void)setIncomingSupportCallMessage:(CDVInvokedUrlCommand*)command
{
    [appVuze setIncomingSupportCallMessage:[command.arguments objectAtIndex:0]];
}

- (void)setConfirmDisconnectFromSupportMessage:(CDVInvokedUrlCommand*)command
{
    [appVuze setConfirmDisconnectFromSupportMessage:[command.arguments objectAtIndex:0]];
}

- (void)setEndedSupportCallMessage:(CDVInvokedUrlCommand*)command
{
    [appVuze setEndedSupportCallMessage:[command.arguments objectAtIndex:0]];
}

- (void)setWelcomeMessage:(CDVInvokedUrlCommand*)command
{
    [appVuze setWelcomeMessage:[command.arguments objectAtIndex:0]];
}

- (void)setReconnectToHelpSessionMessage:(CDVInvokedUrlCommand*)command
{
    [appVuze setReconnectToHelpSessionMessage:[command.arguments objectAtIndex:0]];
}

- (void)setApplicationUpdateRequiredMessage:(CDVInvokedUrlCommand*)command
{
    [appVuze setApplicationUpdateRequiredMessage:[command.arguments objectAtIndex:0]];
}

@end
