Skip to content

Commit 79c13a1

Browse files
committed
Merge pull request #39 from adjust/js_cordova
Cordova
2 parents 56f96d3 + 027ec9c commit 79c13a1

File tree

6 files changed

+50
-8
lines changed

6 files changed

+50
-8
lines changed

Adjust.xcodeproj/project.pbxproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
96E5E39718BBB48A008E7B30 /* AIResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E37C18BBB48A008E7B30 /* AIResponseData.m */; };
2929
96E5E39818BBB48A008E7B30 /* AITimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E37E18BBB48A008E7B30 /* AITimer.m */; };
3030
96E5E39918BBB48A008E7B30 /* AIUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E38018BBB48A008E7B30 /* AIUtil.m */; };
31-
96E5E3AE18BBB49E008E7B30 /* AdjustTests-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 96E5E39C18BBB49E008E7B30 /* AdjustTests-Info.plist */; };
3231
96E5E3AF18BBB49E008E7B30 /* AIActivityHandlerMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E39E18BBB49E008E7B30 /* AIActivityHandlerMock.m */; };
3332
96E5E3B018BBB49E008E7B30 /* AIActivityHandlerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E39F18BBB49E008E7B30 /* AIActivityHandlerTests.m */; };
3433
96E5E3B118BBB49E008E7B30 /* AILoggerMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E5E3A118BBB49E008E7B30 /* AILoggerMock.m */; };
@@ -294,7 +293,7 @@
294293
9679920518BBAE2800394606 /* Project object */ = {
295294
isa = PBXProject;
296295
attributes = {
297-
LastUpgradeCheck = 0500;
296+
LastUpgradeCheck = 0510;
298297
ORGANIZATIONNAME = adjust;
299298
};
300299
buildConfigurationList = 9679920818BBAE2800394606 /* Build configuration list for PBXProject "Adjust" */;
@@ -320,7 +319,6 @@
320319
isa = PBXResourcesBuildPhase;
321320
buildActionMask = 2147483647;
322321
files = (
323-
96E5E3AE18BBB49E008E7B30 /* AdjustTests-Info.plist in Resources */,
324322
96E5E3B718BBB49E008E7B30 /* InfoPlist.strings in Resources */,
325323
);
326324
runOnlyForDeploymentPostprocessing = 0;
@@ -396,7 +394,6 @@
396394
isa = XCBuildConfiguration;
397395
buildSettings = {
398396
ALWAYS_SEARCH_USER_PATHS = NO;
399-
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
400397
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
401398
CLANG_CXX_LIBRARY = "libc++";
402399
CLANG_ENABLE_MODULES = YES;
@@ -434,7 +431,6 @@
434431
isa = XCBuildConfiguration;
435432
buildSettings = {
436433
ALWAYS_SEARCH_USER_PATHS = NO;
437-
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
438434
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
439435
CLANG_CXX_LIBRARY = "libc++";
440436
CLANG_ENABLE_MODULES = YES;
@@ -497,7 +493,6 @@
497493
9679923418BBAE2800394606 /* Debug */ = {
498494
isa = XCBuildConfiguration;
499495
buildSettings = {
500-
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
501496
FRAMEWORK_SEARCH_PATHS = (
502497
"$(SDKROOT)/Developer/Library/Frameworks",
503498
"$(inherited)",
@@ -518,7 +513,6 @@
518513
9679923518BBAE2800394606 /* Release */ = {
519514
isa = XCBuildConfiguration;
520515
buildSettings = {
521-
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
522516
FRAMEWORK_SEARCH_PATHS = (
523517
"$(SDKROOT)/Developer/Library/Frameworks",
524518
"$(inherited)",

Adjust/AIActivityHandler.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
static const uint64_t kTimerInterval = 60 * NSEC_PER_SEC; // 1 minute
2525
static const uint64_t kTimerLeeway = 1 * NSEC_PER_SEC; // 1 second
26-
static const double kSubsessionInterval = 1; // 1 second
2726

2827

2928
#pragma mark -

Adjust/AIResponseData.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@
4949
// (session, event, revenue), see above
5050
- (NSString *)activityKindString;
5151

52+
// returns a NSDictonary representation
53+
- (NSDictionary *)dictionary;
54+
55+
5256
#pragma mark internals
57+
5358
+ (AIResponseData *)dataWithJsonString:(NSString *)string;
5459
+ (AIResponseData *)dataWithError:(NSString *)error;
5560

Adjust/AIResponseData.m

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,26 @@ - (NSString *)description {
6262
self.trackerName.aiQuote];
6363
}
6464

65+
- (NSDictionary *)dictionary {
66+
NSMutableDictionary * responseDataDic = [NSMutableDictionary dictionaryWithDictionary:@{
67+
@"activityKind" : self.activityKindString,
68+
@"success" : (self.success ? @"true" : @"false"),
69+
@"willRetry" : (self.willRetry ? @"true" : @"false"),
70+
}];
71+
72+
if (self.error != nil) {
73+
[responseDataDic setObject:self.error forKey:@"error"];
74+
}
75+
76+
if (self.trackerToken != nil) {
77+
[responseDataDic setObject:self.trackerToken forKey:@"trackerToken"];
78+
}
79+
80+
if (self.trackerName != nil) {
81+
[responseDataDic setObject:self.trackerName forKey:@"trackerName"];
82+
}
83+
84+
return responseDataDic;
85+
}
86+
6587
@end

Adjust/Adjust.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ static NSString * const AIEnvironmentProduction = @"production";
138138
// Special method used by SDK wrappers such as Adobe Air SDK.
139139
+ (void)setSdkPrefix:(NSString *)sdkPrefix __attribute__((deprecated));
140140

141+
/**
142+
* Tell adjust that the application resumed.
143+
*
144+
* Only necessary if the native notifications can't be used
145+
*/
146+
+ (void)trackSubsessionStart;
147+
148+
/**
149+
* Tell adjust that the application paused.
150+
*
151+
* Only necessary if the native notifications can't be used
152+
*/
153+
+ (void)trackSubsessionEnd;
154+
141155
@end
142156

143157

Adjust/Adjust.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,12 @@ + (void)setMacMd5TrackingEnabled:(BOOL)enabled {
116116
[AIAdjustFactory.logger info:@"Tracking of macMd5 is %@", enabled ? @"enabled" : @"disabled"];
117117
}
118118

119+
+ (void)trackSubsessionStart {
120+
[activityHandler trackSubsessionStart];
121+
}
122+
123+
+ (void)trackSubsessionEnd {
124+
[activityHandler trackSubsessionEnd];
125+
}
126+
119127
@end

0 commit comments

Comments
 (0)