-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from adjust/api_upgrade
API upgrade
- Loading branch information
Showing
33 changed files
with
1,380 additions
and
637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,52 @@ | ||
// | ||
// Adjust2dx.mm | ||
// AdjustDemo | ||
// ADJAdjust2dx.mm | ||
// AdjustSDK | ||
// | ||
// Created by Uglješa Erceg on 17/06/15. | ||
// | ||
// | ||
|
||
#include "Adjust2dx.h" | ||
#include "ADJAdjust2dx.h" | ||
#include <Adjust/Adjust.h> | ||
|
||
const std::string ADJEnvironmentSandbox2dx = std::string([ADJEnvironmentSandbox UTF8String]); | ||
const std::string ADJEnvironmentProduction2dx = std::string([ADJEnvironmentProduction UTF8String]); | ||
|
||
void Adjust2dx::appDidLaunch(ADJConfig2dx adjustConfig) { | ||
[((ADJConfig *)adjustConfig.getConfig()) setSdkPrefix:@"cocos2d-x4.0.1"]; | ||
void ADJAdjust2dx::appDidLaunch(ADJConfig2dx adjustConfig) { | ||
[Adjust appDidLaunch:(ADJConfig *)adjustConfig.getConfig()]; | ||
} | ||
|
||
void Adjust2dx::trackEvent(ADJEvent2dx adjustEvent) { | ||
void ADJAdjust2dx::trackEvent(ADJEvent2dx adjustEvent) { | ||
[Adjust trackEvent:(ADJEvent *)adjustEvent.getEvent()]; | ||
} | ||
|
||
void Adjust2dx::trackSubsessionStart() { | ||
void ADJAdjust2dx::trackSubsessionStart() { | ||
[Adjust trackSubsessionStart]; | ||
} | ||
|
||
void Adjust2dx::trackSubsessionEnd() { | ||
void ADJAdjust2dx::trackSubsessionEnd() { | ||
[Adjust trackSubsessionEnd]; | ||
} | ||
|
||
void Adjust2dx::setEnabled(bool isEnabled) { | ||
void ADJAdjust2dx::setEnabled(bool isEnabled) { | ||
[Adjust setEnabled:isEnabled]; | ||
} | ||
|
||
void Adjust2dx::appWillOpenUrl(std::string url) { | ||
NSURL *pUrl = [NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]]; | ||
void ADJAdjust2dx::appWillOpenUrl(void* url) { | ||
NSURL *pUrl = (NSURL *)url; | ||
[Adjust appWillOpenUrl:pUrl]; | ||
} | ||
|
||
void Adjust2dx::setDeviceToken(std::string deviceToken) { | ||
void ADJAdjust2dx::setDeviceToken(std::string deviceToken) { | ||
NSData *pDeviceToken = [[NSString stringWithUTF8String:deviceToken.c_str()] | ||
dataUsingEncoding:NSUTF8StringEncoding]; | ||
[Adjust setDeviceToken:pDeviceToken]; | ||
} | ||
|
||
bool Adjust2dx::isEnabled() { | ||
void ADJAdjust2dx::setOfflineMode(bool isOffline) { | ||
[Adjust setOfflineMode:isOffline]; | ||
} | ||
|
||
bool ADJAdjust2dx::isEnabled() { | ||
return [Adjust isEnabled]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// ADJConfig2dx.h | ||
// AdjustSDK | ||
// | ||
// Created by Uglješa Erceg on 17/06/15. | ||
// | ||
// | ||
|
||
#ifndef _ADJUST_ADJUSTCONFIG2DX_H_ | ||
#define _ADJUST_ADJUSTCONFIG2DX_H_ | ||
|
||
#include <iostream> | ||
#include "AdjustAttribution2dx.h" | ||
|
||
enum ADJLogLevel2dx { | ||
ADJLogLevel2dxVerbose = 1, | ||
ADJLogLevel2dxDebug = 2, | ||
ADJLogLevel2dxInfo = 3, | ||
ADJLogLevel2dxWarn = 4, | ||
ADJLogLevel2dxError = 5, | ||
ADJLogLevel2dxAssert = 6 }; | ||
|
||
class ADJConfig2dx { | ||
private: | ||
void* config; | ||
void (*callback)(AdjustAttribution2dx attribution); | ||
void initConfig(std::string appToken, std::string environment, std::string sdkPrefix); | ||
|
||
public: | ||
ADJConfig2dx() {} | ||
ADJConfig2dx(std::string appToken, std::string environment, std::string sdkPrefix) { | ||
initConfig(appToken, environment, sdkPrefix); | ||
} | ||
|
||
void setLogLevel(ADJLogLevel2dx logLevel); | ||
void setDefaultTracker(std::string defaultTracker); | ||
void setEventBufferingEnabled(bool isEnabled); | ||
void setMacMd5TrackingEnabled(bool isEnabled); | ||
|
||
void setAttributionCallback(void (*callbackMethod)(AdjustAttribution2dx attribution)); | ||
|
||
void* getConfig(); | ||
}; | ||
|
||
#endif /* _ADJUST_ADJUSTCONFIG2DX_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// ADJEvent2dx.mm | ||
// AdjustDemo | ||
// AdjustSDK | ||
// | ||
// Created by Uglješa Erceg on 17/06/15. | ||
// | ||
|
Oops, something went wrong.