Skip to content

Commit

Permalink
Merge pull request #5840 from srahim/TIMOB-17195-33X
Browse files Browse the repository at this point in the history
[TIMOB-17195]Check if analysis enabled before trying to send FeatureEvent and NavEvent.
  • Loading branch information
pec1985 committed Jun 23, 2014
2 parents 7451582 + e6e73ce commit 8e882a5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion iphone/Classes/AnalyticsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import "AnalyticsModule.h"
#import "APSAnalytics/APSAnalytics.h"
#import "SBJSON.h"

extern BOOL const TI_APPLICATION_ANALYTICS;
@implementation AnalyticsModule

-(NSString*)apiName
Expand All @@ -23,6 +23,10 @@ -(NSString*)lastEvent

-(void)navEvent:(id)args
{
if (TI_APPLICATION_ANALYTICS == NO) {
DebugLog(@"[ERROR] Analytics service is not enabled in your app. Please set analytics to true in the tiapp.xml. ");
return;
}
if ([args count] < 2)
{
[self throwException:@"invalid number of arguments, expected at least 2" subreason:nil location:CODELOCATION];
Expand All @@ -38,6 +42,10 @@ -(void)navEvent:(id)args

-(void)featureEvent:(id)args
{
if (TI_APPLICATION_ANALYTICS == NO) {
DebugLog(@"[ERROR] Analytics service is not enabled in your app. Please set analytics to true in the tiapp.xml.");
return;
}
if ([args count] < 1)
{
[self throwException:@"invalid number of arguments, expected at least 1" subreason:nil location:CODELOCATION];
Expand Down

0 comments on commit 8e882a5

Please sign in to comment.