Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
issue 21 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
trinisofttechnologies committed Aug 19, 2017
1 parent 1f5d040 commit 550fefb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 6 additions & 1 deletion Countly.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,10 @@ Countly.userData.setOnce = function(keyName, setOnce){
cordova.exec(Countly.onSuccess,Countly.onError,"CountlyCordova","userData_setOnce",[keyName.toString() || "", setOnce.toString() || ""]);
};

Countly.addCrashLog = function(crashLog){
cordova.exec(Countly.onSuccess,Countly.onError,"CountlyCordova","addCrashLog",[crashLog || ""]);
};


window.Countly = Countly;
document.addEventListener("deviceready", Countly.deviceready, false);
document.addEventListener("deviceready", Countly.deviceready, false);
15 changes: 7 additions & 8 deletions src/ios/CountlyCordova.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ - (void)init:(CDVInvokedUrlCommand*)command
CDVPluginResult* pluginResult = nil;
NSString* serverurl = [command.arguments objectAtIndex:0];
NSString* appkey = [command.arguments objectAtIndex:1];

if(config == nil){
config = CountlyConfig.new;
}
Expand Down Expand Up @@ -294,10 +294,9 @@ - (void)enableCrashReporting:(CDVInvokedUrlCommand*)command

- (void)addCrashLog:(CDVInvokedUrlCommand*)command
{
NSString* token = [command.arguments objectAtIndex:0];
NSString* messagingMode = [command.arguments objectAtIndex:1];
int mode = [messagingMode intValue];
NSData *tokenByte = [token dataUsingEncoding:NSUTF8StringEncoding];
NSString* record = [command.arguments objectAtIndex:0];
[Countly.sharedInstance crashLog: record];

CDVPluginResult* pluginResult = nil;
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"addCrashLog!"];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
Expand Down Expand Up @@ -411,11 +410,11 @@ - (void)setOptionalParametersForInitialization:(CDVInvokedUrlCommand*)command
if(config == nil){
config = CountlyConfig.new;
}

config.ISOCountryCode = country;
config.city = city;
config.location = (CLLocationCoordinate2D){latitudeDouble,longitudeDouble};

CDVPluginResult* pluginResult = nil;
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"setOptionalParametersForInitialization!"];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
Expand All @@ -432,4 +431,4 @@ - (void)demo:(CDVInvokedUrlCommand*)command
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

@end
@end

0 comments on commit 550fefb

Please sign in to comment.