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

Response delegate #150

Merged
merged 33 commits into from
Mar 15, 2016
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bfd7ed9
Rename responseData
nonelse Dec 7, 2015
72195ab
Add response data files
nonelse Dec 9, 2015
37f1d10
Rename delegate to attributionChanged
nonelse Dec 9, 2015
fc29006
Response delegate
nonelse Dec 9, 2015
4eb6bf8
README push token
nonelse Dec 15, 2015
3a53340
Delegate for all event/sessions
nonelse Jan 6, 2016
66a00d0
Update example app
nonelse Jan 6, 2016
b33b837
Save non-copied delegates
nonelse Jan 6, 2016
e666217
Update README.md
nonelse Jan 6, 2016
e727bba
Refactor json parsing
nonelse Jan 7, 2016
514b786
Refactor conditionals
nonelse Jan 20, 2016
026c654
Move response delegate to protocol
nonelse Jan 20, 2016
4718248
Split response and attribution tasks
nonelse Jan 20, 2016
d4d21f0
Update README.md
nonelse Jan 21, 2016
d9c6466
Split launch session/attribution
nonelse Feb 1, 2016
8bc9b84
Change iad 3 logs
nonelse Feb 1, 2016
e727f79
Dealloc semaphore
nonelse Feb 1, 2016
cef6fe1
Add response data log
nonelse Feb 1, 2016
e109680
Add tests
nonelse Feb 1, 2016
0fb328b
Send click package
nonelse Feb 16, 2016
5c4e91a
Remove unused function
nonelse Feb 16, 2016
4941df6
Add Session delegate
nonelse Feb 17, 2016
d709b0a
Update tests for session delegate
nonelse Feb 19, 2016
c8e11f6
Update README.md
nonelse Feb 29, 2016
919abfd
Remove activity kind string
nonelse Feb 29, 2016
276a751
Launch deeplink from main thread
nonelse Mar 11, 2016
4d4b0f0
Change log levels
nonelse Mar 11, 2016
89dd4d2
Test send click
nonelse Mar 11, 2016
3cc546c
Removing unused imports
Mar 14, 2016
aaaf408
Oranizing imports for dynamic framework
Mar 14, 2016
5e7b07e
Build script improvements
Mar 14, 2016
4d5ccf9
Changing version number to 4.6.0
Mar 14, 2016
8ed5980
edits README
esamcgv Mar 15, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor conditionals
nonelse committed Mar 11, 2016
commit 514b7863a081d84a5159f61bffb3c60778a1eac3
34 changes: 16 additions & 18 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
@@ -114,13 +114,13 @@ - (void)trackEvent:(ADJEvent *)event
}

- (void)finishedTracking:(ADJResponseData *)responseData {
// no response json to check for attributes and no callback for failed package
if ([ADJUtil isNull:responseData.jsonResponse] && [ADJUtil isNull:self.failureDelegate]) {
return;
}
// callback for failed package is present
// no response json to check for attributes
if ([ADJUtil isNull:responseData.jsonResponse]) {
[self launchResponseTasks:responseData];
// callback for failed package is present
if (![ADJUtil isNull:self.failureDelegate]) {
[self.logger debug:@"No json with failure delegate"];
[self launchResponseTasks:responseData];
}
return;
}
// attribute might be present
@@ -521,26 +521,24 @@ - (void) launchResponseTasksInternal:(ADJResponseData *)responseData {
}

- (void) launchFinishedDelegate:(ADJResponseData *)responseData {
// no event or session package
if (responseData.activityKind != ADJActivityKindEvent && responseData.activityKind != ADJActivityKindSession) {
// no event package
if (responseData.activityKind != ADJActivityKindEvent) {
return;
}
// no success callback
// success callback
if (responseData.success && [ADJUtil isNull:self.successDelegate]) {
dispatch_sync(dispatch_get_main_queue(), ^{
self.successDelegate([responseData successResponseData]);
});
return;
}
// no failure callback
// failure callback
if (!responseData.success && [ADJUtil isNull:self.failureDelegate]) {
dispatch_sync(dispatch_get_main_queue(), ^{
self.failureDelegate([responseData failureResponseData]);
});
return;
}
// add it to the handler queue
dispatch_sync(dispatch_get_main_queue(), ^{
if (responseData.success) {
self.successDelegate([responseData successResponseData]);
} else {
self.failureDelegate([responseData failureResponseData]);
}
});
}

- (void) appWillOpenUrlInternal:(NSURL *)url {