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

Commit

Permalink
basic communication working
Browse files Browse the repository at this point in the history
  • Loading branch information
trinisofttechnologies committed Apr 15, 2017
1 parent 5f00db0 commit 57818b9
Showing 1 changed file with 51 additions and 50 deletions.
101 changes: 51 additions & 50 deletions ios/CountlyReactNative.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

@implementation CountlyReactNative

RCT_EXPORT_MODULE();
RCT_EXPORT_MODULE();


- (void)echo:(NSArray*)arguments
RCT_EXPORT_METHOD(echo:(NSArray*)arguments)
{
RCTLogInfo(@"Nicolson look here this is called");
}

- (void)init:(NSArray*)arguments
Expand Down Expand Up @@ -47,7 +48,7 @@ - (void)event:(NSArray*)arguments
NSString* countString = [arguments objectAtIndex:2];
int countInt = [countString intValue];
[[Countly sharedInstance] recordEvent:eventName count:countInt];

}
else if ([eventType isEqual: @"eventWithSum"]){
NSString* eventName = [arguments objectAtIndex:1];
Expand Down Expand Up @@ -86,24 +87,24 @@ - (void)event:(NSArray*)arguments
} else {
}


}
- (void)recordView:(NSArray*)arguments
{

NSString* recordView = [arguments objectAtIndex:0];
[Countly.sharedInstance reportView:recordView];

}
- (void)setloggingenabled:(NSArray*)arguments
{


}

- (void)setuserdata:(NSArray*)arguments
{

NSString* name = [arguments objectAtIndex:0];
NSString* username = [arguments objectAtIndex:1];
NSString* email = [arguments objectAtIndex:2];
Expand Down Expand Up @@ -136,7 +137,7 @@ - (void)setuserdata:(NSArray*)arguments
// kCLYUserUsername: username,
// kCLYUserPicture: picture
// }];

}


Expand All @@ -149,69 +150,69 @@ - (void)onregistrationid:(NSArray*)arguments
if(mode == 1){
// [[CountlyConnectionQueue sharedInstance] setStartedWithTest:YES];
}
// CountlyPushNotifications.sharedInstance.token = token;
// [CountlyPushNotifications.sharedInstance sendToken];
// CountlyPushNotifications.sharedInstance.token = token;
// [CountlyPushNotifications.sharedInstance sendToken];
// [Countly.sharedInstance didRegisterForRemoteNotificationsWithDeviceToken:tokenByte];

// [[CountlyConnectionQueue sharedInstance] tokenSession:token];



}

- (void)start:(NSArray*)arguments
{
[Countly.sharedInstance resume];



}

- (void)stop:(NSArray*)arguments
{
[Countly.sharedInstance suspend];



}

- (void)changeDeviceId:(NSArray*)arguments
{
NSString* newDeviceID = [arguments objectAtIndex:0];
[Countly.sharedInstance setNewDeviceID:newDeviceID onServer:YES];



}

- (void)setHttpPostForced:(NSArray*)arguments
{


}

- (void)enableParameterTamperingProtection:(NSArray*)arguments
{
NSString* salt = [arguments objectAtIndex:0];
config.secretSalt = salt;



}

- (void)startEvent:(NSArray*)arguments
{
NSString* eventName = [arguments objectAtIndex:0];
[Countly.sharedInstance startEvent:eventName];



}

- (void)endEvent:(NSArray*)arguments
{
NSString* eventType = [arguments objectAtIndex:0];


if ([eventType isEqual: @"event"]) {
NSString* eventName = [arguments objectAtIndex:1];
Expand All @@ -232,7 +233,7 @@ - (void)endEvent:(NSArray*)arguments
else{
}


}

- (void)setLocation:(NSArray*)arguments
Expand All @@ -245,16 +246,16 @@ - (void)setLocation:(NSArray*)arguments

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



}

- (void)enableCrashReporting:(NSArray*)arguments
{
config.features = @[CLYCrashReporting];



}

- (void)addCrashLog:(NSArray*)arguments
Expand All @@ -263,8 +264,8 @@ - (void)addCrashLog:(NSArray*)arguments
NSString* messagingMode = [arguments objectAtIndex:1];
int mode = [messagingMode intValue];
NSData *tokenByte = [token dataUsingEncoding:NSUTF8StringEncoding];


}

- (void)userData_setProperty:(NSArray*)arguments
Expand All @@ -275,8 +276,8 @@ - (void)userData_setProperty:(NSArray*)arguments
[Countly.user set:keyName value:keyValue];
[Countly.user save];



}

- (void)userData_increment:(NSArray*)arguments
Expand All @@ -286,8 +287,8 @@ - (void)userData_increment:(NSArray*)arguments
[Countly.user increment:keyName];
[Countly.user save];



}

- (void)userData_incrementBy:(NSArray*)arguments
Expand All @@ -299,8 +300,8 @@ - (void)userData_incrementBy:(NSArray*)arguments
[Countly.user incrementBy:keyName value:keyValueInteger];
[Countly.user save];



}

- (void)userData_multiply:(NSArray*)arguments
Expand All @@ -312,8 +313,8 @@ - (void)userData_multiply:(NSArray*)arguments
[Countly.user multiply:keyName value:keyValueInteger];
[Countly.user save];



}

- (void)userData_saveMax:(NSArray*)arguments
Expand All @@ -325,8 +326,8 @@ - (void)userData_saveMax:(NSArray*)arguments
[Countly.user max:keyName value:keyValueInteger];
[Countly.user save];



}

- (void)userData_saveMin:(NSArray*)arguments
Expand All @@ -338,8 +339,8 @@ - (void)userData_saveMin:(NSArray*)arguments
[Countly.user min:keyName value:keyValueInteger];
[Countly.user save];



}

- (void)userData_setOnce:(NSArray*)arguments
Expand All @@ -350,8 +351,8 @@ - (void)userData_setOnce:(NSArray*)arguments
[Countly.user setOnce:keyName value:keyValue];
[Countly.user save];



}

- (void)demo:(NSArray*)arguments
Expand All @@ -360,8 +361,8 @@ - (void)demo:(NSArray*)arguments
NSString* messagingMode = [arguments objectAtIndex:1];
int mode = [messagingMode intValue];
NSData *tokenByte = [token dataUsingEncoding:NSUTF8StringEncoding];


}

@end

0 comments on commit 57818b9

Please sign in to comment.