Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanadero committed Mar 8, 2019
2 parents e822fe0 + 57bc770 commit abd1bf5
Show file tree
Hide file tree
Showing 37 changed files with 33 additions and 38 deletions.
14 changes: 1 addition & 13 deletions src/android/SightCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import com.sightcall.universal.event.CallReportEvent;
import com.sightcall.universal.fcm.messages.GuestReady;
import com.sightcall.universal.media.MediaSavedEvent;
import com.sightcall.universal.model.Config;
import com.sightcall.universal.model.Session;
import com.sightcall.universal.scenario.Step;
import com.sightcall.universal.scenario.steps.GuestPincodeCallStep;
import com.sightcall.universal.scenario.steps.HostPincodeCallStep;
Expand Down Expand Up @@ -99,7 +97,7 @@ public void onMediaSavedEvent(MediaSavedEvent event) {
@Event
public void onStepStateEvent(Step.StateEvent event) {
Log.i(TAG, event.toString());
if (event.state() == Step.State.SUCCESS) {
if (event.state() == Step.State.ACTIVE) {
final Step step = event.step();
if (step instanceof GuestPincodeCallStep) {
// On the Guest side
Expand Down Expand Up @@ -327,16 +325,6 @@ private void startCall(String url) {
Universal.start(url);
}

private String getCallId(Session session) {
if (session == null || session.config() == null) {
return null;
}
Config config = session.config();
if (session.config().code() != null) {
return session.config().code().value();
}
return config.pin();
}
}

final class Methods {
Expand Down
3 changes: 2 additions & 1 deletion src/ios/CDVSightCall.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#import <LSUniversalSDK/LSUniversalSDK.h>
#import "CallLocalNotification.h"

@interface CDVSightCall : CDVPlugin<LSUniversalDelegate, LSPictureProtocol, UNUserNotificationCenterDelegate>
@interface CDVSightCall : CDVPlugin<LSUniversalDelegate, LSPictureProtocol, UNUserNotificationCenterDelegate, LSUniversalLogDelegate>

#if !(TARGET_OS_SIMULATOR)
@property (strong, nonatomic) LSUniversal* lsUniversal;
Expand All @@ -13,6 +13,7 @@

- (void)registerListener:(CDVInvokedUrlCommand *)command;
- (void)demo:(CDVInvokedUrlCommand*)command;
- (void)enableLogger:(CDVInvokedUrlCommand*)command;
- (void)setEnvironment:(CDVInvokedUrlCommand*)command;
- (void)isAgentAvailable:(CDVInvokedUrlCommand*)command;
- (void)registerAgent:(CDVInvokedUrlCommand*)command;
Expand Down
33 changes: 30 additions & 3 deletions src/ios/CDVSightCall.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,26 @@ @implementation CDVSightCall
@synthesize ignoreUsecaseConfiguration;

static CDVSightCall *instance;
BOOL isLoggerEnabled = FALSE;

#pragma mark - Plugin Initialization

- (void)pluginInitialize
{
self.lsUniversal = [[LSUniversal alloc] init];
[self initSightcall];
instance = self;
self.ignoreUsecaseConfiguration = TRUE;
}

- (void)registerListener:(CDVInvokedUrlCommand *)command {
self.listenerCallbackID = command.callbackId;
- (void)initSightcall {
self.lsUniversal = [[LSUniversal alloc] init];
self.lsUniversal.delegate = self;
[self.lsUniversal setPictureDelegate: self];
self.lsUniversal.logDelegate = self;
}

- (void)registerListener:(CDVInvokedUrlCommand *)command {
self.listenerCallbackID = command.callbackId;
}

#pragma mark - LSUniversalDelegate
Expand Down Expand Up @@ -162,10 +168,18 @@ - (void)demo:(CDVInvokedUrlCommand*)command
NSLog(@"SightCall: demo function invoked");
}

- (void)enableLogger:(CDVInvokedUrlCommand *)command
{
[self performCallbackWithCommand:command withBlock:^(NSArray *args, CordovaCompletionHandler completionHandler) {
isLoggerEnabled = [args objectAtIndex:0];
}];
}

- (void)setEnvironment:(CDVInvokedUrlCommand *)command {
[self performCallbackWithCommand:command withBlock:^(NSArray *args, CordovaCompletionHandler completionHandler) {
NSString *env = [[args objectAtIndex:0] lowercaseString];
[[NSUserDefaults standardUserDefaults] setObject:env forKey:@"kStorePlatform"];
[self initSightcall];
}];
}

Expand Down Expand Up @@ -512,6 +526,19 @@ - (void)performCallbackWithCommand:(CDVInvokedUrlCommand *)command withBlock:(Co
}];
}

#pragma mark Logger

//this delegate method is called when a log line is emitted by the SDK
- (void)logLevel:(NSInteger)level logModule:(NSInteger)module fromMethod:(NSString *)originalSel message:(NSString *)message, ...;
{
if (isLoggerEnabled) {
va_list pe;
va_start(pe, message);
NSString *sMessage = [[NSString alloc] initWithFormat:message arguments:pe];
va_end(pe);
NSLog(@"%@ %@", originalSel, sMessage);
}
}

@end
#endif
Binary file modified src/ios/Sightcall/LSUniversalSDK.framework/Assets.car
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

NS_ASSUME_NONNULL_BEGIN


@protocol LSMAUsecase <NSObject>

@property (nonatomic, readonly, nullable) NSString *name;
Expand Down
Binary file modified src/ios/Sightcall/LSUniversalSDK.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified src/ios/Sightcall/LSUniversalSDK.framework/LSUniversalSDK
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 0 additions & 19 deletions typings/sightcall.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
declare module SightCall {
interface SightCallPlugin {
demo(): void;
/**
* It enables SDK logger for debug purpose.
* Only available on Android.
* @param enabled
*/
enableLogger(enabled: boolean): void;
setEnvironment(environmentKey: string): void;
isAgentAvailable(): Promise<void>;
Expand All @@ -18,12 +13,6 @@ declare module SightCall {
* @type {[type]}
*/
generateURL(referenceId: string): Promise<{ url: string; callId: string; }>;
/**
* Revokes a call invitation by invitation ID
* [invitationId Invitation ID]
* @type {[type]}
*/
revokeInvitation(invitationId: string): void;
/**
* The method checks if the payload belongs to Sight Call and
* if it has been received because the guest is ready to start the call.
Expand All @@ -46,14 +35,6 @@ declare module SightCall {
*/
handleCallLocalNotification(payload: any): void;
startCall(url: string): void;
/**
* This method handles the local notification displayed due to an entry call
* and generates an event (only generated on iOS) to notice that the call has been accepted.
* This method should be invoked after invoking 'isCallLocalNotification'
* Only available on iOS.
* @param payload Push payload
*/
handleCallLocalNotification(payload: any): void;
}
interface GuestReadyEvent {
callId: string;
Expand Down
1 change: 0 additions & 1 deletion www/sightcall.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ SightCall.startCall = function(url) {
exec(null, null, "SightCall", "startCall", [url]);
};


SightCall.bindDocumentEvent = function() {
exec(function(e) {
console.log("Firing document event: " + e.eventType + " with data " + JSON.stringify(e.eventData));
Expand Down

0 comments on commit abd1bf5

Please sign in to comment.