Skip to content

Commit 74fa343

Browse files
committed
Add trackEvent method and update SDKs
1 parent 84ce1d3 commit 74fa343

File tree

7 files changed

+21
-3
lines changed

7 files changed

+21
-3
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ repositories {
3232
dependencies {
3333
compile 'com.facebook.react:react-native:+'
3434
compile 'com.google.android.gms:play-services-gcm:12.0.1'
35-
compile 'com.pushbots:pushbots-lib:3.1.3-r@aar'
35+
compile 'com.pushbots:pushbots-lib:3.1.4-r@aar'
3636
}

android/src/main/java/com/reactlibrary/RNPushbotsModule.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public void removeTag(String value){
4848
}
4949
}
5050

51+
@ReactMethod
52+
public void trackEvent(String event_key){
53+
if(value != null && !value.isEmpty()){
54+
Pushbots.sharedInstance().trackEvent(event_key);
55+
}
56+
}
57+
5158
@ReactMethod
5259
public void debug(Boolean value){
5360
if(value == null){

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ export default class Pushbots {
5454
RNPushbotsModule.setTag(tag)
5555
}
5656

57+
static trackEvent(event_key){
58+
RNPushbotsModule.trackEvent(event_key)
59+
}
60+
5761
static removeTag(tag){
5862
RNPushbotsModule.removeTag(tag)
5963
}

ios/Pushbots.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/*!
1313
@class
14-
PushBots SDK v2.1.1
14+
PushBots SDK v2.1.2
1515
@abstract
1616
The primary interface for integrating PushBots with your app.
1717
@@ -269,6 +269,9 @@ This method will toggle debug mode on the device, visit sandbox section in dashb
269269
+ (void) trackPushNotificationOpenedWithPayload:(NSDictionary *) payload;
270270
+ (void) trackPushNotificationOpenedWithPoll:(NSDictionary *) payload andAnswerId:(NSString *)ansewerID sync:(BOOL) sync;
271271

272+
+(void) trackEvent:(NSString *)event;
273+
+(void) trackEvent:(NSString *)event withValue:(NSString *)value;
274+
272275
#pragma clang diagnostic push
273276
#pragma clang diagnostic ignored "-Wunguarded-availability"
274277
#ifdef IOS10PLUS

ios/RCTPushbots.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ - (id) initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOp
6969
{
7070
[Pushbots untag:@[tag]];
7171
}
72+
RCT_EXPORT_METHOD(trackEvent:(NSString *)event_key)
73+
{
74+
[Pushbots trackEvent:event_key];
75+
}
7276
RCT_EXPORT_METHOD(setBadge:(int )count)
7377
{
7478
[Pushbots setBadge:count];

ios/libPushbots.a

26.9 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pushbots-react-native",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "PushBots React Native plugin",
55
"main": "index",
66
"scripts": {

0 commit comments

Comments
 (0)