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

Commit 57818b9

Browse files
basic communication working
1 parent 5f00db0 commit 57818b9

File tree

1 file changed

+51
-50
lines changed

1 file changed

+51
-50
lines changed

ios/CountlyReactNative.m

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414

1515
@implementation CountlyReactNative
1616

17-
RCT_EXPORT_MODULE();
17+
RCT_EXPORT_MODULE();
1818

1919

20-
- (void)echo:(NSArray*)arguments
20+
RCT_EXPORT_METHOD(echo:(NSArray*)arguments)
2121
{
22+
RCTLogInfo(@"Nicolson look here this is called");
2223
}
2324

2425
- (void)init:(NSArray*)arguments
@@ -47,7 +48,7 @@ - (void)event:(NSArray*)arguments
4748
NSString* countString = [arguments objectAtIndex:2];
4849
int countInt = [countString intValue];
4950
[[Countly sharedInstance] recordEvent:eventName count:countInt];
50-
51+
5152
}
5253
else if ([eventType isEqual: @"eventWithSum"]){
5354
NSString* eventName = [arguments objectAtIndex:1];
@@ -86,24 +87,24 @@ - (void)event:(NSArray*)arguments
8687
} else {
8788
}
8889

89-
90+
9091
}
9192
- (void)recordView:(NSArray*)arguments
9293
{
93-
94+
9495
NSString* recordView = [arguments objectAtIndex:0];
9596
[Countly.sharedInstance reportView:recordView];
96-
97+
9798
}
9899
- (void)setloggingenabled:(NSArray*)arguments
99100
{
100-
101-
101+
102+
102103
}
103104

104105
- (void)setuserdata:(NSArray*)arguments
105106
{
106-
107+
107108
NSString* name = [arguments objectAtIndex:0];
108109
NSString* username = [arguments objectAtIndex:1];
109110
NSString* email = [arguments objectAtIndex:2];
@@ -136,7 +137,7 @@ - (void)setuserdata:(NSArray*)arguments
136137
// kCLYUserUsername: username,
137138
// kCLYUserPicture: picture
138139
// }];
139-
140+
140141
}
141142

142143

@@ -149,69 +150,69 @@ - (void)onregistrationid:(NSArray*)arguments
149150
if(mode == 1){
150151
// [[CountlyConnectionQueue sharedInstance] setStartedWithTest:YES];
151152
}
152-
// CountlyPushNotifications.sharedInstance.token = token;
153-
// [CountlyPushNotifications.sharedInstance sendToken];
153+
// CountlyPushNotifications.sharedInstance.token = token;
154+
// [CountlyPushNotifications.sharedInstance sendToken];
154155
// [Countly.sharedInstance didRegisterForRemoteNotificationsWithDeviceToken:tokenByte];
155156

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

158-
159-
159+
160+
160161
}
161162

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

166-
167-
167+
168+
168169
}
169170

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

174-
175-
175+
176+
176177
}
177178

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

183-
184-
184+
185+
185186
}
186187

187188
- (void)setHttpPostForced:(NSArray*)arguments
188189
{
189-
190-
190+
191+
191192
}
192193

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

198-
199-
199+
200+
200201
}
201202

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

207-
208-
208+
209+
209210
}
210211

211212
- (void)endEvent:(NSArray*)arguments
212213
{
213214
NSString* eventType = [arguments objectAtIndex:0];
214-
215+
215216

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

235-
236+
236237
}
237238

238239
- (void)setLocation:(NSArray*)arguments
@@ -245,16 +246,16 @@ - (void)setLocation:(NSArray*)arguments
245246

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

248-
249-
249+
250+
250251
}
251252

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

256-
257-
257+
258+
258259
}
259260

260261
- (void)addCrashLog:(NSArray*)arguments
@@ -263,8 +264,8 @@ - (void)addCrashLog:(NSArray*)arguments
263264
NSString* messagingMode = [arguments objectAtIndex:1];
264265
int mode = [messagingMode intValue];
265266
NSData *tokenByte = [token dataUsingEncoding:NSUTF8StringEncoding];
266-
267-
267+
268+
268269
}
269270

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

278-
279-
279+
280+
280281
}
281282

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

289-
290-
290+
291+
291292
}
292293

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

302-
303-
303+
304+
304305
}
305306

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

315-
316-
316+
317+
317318
}
318319

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

328-
329-
329+
330+
330331
}
331332

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

341-
342-
342+
343+
343344
}
344345

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

353-
354-
354+
355+
355356
}
356357

357358
- (void)demo:(NSArray*)arguments
@@ -360,8 +361,8 @@ - (void)demo:(NSArray*)arguments
360361
NSString* messagingMode = [arguments objectAtIndex:1];
361362
int mode = [messagingMode intValue];
362363
NSData *tokenByte = [token dataUsingEncoding:NSUTF8StringEncoding];
363-
364-
364+
365+
365366
}
366367

367368
@end

0 commit comments

Comments
 (0)