Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-17195]Check if analysis enabled before trying to send FeatureEvent and NavEvent. #5840

Merged
merged 1 commit into from
Jun 23, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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