diff --git a/Adjust.podspec b/Adjust.podspec index 30e08e702..45ebc5615 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = "Adjust" - s.version = "4.4.5" + s.version = "4.5.0" s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com." s.homepage = "http://adjust.com" s.license = { :type => 'MIT', :file => 'MIT-LICENSE' } s.author = { "Christian Wellenbrock" => "welle@adjust.com" } - s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.4.5" } - s.ios.deployment_target = '5.0' + s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.5.0" } + s.ios.deployment_target = '6.0' s.tvos.deployment_target = '9.0' s.framework = 'SystemConfiguration' s.ios.weak_framework = 'AdSupport', 'iAd' diff --git a/Adjust.xcodeproj/project.pbxproj b/Adjust.xcodeproj/project.pbxproj index 0f63f8980..a6e435eab 100644 --- a/Adjust.xcodeproj/project.pbxproj +++ b/Adjust.xcodeproj/project.pbxproj @@ -7,16 +7,16 @@ objects = { /* Begin PBXAggregateTarget section */ - 96BCFBE71AC99FBD005A65C5 /* framework */ = { + 96BCFBE71AC99FBD005A65C5 /* AdjustStatic */ = { isa = PBXAggregateTarget; - buildConfigurationList = 96BCFBE81AC99FBD005A65C5 /* Build configuration list for PBXAggregateTarget "framework" */; + buildConfigurationList = 96BCFBE81AC99FBD005A65C5 /* Build configuration list for PBXAggregateTarget "AdjustStatic" */; buildPhases = ( 9DE7C9021AE68FA5001556E5 /* MultiPlatform Build */, ); dependencies = ( 9DE7C9001AE68EF1001556E5 /* PBXTargetDependency */, ); - name = framework; + name = AdjustStatic; productName = framework; }; /* End PBXAggregateTarget section */ @@ -93,6 +93,49 @@ 96ED003E1A38A98C00209110 /* ADJDelegateTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 96ED003D1A38A98C00209110 /* ADJDelegateTest.m */; }; 9D363AC31BDA50FA00B47FE9 /* ADJLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 96E5E37318BBB48A008E7B30 /* ADJLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9DE7C8FD1AE688DA001556E5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DE7C8FC1AE688DA001556E5 /* UIKit.framework */; }; + 9DFA37B71C0F21D600782607 /* AdjustSdk.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37B51C0F21D600782607 /* AdjustSdk.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFA37DF1C0F220200782607 /* ADJActivityHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37BA1C0F220200782607 /* ADJActivityHandler.h */; }; + 9DFA37E01C0F220200782607 /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37BB1C0F220200782607 /* ADJActivityHandler.m */; }; + 9DFA37E11C0F220200782607 /* ADJActivityKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37BC1C0F220200782607 /* ADJActivityKind.h */; }; + 9DFA37E21C0F220200782607 /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37BD1C0F220200782607 /* ADJActivityKind.m */; }; + 9DFA37E31C0F220200782607 /* ADJActivityPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37BE1C0F220200782607 /* ADJActivityPackage.h */; }; + 9DFA37E41C0F220200782607 /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37BF1C0F220200782607 /* ADJActivityPackage.m */; }; + 9DFA37E51C0F220200782607 /* ADJActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37C01C0F220200782607 /* ADJActivityState.h */; }; + 9DFA37E61C0F220200782607 /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37C11C0F220200782607 /* ADJActivityState.m */; }; + 9DFA37E71C0F220200782607 /* ADJAdjustFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37C21C0F220200782607 /* ADJAdjustFactory.h */; }; + 9DFA37E81C0F220200782607 /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37C31C0F220200782607 /* ADJAdjustFactory.m */; }; + 9DFA37E91C0F220200782607 /* ADJAttribution.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37C41C0F220200782607 /* ADJAttribution.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFA37EA1C0F220200782607 /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37C51C0F220200782607 /* ADJAttribution.m */; }; + 9DFA37EB1C0F220200782607 /* ADJAttributionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37C61C0F220200782607 /* ADJAttributionHandler.h */; }; + 9DFA37EC1C0F220200782607 /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37C71C0F220200782607 /* ADJAttributionHandler.m */; }; + 9DFA37ED1C0F220200782607 /* ADJConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37C81C0F220200782607 /* ADJConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFA37EE1C0F220200782607 /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37C91C0F220200782607 /* ADJConfig.m */; }; + 9DFA37EF1C0F220200782607 /* ADJDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37CA1C0F220200782607 /* ADJDeviceInfo.h */; }; + 9DFA37F01C0F220200782607 /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37CB1C0F220200782607 /* ADJDeviceInfo.m */; }; + 9DFA37F11C0F220200782607 /* ADJEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37CC1C0F220200782607 /* ADJEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFA37F21C0F220200782607 /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37CD1C0F220200782607 /* ADJEvent.m */; }; + 9DFA37F31C0F220200782607 /* ADJLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37CE1C0F220200782607 /* ADJLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFA37F41C0F220200782607 /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37CF1C0F220200782607 /* ADJLogger.m */; }; + 9DFA37F51C0F220200782607 /* ADJPackageBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37D01C0F220200782607 /* ADJPackageBuilder.h */; }; + 9DFA37F61C0F220200782607 /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37D11C0F220200782607 /* ADJPackageBuilder.m */; }; + 9DFA37F71C0F220200782607 /* ADJPackageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37D21C0F220200782607 /* ADJPackageHandler.h */; }; + 9DFA37F81C0F220200782607 /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37D31C0F220200782607 /* ADJPackageHandler.m */; }; + 9DFA37F91C0F220200782607 /* ADJRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37D41C0F220200782607 /* ADJRequestHandler.h */; }; + 9DFA37FA1C0F220200782607 /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37D51C0F220200782607 /* ADJRequestHandler.m */; }; + 9DFA37FB1C0F220200782607 /* ADJTimerCycle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37D61C0F220200782607 /* ADJTimerCycle.h */; }; + 9DFA37FC1C0F220200782607 /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37D71C0F220200782607 /* ADJTimerCycle.m */; }; + 9DFA37FD1C0F220200782607 /* ADJTimerOnce.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37D81C0F220200782607 /* ADJTimerOnce.h */; }; + 9DFA37FE1C0F220200782607 /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37D91C0F220200782607 /* ADJTimerOnce.m */; }; + 9DFA37FF1C0F220200782607 /* Adjust.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37DA1C0F220200782607 /* Adjust.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFA38001C0F220200782607 /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37DB1C0F220200782607 /* Adjust.m */; }; + 9DFA38011C0F220200782607 /* ADJUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37DC1C0F220200782607 /* ADJUtil.h */; }; + 9DFA38021C0F220200782607 /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA37DD1C0F220200782607 /* ADJUtil.m */; }; + 9DFA380A1C0F220D00782607 /* NSData+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA38041C0F220D00782607 /* NSData+ADJAdditions.h */; }; + 9DFA380B1C0F220D00782607 /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA38051C0F220D00782607 /* NSData+ADJAdditions.m */; }; + 9DFA380C1C0F220D00782607 /* NSString+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA38061C0F220D00782607 /* NSString+ADJAdditions.h */; }; + 9DFA380D1C0F220D00782607 /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA38071C0F220D00782607 /* NSString+ADJAdditions.m */; }; + 9DFA380E1C0F220D00782607 /* UIDevice+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA38081C0F220D00782607 /* UIDevice+ADJAdditions.h */; }; + 9DFA380F1C0F220D00782607 /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFA38091C0F220D00782607 /* UIDevice+ADJAdditions.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -221,6 +264,52 @@ 96ED003C1A38A98C00209110 /* ADJDelegateTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDelegateTest.h; sourceTree = ""; }; 96ED003D1A38A98C00209110 /* ADJDelegateTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDelegateTest.m; sourceTree = ""; }; 9DE7C8FC1AE688DA001556E5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 9DFA37AD1C0F219400782607 /* AdjustSdk.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AdjustSdk.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9DFA37B51C0F21D600782607 /* AdjustSdk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustSdk.h; sourceTree = ""; }; + 9DFA37B61C0F21D600782607 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9DFA37BA1C0F220200782607 /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJActivityHandler.h; path = Adjust/ADJActivityHandler.h; sourceTree = SOURCE_ROOT; }; + 9DFA37BB1C0F220200782607 /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJActivityHandler.m; path = Adjust/ADJActivityHandler.m; sourceTree = SOURCE_ROOT; }; + 9DFA37BC1C0F220200782607 /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJActivityKind.h; path = Adjust/ADJActivityKind.h; sourceTree = SOURCE_ROOT; }; + 9DFA37BD1C0F220200782607 /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJActivityKind.m; path = Adjust/ADJActivityKind.m; sourceTree = SOURCE_ROOT; }; + 9DFA37BE1C0F220200782607 /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJActivityPackage.h; path = Adjust/ADJActivityPackage.h; sourceTree = SOURCE_ROOT; }; + 9DFA37BF1C0F220200782607 /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJActivityPackage.m; path = Adjust/ADJActivityPackage.m; sourceTree = SOURCE_ROOT; }; + 9DFA37C01C0F220200782607 /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJActivityState.h; path = Adjust/ADJActivityState.h; sourceTree = SOURCE_ROOT; }; + 9DFA37C11C0F220200782607 /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJActivityState.m; path = Adjust/ADJActivityState.m; sourceTree = SOURCE_ROOT; }; + 9DFA37C21C0F220200782607 /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJAdjustFactory.h; path = Adjust/ADJAdjustFactory.h; sourceTree = SOURCE_ROOT; }; + 9DFA37C31C0F220200782607 /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJAdjustFactory.m; path = Adjust/ADJAdjustFactory.m; sourceTree = SOURCE_ROOT; }; + 9DFA37C41C0F220200782607 /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJAttribution.h; path = Adjust/ADJAttribution.h; sourceTree = SOURCE_ROOT; }; + 9DFA37C51C0F220200782607 /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJAttribution.m; path = Adjust/ADJAttribution.m; sourceTree = SOURCE_ROOT; }; + 9DFA37C61C0F220200782607 /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJAttributionHandler.h; path = Adjust/ADJAttributionHandler.h; sourceTree = SOURCE_ROOT; }; + 9DFA37C71C0F220200782607 /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJAttributionHandler.m; path = Adjust/ADJAttributionHandler.m; sourceTree = SOURCE_ROOT; }; + 9DFA37C81C0F220200782607 /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJConfig.h; path = Adjust/ADJConfig.h; sourceTree = SOURCE_ROOT; }; + 9DFA37C91C0F220200782607 /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJConfig.m; path = Adjust/ADJConfig.m; sourceTree = SOURCE_ROOT; }; + 9DFA37CA1C0F220200782607 /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJDeviceInfo.h; path = Adjust/ADJDeviceInfo.h; sourceTree = SOURCE_ROOT; }; + 9DFA37CB1C0F220200782607 /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJDeviceInfo.m; path = Adjust/ADJDeviceInfo.m; sourceTree = SOURCE_ROOT; }; + 9DFA37CC1C0F220200782607 /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJEvent.h; path = Adjust/ADJEvent.h; sourceTree = SOURCE_ROOT; }; + 9DFA37CD1C0F220200782607 /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJEvent.m; path = Adjust/ADJEvent.m; sourceTree = SOURCE_ROOT; }; + 9DFA37CE1C0F220200782607 /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJLogger.h; path = Adjust/ADJLogger.h; sourceTree = SOURCE_ROOT; }; + 9DFA37CF1C0F220200782607 /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJLogger.m; path = Adjust/ADJLogger.m; sourceTree = SOURCE_ROOT; }; + 9DFA37D01C0F220200782607 /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJPackageBuilder.h; path = Adjust/ADJPackageBuilder.h; sourceTree = SOURCE_ROOT; }; + 9DFA37D11C0F220200782607 /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJPackageBuilder.m; path = Adjust/ADJPackageBuilder.m; sourceTree = SOURCE_ROOT; }; + 9DFA37D21C0F220200782607 /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJPackageHandler.h; path = Adjust/ADJPackageHandler.h; sourceTree = SOURCE_ROOT; }; + 9DFA37D31C0F220200782607 /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJPackageHandler.m; path = Adjust/ADJPackageHandler.m; sourceTree = SOURCE_ROOT; }; + 9DFA37D41C0F220200782607 /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJRequestHandler.h; path = Adjust/ADJRequestHandler.h; sourceTree = SOURCE_ROOT; }; + 9DFA37D51C0F220200782607 /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJRequestHandler.m; path = Adjust/ADJRequestHandler.m; sourceTree = SOURCE_ROOT; }; + 9DFA37D61C0F220200782607 /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJTimerCycle.h; path = Adjust/ADJTimerCycle.h; sourceTree = SOURCE_ROOT; }; + 9DFA37D71C0F220200782607 /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJTimerCycle.m; path = Adjust/ADJTimerCycle.m; sourceTree = SOURCE_ROOT; }; + 9DFA37D81C0F220200782607 /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJTimerOnce.h; path = Adjust/ADJTimerOnce.h; sourceTree = SOURCE_ROOT; }; + 9DFA37D91C0F220200782607 /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJTimerOnce.m; path = Adjust/ADJTimerOnce.m; sourceTree = SOURCE_ROOT; }; + 9DFA37DA1C0F220200782607 /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Adjust.h; path = Adjust/Adjust.h; sourceTree = SOURCE_ROOT; }; + 9DFA37DB1C0F220200782607 /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Adjust.m; path = Adjust/Adjust.m; sourceTree = SOURCE_ROOT; }; + 9DFA37DC1C0F220200782607 /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ADJUtil.h; path = Adjust/ADJUtil.h; sourceTree = SOURCE_ROOT; }; + 9DFA37DD1C0F220200782607 /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ADJUtil.m; path = Adjust/ADJUtil.m; sourceTree = SOURCE_ROOT; }; + 9DFA37DE1C0F220200782607 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Adjust/Info.plist; sourceTree = SOURCE_ROOT; }; + 9DFA38041C0F220D00782607 /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+ADJAdditions.h"; path = "Adjust/ADJAdditions/NSData+ADJAdditions.h"; sourceTree = SOURCE_ROOT; }; + 9DFA38051C0F220D00782607 /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSData+ADJAdditions.m"; path = "Adjust/ADJAdditions/NSData+ADJAdditions.m"; sourceTree = SOURCE_ROOT; }; + 9DFA38061C0F220D00782607 /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+ADJAdditions.h"; path = "Adjust/ADJAdditions/NSString+ADJAdditions.h"; sourceTree = SOURCE_ROOT; }; + 9DFA38071C0F220D00782607 /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+ADJAdditions.m"; path = "Adjust/ADJAdditions/NSString+ADJAdditions.m"; sourceTree = SOURCE_ROOT; }; + 9DFA38081C0F220D00782607 /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIDevice+ADJAdditions.h"; path = "Adjust/ADJAdditions/UIDevice+ADJAdditions.h"; sourceTree = SOURCE_ROOT; }; + 9DFA38091C0F220D00782607 /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIDevice+ADJAdditions.m"; path = "Adjust/ADJAdditions/UIDevice+ADJAdditions.m"; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -248,6 +337,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9DFA37A91C0F219400782607 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -274,6 +370,7 @@ 963909621BCBFE5200A2E8A4 /* AdjustExample-iOS.xcodeproj */, 96E5E39A18BBB49E008E7B30 /* AdjustTests */, 96E5E34B18BBB48A008E7B30 /* Adjust */, + 9DFA37AE1C0F219400782607 /* AdjustSdk */, 9679920F18BBAE2800394606 /* Frameworks */, 9679920E18BBAE2800394606 /* Products */, ); @@ -284,6 +381,7 @@ children = ( 9679920D18BBAE2800394606 /* libAdjust.a */, 9679921D18BBAE2800394606 /* AdjustTests.xctest */, + 9DFA37AD1C0F219400782607 /* AdjustSdk.framework */, ); name = Products; sourceTree = ""; @@ -394,6 +492,66 @@ path = AdjustTests; sourceTree = ""; }; + 9DFA37AE1C0F219400782607 /* AdjustSdk */ = { + isa = PBXGroup; + children = ( + 9DFA37B51C0F21D600782607 /* AdjustSdk.h */, + 9DFA37B61C0F21D600782607 /* Info.plist */, + 9DFA37B91C0F21F000782607 /* Adjust */, + ); + path = AdjustSdk; + sourceTree = ""; + }; + 9DFA37B91C0F21F000782607 /* Adjust */ = { + isa = PBXGroup; + children = ( + 9DFA38041C0F220D00782607 /* NSData+ADJAdditions.h */, + 9DFA38051C0F220D00782607 /* NSData+ADJAdditions.m */, + 9DFA38061C0F220D00782607 /* NSString+ADJAdditions.h */, + 9DFA38071C0F220D00782607 /* NSString+ADJAdditions.m */, + 9DFA38081C0F220D00782607 /* UIDevice+ADJAdditions.h */, + 9DFA38091C0F220D00782607 /* UIDevice+ADJAdditions.m */, + 9DFA37BA1C0F220200782607 /* ADJActivityHandler.h */, + 9DFA37BB1C0F220200782607 /* ADJActivityHandler.m */, + 9DFA37BC1C0F220200782607 /* ADJActivityKind.h */, + 9DFA37BD1C0F220200782607 /* ADJActivityKind.m */, + 9DFA37BE1C0F220200782607 /* ADJActivityPackage.h */, + 9DFA37BF1C0F220200782607 /* ADJActivityPackage.m */, + 9DFA37C01C0F220200782607 /* ADJActivityState.h */, + 9DFA37C11C0F220200782607 /* ADJActivityState.m */, + 9DFA37C21C0F220200782607 /* ADJAdjustFactory.h */, + 9DFA37C31C0F220200782607 /* ADJAdjustFactory.m */, + 9DFA37C41C0F220200782607 /* ADJAttribution.h */, + 9DFA37C51C0F220200782607 /* ADJAttribution.m */, + 9DFA37C61C0F220200782607 /* ADJAttributionHandler.h */, + 9DFA37C71C0F220200782607 /* ADJAttributionHandler.m */, + 9DFA37C81C0F220200782607 /* ADJConfig.h */, + 9DFA37C91C0F220200782607 /* ADJConfig.m */, + 9DFA37CA1C0F220200782607 /* ADJDeviceInfo.h */, + 9DFA37CB1C0F220200782607 /* ADJDeviceInfo.m */, + 9DFA37CC1C0F220200782607 /* ADJEvent.h */, + 9DFA37CD1C0F220200782607 /* ADJEvent.m */, + 9DFA37CE1C0F220200782607 /* ADJLogger.h */, + 9DFA37CF1C0F220200782607 /* ADJLogger.m */, + 9DFA37D01C0F220200782607 /* ADJPackageBuilder.h */, + 9DFA37D11C0F220200782607 /* ADJPackageBuilder.m */, + 9DFA37D21C0F220200782607 /* ADJPackageHandler.h */, + 9DFA37D31C0F220200782607 /* ADJPackageHandler.m */, + 9DFA37D41C0F220200782607 /* ADJRequestHandler.h */, + 9DFA37D51C0F220200782607 /* ADJRequestHandler.m */, + 9DFA37D61C0F220200782607 /* ADJTimerCycle.h */, + 9DFA37D71C0F220200782607 /* ADJTimerCycle.m */, + 9DFA37D81C0F220200782607 /* ADJTimerOnce.h */, + 9DFA37D91C0F220200782607 /* ADJTimerOnce.m */, + 9DFA37DA1C0F220200782607 /* Adjust.h */, + 9DFA37DB1C0F220200782607 /* Adjust.m */, + 9DFA37DC1C0F220200782607 /* ADJUtil.h */, + 9DFA37DD1C0F220200782607 /* ADJUtil.m */, + 9DFA37DE1C0F220200782607 /* Info.plist */, + ); + name = Adjust; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -425,6 +583,35 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9DFA37AA1C0F219400782607 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 9DFA37B71C0F21D600782607 /* AdjustSdk.h in Headers */, + 9DFA37FF1C0F220200782607 /* Adjust.h in Headers */, + 9DFA37F11C0F220200782607 /* ADJEvent.h in Headers */, + 9DFA37ED1C0F220200782607 /* ADJConfig.h in Headers */, + 9DFA37F31C0F220200782607 /* ADJLogger.h in Headers */, + 9DFA37E91C0F220200782607 /* ADJAttribution.h in Headers */, + 9DFA38011C0F220200782607 /* ADJUtil.h in Headers */, + 9DFA37EF1C0F220200782607 /* ADJDeviceInfo.h in Headers */, + 9DFA380C1C0F220D00782607 /* NSString+ADJAdditions.h in Headers */, + 9DFA380A1C0F220D00782607 /* NSData+ADJAdditions.h in Headers */, + 9DFA37FD1C0F220200782607 /* ADJTimerOnce.h in Headers */, + 9DFA37FB1C0F220200782607 /* ADJTimerCycle.h in Headers */, + 9DFA37F51C0F220200782607 /* ADJPackageBuilder.h in Headers */, + 9DFA37E51C0F220200782607 /* ADJActivityState.h in Headers */, + 9DFA380E1C0F220D00782607 /* UIDevice+ADJAdditions.h in Headers */, + 9DFA37F91C0F220200782607 /* ADJRequestHandler.h in Headers */, + 9DFA37DF1C0F220200782607 /* ADJActivityHandler.h in Headers */, + 9DFA37F71C0F220200782607 /* ADJPackageHandler.h in Headers */, + 9DFA37E11C0F220200782607 /* ADJActivityKind.h in Headers */, + 9DFA37E31C0F220200782607 /* ADJActivityPackage.h in Headers */, + 9DFA37E71C0F220200782607 /* ADJAdjustFactory.h in Headers */, + 9DFA37EB1C0F220200782607 /* ADJAttributionHandler.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -465,6 +652,24 @@ productReference = 9679921D18BBAE2800394606 /* AdjustTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 9DFA37AC1C0F219400782607 /* AdjustSdk */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9DFA37B21C0F219400782607 /* Build configuration list for PBXNativeTarget "AdjustSdk" */; + buildPhases = ( + 9DFA37A81C0F219400782607 /* Sources */, + 9DFA37A91C0F219400782607 /* Frameworks */, + 9DFA37AA1C0F219400782607 /* Headers */, + 9DFA37AB1C0F219400782607 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AdjustSdk; + productName = AdjustSdk; + productReference = 9DFA37AD1C0F219400782607 /* AdjustSdk.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -477,9 +682,12 @@ 96BCFBE71AC99FBD005A65C5 = { CreatedOnToolsVersion = 6.2; }; + 9DFA37AC1C0F219400782607 = { + CreatedOnToolsVersion = 7.1.1; + }; }; }; - buildConfigurationList = 9679920818BBAE2800394606 /* Build configuration list for PBXProject "adjust" */; + buildConfigurationList = 9679920818BBAE2800394606 /* Build configuration list for PBXProject "Adjust" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -503,7 +711,8 @@ targets = ( 9679920C18BBAE2800394606 /* Adjust */, 9679921C18BBAE2800394606 /* AdjustTests */, - 96BCFBE71AC99FBD005A65C5 /* framework */, + 96BCFBE71AC99FBD005A65C5 /* AdjustStatic */, + 9DFA37AC1C0F219400782607 /* AdjustSdk */, ); }; /* End PBXProject section */ @@ -534,6 +743,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9DFA37AB1C0F219400782607 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -549,7 +765,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\nexport FRAMEWORK_LOCN=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework\"\n\n# Create the path to the real Headers die\nmkdir -p \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n\n# Create the required symlinks\n/bin/ln -sfh A \"${FRAMEWORK_LOCN}/Versions/Current\"\n/bin/ln -sfh Versions/Current/Headers \"${FRAMEWORK_LOCN}/Headers\"\n/bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}\" \\\n\"${FRAMEWORK_LOCN}/${PRODUCT_NAME}\"\n\n# Copy the public headers into the framework\n/bin/cp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \\\n\"${FRAMEWORK_LOCN}/Versions/A/Headers\""; + shellScript = "set -e\n\nexport FRAMEWORK_LOCN=\"${BUILT_PRODUCTS_DIR}/Static/${PRODUCT_NAME}Sdk.framework\"\n\n# Create the path to the real Headers die\nmkdir -p \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n\n# Create the required symlinks\n/bin/ln -sfh A \"${FRAMEWORK_LOCN}/Versions/Current\"\n/bin/ln -sfh Versions/Current/Headers \"${FRAMEWORK_LOCN}/Headers\"\n/bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}Sdk\" \\\n\"${FRAMEWORK_LOCN}/${PRODUCT_NAME}Sdk\"\n\n# Copy the public headers into the framework\n/bin/cp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \\\n\"${FRAMEWORK_LOCN}/Versions/A/Headers\""; }; 9DE7C9021AE68FA5001556E5 /* MultiPlatform Build */ = { isa = PBXShellScriptBuildPhase; @@ -563,7 +779,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\n# If we're already inside this script then die\nif [ -n \"$RW_MULTIPLATFORM_BUILD_IN_PROGRESS\" ]; then\nexit 0\nfi\nexport RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1\n\nRW_FRAMEWORK_NAME=${PROJECT_NAME}\nRW_INPUT_STATIC_LIB=\"lib${PROJECT_NAME}.a\"\nRW_FRAMEWORK_LOCATION=\"${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework\"\n\nfunction build_static_library {\n # Will rebuild the static library as specified\n # build_static_library sdk\n xcrun xcodebuild -project \"${PROJECT_FILE_PATH}\" \\\n -target \"${TARGET_NAME}\" \\\n -configuration \"${CONFIGURATION}\" \\\n -sdk \"${1}\" \\\n ONLY_ACTIVE_ARCH=NO \\\n BUILD_DIR=\"${BUILD_DIR}\" \\\n OBJROOT=\"${OBJROOT}\" \\\n BUILD_ROOT=\"${BUILD_ROOT}\" \\\n SYMROOT=\"${SYMROOT}\" $ACTION\n}\n\nfunction make_fat_library {\n # Will smash 2 static libs together\n # make_fat_library in1 in2 out\n xcrun lipo -create \"${1}\" \"${2}\" -output \"${3}\"\n}\n\n# 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK name\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]; then\nRW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\necho \"Could not find platform name from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\n# 2 - Extract the version from the SDK\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]; then\nRW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\necho \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\n# 3 - Determine the other platform\nif [ \"$RW_SDK_PLATFORM\" == \"iphoneos\" ]; then\nRW_OTHER_PLATFORM=iphonesimulator\nelse\nRW_OTHER_PLATFORM=iphoneos\nfi\n\n# 4 - Find the build directory\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$RW_SDK_PLATFORM$ ]]; then\nRW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${RW_OTHER_PLATFORM}\"\nelse\necho \"Could not find other platform build directory.\"\nexit 1\nfi\n\n# Build the other platform.\nbuild_static_library \"${RW_OTHER_PLATFORM}${RW_SDK_VERSION}\"\n\n# If we're currently building for iphonesimulator, then need to rebuild\n# to ensure that we get both i386 and x86_64\nif [ \"$RW_SDK_PLATFORM\" == \"iphonesimulator\" ]; then\nbuild_static_library \"${SDK_NAME}\"\nfi\n\n# Join the 2 static libs into 1 and push into the .framework\nmake_fat_library \"${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}\" \\\n\"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}\"\n\n# Ensure that the framework is present in both platform's build directories\ncp -a \"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework/Versions/A/${RW_FRAMEWORK_NAME}\""; + shellScript = "set -e\n\n# If we're already inside this script then die\nif [ -n \"$RW_MULTIPLATFORM_BUILD_IN_PROGRESS\" ]; then\nexit 0\nfi\nexport RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1\n\nRW_FRAMEWORK_NAME=${PROJECT_NAME}\nRW_INPUT_STATIC_LIB=\"lib${PROJECT_NAME}.a\"\nRW_FRAMEWORK_LOCATION=\"${BUILT_PRODUCTS_DIR}/Static/${RW_FRAMEWORK_NAME}Sdk.framework\"\n\nfunction build_static_library {\n echo \"1\"\n echo \"${BUILD_DIR}\"\n # Will rebuild the static library as specified\n # build_static_library sdk\n xcrun xcodebuild -project \"${PROJECT_FILE_PATH}\" \\\n -target \"${TARGET_NAME}\" \\\n -configuration \"${CONFIGURATION}\" \\\n -sdk \"${1}\" \\\n ONLY_ACTIVE_ARCH=NO \\\n BUILD_DIR=\"${BUILD_DIR}\" \\\n OBJROOT=\"${OBJROOT}\" \\\n BUILD_ROOT=\"${BUILD_ROOT}\" \\\n SYMROOT=\"${SYMROOT}\" $ACTION\n}\n\nfunction make_fat_library {\n # Will smash 2 static libs together\n # make_fat_library in1 in2 out\n xcrun lipo -create \"${1}\" \"${2}\" -output \"${3}\"\n}\n\n# 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK name\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]; then\nRW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\necho \"Could not find platform name from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\n# 2 - Extract the version from the SDK\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]; then\nRW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\necho \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\n# 3 - Determine the other platform\nif [ \"$RW_SDK_PLATFORM\" == \"iphoneos\" ]; then\nRW_OTHER_PLATFORM=iphonesimulator\nelse\nRW_OTHER_PLATFORM=iphoneos\nfi\n\n# 4 - Find the build directory\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$RW_SDK_PLATFORM$ ]]; then\nRW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${RW_OTHER_PLATFORM}\"\nelse\necho \"Could not find other platform build directory.\"\nexit 1\nfi\n\n# Build the other platform.\nbuild_static_library \"${RW_OTHER_PLATFORM}${RW_SDK_VERSION}\"\n\n# If we're currently building for iphonesimulator, then need to rebuild\n# to ensure that we get both i386 and x86_64\nif [ \"$RW_SDK_PLATFORM\" == \"iphonesimulator\" ]; then\nbuild_static_library \"${SDK_NAME}\"\nfi\n\n# Join the 2 static libs into 1 and push into the .framework\nmake_fat_library \"${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}\" \\\n\"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}Sdk\"\n\n# Ensure that the framework is present in both platform's build directories\ncp -a \"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}Sdk\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/Static/${RW_FRAMEWORK_NAME}Sdk.framework/Versions/A/${RW_FRAMEWORK_NAME}Sdk\""; }; /* End PBXShellScriptBuildPhase section */ @@ -621,6 +837,34 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9DFA37A81C0F219400782607 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9DFA37E81C0F220200782607 /* ADJAdjustFactory.m in Sources */, + 9DFA37E21C0F220200782607 /* ADJActivityKind.m in Sources */, + 9DFA37FA1C0F220200782607 /* ADJRequestHandler.m in Sources */, + 9DFA380F1C0F220D00782607 /* UIDevice+ADJAdditions.m in Sources */, + 9DFA37E41C0F220200782607 /* ADJActivityPackage.m in Sources */, + 9DFA37EE1C0F220200782607 /* ADJConfig.m in Sources */, + 9DFA38001C0F220200782607 /* Adjust.m in Sources */, + 9DFA37F21C0F220200782607 /* ADJEvent.m in Sources */, + 9DFA38021C0F220200782607 /* ADJUtil.m in Sources */, + 9DFA37EC1C0F220200782607 /* ADJAttributionHandler.m in Sources */, + 9DFA37F41C0F220200782607 /* ADJLogger.m in Sources */, + 9DFA37E61C0F220200782607 /* ADJActivityState.m in Sources */, + 9DFA380B1C0F220D00782607 /* NSData+ADJAdditions.m in Sources */, + 9DFA37FC1C0F220200782607 /* ADJTimerCycle.m in Sources */, + 9DFA37F61C0F220200782607 /* ADJPackageBuilder.m in Sources */, + 9DFA37F01C0F220200782607 /* ADJDeviceInfo.m in Sources */, + 9DFA380D1C0F220D00782607 /* NSString+ADJAdditions.m in Sources */, + 9DFA37F81C0F220200782607 /* ADJPackageHandler.m in Sources */, + 9DFA37E01C0F220200782607 /* ADJActivityHandler.m in Sources */, + 9DFA37FE1C0F220200782607 /* ADJTimerOnce.m in Sources */, + 9DFA37EA1C0F220200782607 /* ADJAttribution.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -722,6 +966,10 @@ 9679923118BBAE2800394606 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); CODE_SIGN_IDENTITY = "iPhone Developer"; DEAD_CODE_STRIPPING = NO; DSTROOT = /tmp/Adjust.dst; @@ -743,6 +991,10 @@ 9679923218BBAE2800394606 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); CODE_SIGN_IDENTITY = "iPhone Developer"; DEAD_CODE_STRIPPING = NO; DSTROOT = /tmp/Adjust.dst; @@ -764,6 +1016,10 @@ 9679923418BBAE2800394606 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", @@ -785,6 +1041,10 @@ 9679923518BBAE2800394606 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", @@ -802,6 +1062,10 @@ 96BCFBE91AC99FBD005A65C5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -809,14 +1073,82 @@ 96BCFBEA1AC99FBD005A65C5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 9DFA37B31C0F219400782607 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); + CLANG_WARN_UNREACHABLE_CODE = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = AdjustSdk/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.AdjustSdk; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 9DFA37B41C0F219400782607 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); + CLANG_WARN_UNREACHABLE_CODE = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = AdjustSdk/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.AdjustSdk; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 9679920818BBAE2800394606 /* Build configuration list for PBXProject "adjust" */ = { + 9679920818BBAE2800394606 /* Build configuration list for PBXProject "Adjust" */ = { isa = XCConfigurationList; buildConfigurations = ( 9679922E18BBAE2800394606 /* Debug */, @@ -843,7 +1175,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 96BCFBE81AC99FBD005A65C5 /* Build configuration list for PBXAggregateTarget "framework" */ = { + 96BCFBE81AC99FBD005A65C5 /* Build configuration list for PBXAggregateTarget "AdjustStatic" */ = { isa = XCConfigurationList; buildConfigurations = ( 96BCFBE91AC99FBD005A65C5 /* Debug */, @@ -852,6 +1184,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 9DFA37B21C0F219400782607 /* Build configuration list for PBXNativeTarget "AdjustSdk" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9DFA37B31C0F219400782607 /* Debug */, + 9DFA37B41C0F219400782607 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 9679920518BBAE2800394606 /* Project object */; diff --git a/Adjust.xcodeproj/project.xcworkspace/xcshareddata/Adjust.xcscmblueprint b/Adjust.xcodeproj/project.xcworkspace/xcshareddata/Adjust.xcscmblueprint new file mode 100644 index 000000000..997f0b272 --- /dev/null +++ b/Adjust.xcodeproj/project.xcworkspace/xcshareddata/Adjust.xcscmblueprint @@ -0,0 +1,30 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "5D3A06A058226D065739B53871A0207A1C3022C2", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "5D3A06A058226D065739B53871A0207A1C3022C2" : 0, + "F7C6F209B1DCA446C89CD9019B5C206C0685236A" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "39D3F7B5-32C4-4987-9F89-1A4B49A266EA", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "5D3A06A058226D065739B53871A0207A1C3022C2" : "ios_sdk\/", + "F7C6F209B1DCA446C89CD9019B5C206C0685236A" : "cordova_sdk\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "Adjust", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Adjust.xcodeproj", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:adjust\/ios_sdk.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5D3A06A058226D065739B53871A0207A1C3022C2" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:adjust\/cordova_sdk.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "F7C6F209B1DCA446C89CD9019B5C206C0685236A" + } + ] +} \ No newline at end of file diff --git a/Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme b/Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme new file mode 100644 index 000000000..9993b13e7 --- /dev/null +++ b/Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index c3786be1a..21e0975ca 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -255,7 +255,7 @@ - (void)setIadDetails:(NSDictionary *)attributionDetails retriesLeft:(int)retriesLeft { if (![ADJUtil isNull:error]) { - [self.logger error:@"iAd details error (%s)", [error description]]; + [self.logger warn:@"Unable to read iAd details"]; if (retriesLeft < 0) { [self.logger error:@"Reached limit number of retry for iAd"]; @@ -267,7 +267,6 @@ - (void)setIadDetails:(NSDictionary *)attributionDetails } if (error.code == AdjADClientErrorUnknown) { - dispatch_time_t retryTime = dispatch_time(DISPATCH_TIME_NOW, kDelayRetryIad); dispatch_after(retryTime, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [[UIDevice currentDevice] adjSetIad:self triesV3Left:retriesLeft]; diff --git a/Adjust/ADJUtil.m b/Adjust/ADJUtil.m index a36d59184..324eb257b 100644 --- a/Adjust/ADJUtil.m +++ b/Adjust/ADJUtil.m @@ -16,7 +16,7 @@ #include static NSString * const kBaseUrl = @"https://app.adjust.com"; -static NSString * const kClientSdk = @"ios4.4.5"; +static NSString * const kClientSdk = @"ios4.5.0"; static NSString * const kDateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z"; static NSDateFormatter *dateFormat; diff --git a/Adjust/Info.plist b/Adjust/Info.plist new file mode 100644 index 000000000..d3de8eefb --- /dev/null +++ b/Adjust/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/AdjustSdk/AdjustSdk.h b/AdjustSdk/AdjustSdk.h new file mode 100644 index 000000000..185bad7fb --- /dev/null +++ b/AdjustSdk/AdjustSdk.h @@ -0,0 +1,23 @@ +// +// AdjustSdk.h +// AdjustSdk +// +// Created by Uglješa Erceg on 02/12/15. +// Copyright © 2015 adjust GmbH. All rights reserved. +// + +#import + +//! Project version number for AdjustSdk. +FOUNDATION_EXPORT double AdjustSdkVersionNumber; + +//! Project version string for AdjustSdk. +FOUNDATION_EXPORT const unsigned char AdjustSdkVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import +#import +#import diff --git a/AdjustSdk/Info.plist b/AdjustSdk/Info.plist new file mode 100644 index 000000000..d3de8eefb --- /dev/null +++ b/AdjustSdk/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/AdjustTests/ADJPackageFields.m b/AdjustTests/ADJPackageFields.m index 9f7d3a747..6f955bd00 100644 --- a/AdjustTests/ADJPackageFields.m +++ b/AdjustTests/ADJPackageFields.m @@ -16,7 +16,7 @@ - (id) init { // default values self.appToken = @"123456789012"; - self.clientSdk = @"ios4.4.5"; + self.clientSdk = @"ios4.5.0"; self.suffix = @""; self.environment = @"sandbox"; diff --git a/README.md b/README.md index 63c0c4d8d..11ca486f2 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,28 @@ If you're using [CocoaPods][cocoapods] for `iOs` or `tvOS`, you can add the foll `Podfile` and continue with [step 4](#step4): ```ruby -pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v4.4.5' +pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v4.5.0' ``` +If you're using [Carthage][carthage], you can add following line to your `Cartfile` +and continue with [step 3](#step3): + +```ruby +github "adjust/ios_sdk" +``` + +You can also choose to integrate the adjust SDK by adding it to your project as a framework. +On the [releases page][releases] you can find two archives: + +* `AdjustSdkStatic.framework.zip` +* `AdjustSdkDynamic.framework.zip` + +Since the release of iOS 8, Apple has introduced dynamic frameworks (also known as embedded frameworks). +If your app is targeting iOS 8 or higher, you can use the adjust SDK dynamic framework. +Choose which framework you want to use – static or dynamic – and add it to your project +before continuing with [step 3](#step3). + + ### 1. Get the SDK Download the latest version from our [releases page][releases]. Extract the @@ -40,7 +59,7 @@ groups`. ![][add] -### 3. Add the AdSupport and iAd framework +### 3. Add the AdSupport and iAd framework Select your project in the Project Navigator. In the left hand side of the main view, select your target. In the tab `Build Phases`, expand the group `Link @@ -53,7 +72,23 @@ steps to add the `iAd.framework`, unless you are using tvOS. Change the `Status` ### 4. Integrate Adjust into your app -To start with, we'll set up basic session tracking. +#### Import statement + +If you added the adjust SDK from the source or via a Pod repository, you should +use following import statement: + +```objc +#import "Adjust.h" +``` + +If you added the adjust SDK as a framework or via Carthage, you should use +following import statement: + +```objc +#import +``` + +To begin, we'll set up basic session tracking. #### Basic Setup @@ -64,6 +99,7 @@ method of your app delegate: ```objc #import "Adjust.h" +// or #import // ... NSString *yourAppToken = @"{YourAppToken}"; NSString *environment = ADJEnvironmentSandbox; @@ -297,6 +333,7 @@ policies.][attribution-data] ```objc #import "Adjust.h" + // or #import @interface AppDelegate : UIResponder ``` @@ -384,6 +421,7 @@ You can read more about special partners and these integrations in our [adjust.com]: http://adjust.com [cocoapods]: http://cocoapods.org +[carthage]: https://github.com/Carthage/Carthage [dashboard]: http://adjust.com [examples]: http://github.com/adjust/ios_sdk/tree/master/examples [example-ios]: http://github.com/adjust/ios_sdk/tree/master/examples/AdjustExample-iOS @@ -405,7 +443,7 @@ You can read more about special partners and these integrations in our ## License -The adjust-SDK is licensed under the MIT License. +The adjust SDK is licensed under the MIT License. Copyright (c) 2012-2015 adjust GmbH, http://www.adjust.com diff --git a/VERSION b/VERSION index fa1ba0458..a84947d6f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.4.5 +4.5.0 diff --git a/doc/migrate.md b/doc/migrate.md index a545d76e0..2211950b5 100644 --- a/doc/migrate.md +++ b/doc/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.4.5 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.5.0 from v3.4.0 ### Initial setup diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj b/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj index ebc775d87..a2126a9a1 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj +++ b/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ 963909411BCBFCF300A2E8A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909401BCBFCF300A2E8A4 /* main.m */; }; 963909441BCBFCF300A2E8A4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909431BCBFCF300A2E8A4 /* AppDelegate.m */; }; - 963909471BCBFCF300A2E8A4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909461BCBFCF300A2E8A4 /* ViewController.m */; }; 9639094A1BCBFCF300A2E8A4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 963909481BCBFCF300A2E8A4 /* Main.storyboard */; }; 9639094C1BCBFCF300A2E8A4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9639094B1BCBFCF300A2E8A4 /* Assets.xcassets */; }; 9639094F1BCBFCF300A2E8A4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9639094D1BCBFCF300A2E8A4 /* LaunchScreen.storyboard */; }; @@ -36,6 +35,9 @@ 963909A61BCBFF8D00A2E8A4 /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639098F1BCBFF8D00A2E8A4 /* ADJTimerOnce.m */; }; 963909A71BCBFF8D00A2E8A4 /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909911BCBFF8D00A2E8A4 /* Adjust.m */; }; 963909A81BCBFF8D00A2E8A4 /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909931BCBFF8D00A2E8A4 /* ADJUtil.m */; }; + 9DAC2DEB1C0F611300AC9D97 /* URLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAC2DEA1C0F611300AC9D97 /* URLRequest.m */; }; + 9DC95F261C104CEF00138E4B /* ViewControlleriOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DC95F251C104CEF00138E4B /* ViewControlleriOS.m */; }; + 9DC95F2A1C10515300138E4B /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DC95F291C10515300138E4B /* Constants.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -43,8 +45,6 @@ 963909401BCBFCF300A2E8A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 963909421BCBFCF300A2E8A4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 963909431BCBFCF300A2E8A4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 963909451BCBFCF300A2E8A4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 963909461BCBFCF300A2E8A4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 963909491BCBFCF300A2E8A4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 9639094B1BCBFCF300A2E8A4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9639094E1BCBFCF300A2E8A4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -93,6 +93,12 @@ 963909911BCBFF8D00A2E8A4 /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; 963909921BCBFF8D00A2E8A4 /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; 963909931BCBFF8D00A2E8A4 /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; + 9DAC2DE91C0F611300AC9D97 /* URLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLRequest.h; sourceTree = ""; }; + 9DAC2DEA1C0F611300AC9D97 /* URLRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = URLRequest.m; sourceTree = ""; }; + 9DC95F241C104CEF00138E4B /* ViewControlleriOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewControlleriOS.h; sourceTree = ""; }; + 9DC95F251C104CEF00138E4B /* ViewControlleriOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewControlleriOS.m; sourceTree = ""; }; + 9DC95F281C10515300138E4B /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; + 9DC95F291C10515300138E4B /* Constants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Constants.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -129,10 +135,14 @@ 9639093E1BCBFCF300A2E8A4 /* AdjustExample-iOS */ = { isa = PBXGroup; children = ( + 9DC95F281C10515300138E4B /* Constants.h */, + 9DC95F291C10515300138E4B /* Constants.m */, 963909421BCBFCF300A2E8A4 /* AppDelegate.h */, 963909431BCBFCF300A2E8A4 /* AppDelegate.m */, - 963909451BCBFCF300A2E8A4 /* ViewController.h */, - 963909461BCBFCF300A2E8A4 /* ViewController.m */, + 9DC95F241C104CEF00138E4B /* ViewControlleriOS.h */, + 9DC95F251C104CEF00138E4B /* ViewControlleriOS.m */, + 9DAC2DE91C0F611300AC9D97 /* URLRequest.h */, + 9DAC2DEA1C0F611300AC9D97 /* URLRequest.m */, 963909481BCBFCF300A2E8A4 /* Main.storyboard */, 9639094B1BCBFCF300A2E8A4 /* Assets.xcassets */, 9639094D1BCBFCF300A2E8A4 /* LaunchScreen.storyboard */, @@ -281,17 +291,18 @@ files = ( 9639099F1BCBFF8D00A2E8A4 /* ADJDeviceInfo.m in Sources */, 963909A81BCBFF8D00A2E8A4 /* ADJUtil.m in Sources */, + 9DAC2DEB1C0F611300AC9D97 /* URLRequest.m in Sources */, 9639099D1BCBFF8D00A2E8A4 /* ADJAttributionHandler.m in Sources */, 963909A21BCBFF8D00A2E8A4 /* ADJPackageBuilder.m in Sources */, 963909A51BCBFF8D00A2E8A4 /* ADJTimerCycle.m in Sources */, 963909A61BCBFF8D00A2E8A4 /* ADJTimerOnce.m in Sources */, + 9DC95F2A1C10515300138E4B /* Constants.m in Sources */, 963909951BCBFF8D00A2E8A4 /* ADJActivityKind.m in Sources */, 9639099A1BCBFF8D00A2E8A4 /* UIDevice+ADJAdditions.m in Sources */, 963909971BCBFF8D00A2E8A4 /* ADJActivityState.m in Sources */, 963909A11BCBFF8D00A2E8A4 /* ADJLogger.m in Sources */, 963909961BCBFF8D00A2E8A4 /* ADJActivityPackage.m in Sources */, 963909A01BCBFF8D00A2E8A4 /* ADJEvent.m in Sources */, - 963909471BCBFCF300A2E8A4 /* ViewController.m in Sources */, 963909A31BCBFF8D00A2E8A4 /* ADJPackageHandler.m in Sources */, 963909981BCBFF8D00A2E8A4 /* NSData+ADJAdditions.m in Sources */, 963909A41BCBFF8D00A2E8A4 /* ADJRequestHandler.m in Sources */, @@ -303,6 +314,7 @@ 9639099B1BCBFF8D00A2E8A4 /* ADJAdjustFactory.m in Sources */, 963909411BCBFCF300A2E8A4 /* main.m in Sources */, 9639099C1BCBFF8D00A2E8A4 /* ADJAttribution.m in Sources */, + 9DC95F261C104CEF00138E4B /* ViewControlleriOS.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.h b/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.h index 576036bb6..057d819a6 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.h +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.h @@ -7,6 +7,7 @@ // #import + #import "Adjust.h" @interface AppDelegate : UIResponder diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m b/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m index 708f4de3b..f0dad7e39 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m @@ -6,6 +6,7 @@ // Copyright © 2015 adjust. All rights reserved. // +#import "Constants.h" #import "AppDelegate.h" @interface AppDelegate () @@ -19,7 +20,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // Override point for customization after application launch. // configure adjust - NSString *yourAppToken = @"{YourAppToken}"; + NSString *yourAppToken = kAppToken; NSString *environment = ADJEnvironmentSandbox; ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment]; @@ -46,8 +47,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return YES; } -- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation -{ +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { [Adjust appWillOpenUrl:url]; return YES; diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/Contents.json b/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/Contents.json b/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/Contents.json new file mode 100644 index 000000000..833056fe9 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "button_background.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "button_background@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/button_background.png b/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/button_background.png new file mode 100644 index 000000000..77fd8e1d2 Binary files /dev/null and b/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/button_background.png differ diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/button_background@2x.png b/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/button_background@2x.png new file mode 100644 index 000000000..0a7ae7491 Binary files /dev/null and b/examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/button_background.imageset/button_background@2x.png differ diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Base.lproj/Main.storyboard b/examples/AdjustExample-iOS/AdjustExample-iOS/Base.lproj/Main.storyboard index b96f10a9a..6c7b9f000 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/Base.lproj/Main.storyboard +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Base.lproj/Main.storyboard @@ -1,14 +1,15 @@ - + - + + - + - + @@ -17,54 +18,171 @@ - - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Constants.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Constants.h new file mode 100644 index 000000000..dde51a584 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Constants.h @@ -0,0 +1,19 @@ +// +// Constants.h +// AdjustExample-iOS +// +// Created by Uglješa Erceg on 03/12/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import + +extern NSString * const kParamIdfv; +extern NSString * const kParamAppToken; +extern NSString * const kBaseForgetUrl; + +extern NSString * const kAppToken; +extern NSString * const kEventToken1; +extern NSString * const kEventToken2; +extern NSString * const kEventToken3; +extern NSString * const kEventToken4; diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Constants.m b/examples/AdjustExample-iOS/AdjustExample-iOS/Constants.m new file mode 100644 index 000000000..2e6cb129f --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Constants.m @@ -0,0 +1,19 @@ +// +// Constants.m +// AdjustExample-iOS +// +// Created by Uglješa Erceg on 03/12/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import "Constants.h" + +NSString * const kParamIdfv = @"idfv"; +NSString * const kParamAppToken = @"app_token"; +NSString * const kBaseForgetUrl = @"https://app.adjust.com/forget_device"; + +NSString * const kAppToken = @"{YourAppToken}"; +NSString * const kEventToken1 = @"{YourEventToken}"; +NSString * const kEventToken2 = @"{YourEventToken}"; +NSString * const kEventToken3 = @"{YourEventToken}"; +NSString * const kEventToken4 = @"{YourEventToken}"; diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/URLRequest.h b/examples/AdjustExample-iOS/AdjustExample-iOS/URLRequest.h new file mode 100644 index 000000000..43abcd7a0 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/URLRequest.h @@ -0,0 +1,17 @@ +// +// URLRequest.h +// AdjustExample-iOS +// +// Created by Uglješa Erceg on 02/12/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import + +@interface URLRequest : NSObject + ++ (void)forgetDeviceWithAppToken:(NSString *)appToken + idfv:(NSString *)idfv + responseHandler:(void (^)(NSString *response))responseHandler; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/URLRequest.m b/examples/AdjustExample-iOS/AdjustExample-iOS/URLRequest.m new file mode 100644 index 000000000..6e2d2b853 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/URLRequest.m @@ -0,0 +1,71 @@ +// +// URLRequest.m +// AdjustExample-iOS +// +// Created by Uglješa Erceg on 02/12/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import "Constants.h" +#import "URLRequest.h" + +@implementation URLRequest + ++ (void)forgetDeviceWithAppToken:(NSString *)appToken + idfv:(NSString *)idfv + responseHandler:(void (^)(NSString *response))responseHandler { + NSDictionary *parameters = @{ kParamAppToken : appToken, + kParamIdfv : idfv }; + NSURL *url = [NSURL URLWithString:kBaseForgetUrl]; + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + + request.timeoutInterval = 5.0; + request.HTTPMethod = @"POST"; + [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; + [request setHTTPBody:[self bodyForParameters:parameters]]; + + NSURLSession *session = [NSURLSession sharedSession]; + NSURLSessionDataTask *task = [session dataTaskWithRequest:request + completionHandler: + ^(NSData *data, NSURLResponse *response, NSError *error) { + responseHandler([NSString stringWithUTF8String:[data bytes]]); + }]; + [task resume]; +} + ++ (NSData *)bodyForParameters:(NSDictionary *)parameters { + NSString *bodyString = [self queryString:parameters]; + NSData *body = [NSData dataWithBytes:bodyString.UTF8String length:bodyString.length]; + + return body; +} + ++ (NSString *)queryString:(NSDictionary *)parameters { + NSMutableArray *pairs = [NSMutableArray array]; + + for (NSString *key in parameters) { + NSString *value = [parameters objectForKey:key]; + NSString *escapedKey = [self urlEncode:key]; + NSString *escapedValue = [self urlEncode:value]; + NSString *pair = [NSString stringWithFormat:@"%@=%@", escapedKey, escapedValue]; + + [pairs addObject:pair]; + } + + NSString *queryString = [pairs componentsJoinedByString:@"&"]; + + return queryString; +} + ++ (NSString *)urlEncode:(NSString *)stringToEncode { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, + (CFStringRef)stringToEncode, + NULL, + (CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ", + CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding))); +#pragma clang diagnostic pop +} + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/ViewController.m b/examples/AdjustExample-iOS/AdjustExample-iOS/ViewController.m deleted file mode 100644 index 81ff19827..000000000 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/ViewController.m +++ /dev/null @@ -1,62 +0,0 @@ -// -// ViewController.m -// AdjustExample-iOS -// -// Created by Pedro Filipe on 12/10/15. -// Copyright © 2015 adjust. All rights reserved. -// - -#import "ViewController.h" -#import "Adjust.h" - -@interface ViewController () - -@property (weak, nonatomic) IBOutlet UIButton *btnTrackSimpleEvent; -@property (weak, nonatomic) IBOutlet UIButton *btnTrackRevenueEvent; -@property (weak, nonatomic) IBOutlet UIButton *btnTrackEventWithCallback; -@property (weak, nonatomic) IBOutlet UIButton *btnTrackEventWithPartner; - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} -- (IBAction)clickTrackSimpleEvent:(UIButton *)sender { - ADJEvent *event = [ADJEvent eventWithEventToken:@"{YourEventToken}"]; - - [Adjust trackEvent:event]; -} -- (IBAction)clickTrackRevenueEvent:(UIButton *)sender { - ADJEvent *event = [ADJEvent eventWithEventToken:@"{YourEventToken}"]; - - // add revenue 1 cent of an euro - [event setRevenue:0.015 currency:@"EUR"]; - - [Adjust trackEvent:event]; -} -- (IBAction)clickEventWithCallback:(UIButton *)sender { - ADJEvent *event = [ADJEvent eventWithEventToken:@"{YourEventToken}"]; - - // add callback parameters to this parameter - [event addCallbackParameter:@"key" value:@"value"]; - - [Adjust trackEvent:event]; -} -- (IBAction)clickEventWithPartner:(UIButton *)sender { - ADJEvent *event = [ADJEvent eventWithEventToken:@"{YourEventToken}"]; - - // add partner parameteres to all events and sessions - [event addPartnerParameter:@"foo" value:@"bar"]; - - [Adjust trackEvent:event]; -} - -@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/ViewController.h b/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.h similarity index 68% rename from examples/AdjustExample-iOS/AdjustExample-iOS/ViewController.h rename to examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.h index 9427cd0f3..753346702 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/ViewController.h +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.h @@ -1,5 +1,5 @@ // -// ViewController.h +// ViewControlleriOS.h // AdjustExample-iOS // // Created by Pedro Filipe on 12/10/15. @@ -8,7 +8,7 @@ #import -@interface ViewController : UIViewController +@interface ViewControlleriOS : UIViewController @end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.m b/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.m new file mode 100644 index 000000000..b3aba1028 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.m @@ -0,0 +1,142 @@ +// +// ViewControlleriOS.m +// AdjustExample-iOS +// +// Created by Pedro Filipe on 12/10/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import "Adjust.h" +#import "Constants.h" +#import "URLRequest.h" +#import "ViewControlleriOS.h" + +@interface ViewControlleriOS () + +@property (weak, nonatomic) IBOutlet UIButton *btnTrackSimpleEvent; +@property (weak, nonatomic) IBOutlet UIButton *btnTrackRevenueEvent; +@property (weak, nonatomic) IBOutlet UIButton *btnTrackCallbackEvent; +@property (weak, nonatomic) IBOutlet UIButton *btnTrackPartnerEvent; +@property (weak, nonatomic) IBOutlet UIButton *btnEnableOfflineMode; +@property (weak, nonatomic) IBOutlet UIButton *btnDisableOfflineMode; +@property (weak, nonatomic) IBOutlet UIButton *btnEnableSdk; +@property (weak, nonatomic) IBOutlet UIButton *btnDisableSdk; +@property (weak, nonatomic) IBOutlet UIButton *btnIsSdkEnabled; +@property (weak, nonatomic) IBOutlet UIButton *btnForgetThisDevice; + +@end + +@implementation ViewControlleriOS + +- (void)viewDidLoad { + [super viewDidLoad]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +- (IBAction)clickTrackSimpleEvent:(UIButton *)sender { + ADJEvent *event = [ADJEvent eventWithEventToken:kEventToken1]; + + [Adjust trackEvent:event]; +} + +- (IBAction)clickTrackRevenueEvent:(UIButton *)sender { + ADJEvent *event = [ADJEvent eventWithEventToken:kEventToken2]; + + // Add revenue 1 cent of an euro. + [event setRevenue:0.01 currency:@"EUR"]; + + [Adjust trackEvent:event]; +} + +- (IBAction)clickTrackCallbackEvent:(UIButton *)sender { + ADJEvent *event = [ADJEvent eventWithEventToken:kEventToken3]; + + // Add callback parameters to this event. + [event addCallbackParameter:@"a" value:@"b"]; + [event addCallbackParameter:@"key" value:@"value"]; + [event addCallbackParameter:@"a" value:@"c"]; + + [Adjust trackEvent:event]; +} + +- (IBAction)clickTrackPartnerEvent:(UIButton *)sender { + ADJEvent *event = [ADJEvent eventWithEventToken:kEventToken4]; + + // Add partner parameteres to this event. + [event addPartnerParameter:@"x" value:@"y"]; + [event addPartnerParameter:@"foo" value:@"bar"]; + [event addPartnerParameter:@"x" value:@"z"]; + + [Adjust trackEvent:event]; +} + +- (IBAction)clickEnableOfflineMode:(id)sender { + [Adjust setOfflineMode:YES]; +} + +- (IBAction)clickDisableOfflineMode:(id)sender { + [Adjust setOfflineMode:NO]; +} + +- (IBAction)clickEnableSdk:(id)sender { + [Adjust setEnabled:YES]; +} + +- (IBAction)clickDisableSdk:(id)sender { + [Adjust setEnabled:NO]; +} + +- (IBAction)clickIsSdkEnabled:(id)sender { + NSString *message; + + if ([Adjust isEnabled]) { + message = @"SDK is ENABLED!"; + } else { + message = @"SDK is DISABLED!"; + } + + UIAlertView *alert = [[UIAlertView alloc ]initWithTitle:@"Is SDK Enabled?" + message:message + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [alert show]; +} + +- (IBAction)clickForgetThisDevice:(id)sender { + NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; + + [URLRequest forgetDeviceWithAppToken:kAppToken + idfv:idfv + responseHandler:^(NSString *response) { + [self responseHandler:response]; + }]; +} + +- (void)responseHandler:(NSString *)response { + NSString *message; + + if ([[response lowercaseString] containsString:[@"Forgot device" lowercaseString]]) { + message = @"Device is forgotten!"; + } else { + message = @"Device isn't known!"; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [self showResultInMainThread:message]; + }); +} + +- (void)showResultInMainThread:(NSString *)message { + UIAlertView *alert = [[UIAlertView alloc ]initWithTitle:@"Forget device" + message:message + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [alert show]; +} + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj b/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj index a6f37c8b7..7581a085e 100644 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 963909B71BCC0D8300A2E8A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909B61BCC0D8300A2E8A4 /* main.m */; }; 963909BA1BCC0D8300A2E8A4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909B91BCC0D8300A2E8A4 /* AppDelegate.m */; }; - 963909BD1BCC0D8300A2E8A4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909BC1BCC0D8300A2E8A4 /* ViewController.m */; }; + 963909BD1BCC0D8300A2E8A4 /* ViewControllertvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909BC1BCC0D8300A2E8A4 /* ViewControllertvOS.m */; }; 963909C01BCC0D8300A2E8A4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 963909BE1BCC0D8300A2E8A4 /* Main.storyboard */; }; 963909C21BCC0D8300A2E8A4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 963909C11BCC0D8300A2E8A4 /* Assets.xcassets */; }; 963909D01BCC0DA600A2E8A4 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963909CF1BCC0DA600A2E8A4 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; @@ -34,6 +34,8 @@ 96390A0F1BCC0DF100A2E8A4 /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909F81BCC0DF100A2E8A4 /* ADJTimerOnce.m */; }; 96390A101BCC0DF100A2E8A4 /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909FA1BCC0DF100A2E8A4 /* Adjust.m */; }; 96390A111BCC0DF100A2E8A4 /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909FC1BCC0DF100A2E8A4 /* ADJUtil.m */; }; + 9DC95F2F1C10596500138E4B /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DC95F2E1C10596500138E4B /* Constants.m */; }; + 9DC95F321C105B4C00138E4B /* URLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DC95F311C105B4C00138E4B /* URLRequest.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -41,8 +43,8 @@ 963909B61BCC0D8300A2E8A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 963909B81BCC0D8300A2E8A4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 963909B91BCC0D8300A2E8A4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 963909BB1BCC0D8300A2E8A4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 963909BC1BCC0D8300A2E8A4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 963909BB1BCC0D8300A2E8A4 /* ViewControllertvOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewControllertvOS.h; sourceTree = ""; }; + 963909BC1BCC0D8300A2E8A4 /* ViewControllertvOS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewControllertvOS.m; sourceTree = ""; }; 963909BF1BCC0D8300A2E8A4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 963909C11BCC0D8300A2E8A4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 963909C31BCC0D8300A2E8A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -89,6 +91,10 @@ 963909FA1BCC0DF100A2E8A4 /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; 963909FB1BCC0DF100A2E8A4 /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; 963909FC1BCC0DF100A2E8A4 /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; + 9DC95F2D1C10596500138E4B /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; + 9DC95F2E1C10596500138E4B /* Constants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Constants.m; sourceTree = ""; }; + 9DC95F301C105B4C00138E4B /* URLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLRequest.h; sourceTree = ""; }; + 9DC95F311C105B4C00138E4B /* URLRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = URLRequest.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -123,10 +129,14 @@ 963909B41BCC0D8300A2E8A4 /* AdjustExample-tvOS */ = { isa = PBXGroup; children = ( + 9DC95F2D1C10596500138E4B /* Constants.h */, + 9DC95F2E1C10596500138E4B /* Constants.m */, 963909B81BCC0D8300A2E8A4 /* AppDelegate.h */, 963909B91BCC0D8300A2E8A4 /* AppDelegate.m */, - 963909BB1BCC0D8300A2E8A4 /* ViewController.h */, - 963909BC1BCC0D8300A2E8A4 /* ViewController.m */, + 963909BB1BCC0D8300A2E8A4 /* ViewControllertvOS.h */, + 963909BC1BCC0D8300A2E8A4 /* ViewControllertvOS.m */, + 9DC95F301C105B4C00138E4B /* URLRequest.h */, + 9DC95F311C105B4C00138E4B /* URLRequest.m */, 963909BE1BCC0D8300A2E8A4 /* Main.storyboard */, 963909C11BCC0D8300A2E8A4 /* Assets.xcassets */, 963909C31BCC0D8300A2E8A4 /* Info.plist */, @@ -276,6 +286,7 @@ 96390A061BCC0DF100A2E8A4 /* ADJAttributionHandler.m in Sources */, 96390A0B1BCC0DF100A2E8A4 /* ADJPackageBuilder.m in Sources */, 96390A0E1BCC0DF100A2E8A4 /* ADJTimerCycle.m in Sources */, + 9DC95F2F1C10596500138E4B /* Constants.m in Sources */, 96390A0F1BCC0DF100A2E8A4 /* ADJTimerOnce.m in Sources */, 963909FE1BCC0DF100A2E8A4 /* ADJActivityKind.m in Sources */, 96390A031BCC0DF100A2E8A4 /* UIDevice+ADJAdditions.m in Sources */, @@ -283,7 +294,7 @@ 96390A0A1BCC0DF100A2E8A4 /* ADJLogger.m in Sources */, 963909FF1BCC0DF100A2E8A4 /* ADJActivityPackage.m in Sources */, 96390A091BCC0DF100A2E8A4 /* ADJEvent.m in Sources */, - 963909BD1BCC0D8300A2E8A4 /* ViewController.m in Sources */, + 963909BD1BCC0D8300A2E8A4 /* ViewControllertvOS.m in Sources */, 96390A0C1BCC0DF100A2E8A4 /* ADJPackageHandler.m in Sources */, 96390A011BCC0DF100A2E8A4 /* NSData+ADJAdditions.m in Sources */, 96390A0D1BCC0DF100A2E8A4 /* ADJRequestHandler.m in Sources */, @@ -293,6 +304,7 @@ 96390A071BCC0DF100A2E8A4 /* ADJConfig.m in Sources */, 963909BA1BCC0D8300A2E8A4 /* AppDelegate.m in Sources */, 96390A041BCC0DF100A2E8A4 /* ADJAdjustFactory.m in Sources */, + 9DC95F321C105B4C00138E4B /* URLRequest.m in Sources */, 963909B71BCC0D8300A2E8A4 /* main.m in Sources */, 96390A051BCC0DF100A2E8A4 /* ADJAttribution.m in Sources */, ); @@ -437,6 +449,7 @@ 963909C81BCC0D8300A2E8A4 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.h index 66cb9b878..92f41ce6c 100644 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.h +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.h @@ -7,6 +7,7 @@ // #import + #import "Adjust.h" @interface AppDelegate : UIResponder diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.m b/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.m index f419e3662..59e7c62a0 100644 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.m +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.m @@ -6,6 +6,7 @@ // Copyright © 2015 adjust. All rights reserved. // +#import "Constants.h" #import "AppDelegate.h" @interface AppDelegate () @@ -21,7 +22,7 @@ - (void)adjustAttributionChanged:(ADJAttribution *)attribution { - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. - NSString *yourAppToken = @"{YourAppToken}"; + NSString *yourAppToken = kAppToken; NSString *environment = ADJEnvironmentSandbox; ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment]; @@ -33,7 +34,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return YES; } -- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { [Adjust appWillOpenUrl:url]; return YES; diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Base.lproj/Main.storyboard b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Base.lproj/Main.storyboard index 7265fed27..d97cdc99a 100644 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Base.lproj/Main.storyboard +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Base.lproj/Main.storyboard @@ -1,13 +1,14 @@ - + - + + - + - + @@ -16,46 +17,143 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Constants.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Constants.h new file mode 100644 index 000000000..c774aacb4 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Constants.h @@ -0,0 +1,19 @@ +// +// Constants.h +// AdjustExample-tvOS +// +// Created by Uglješa Erceg on 03/12/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import + +extern NSString * const kParamIdfv; +extern NSString * const kParamAppToken; +extern NSString * const kBaseForgetUrl; + +extern NSString * const kAppToken; +extern NSString * const kEventToken1; +extern NSString * const kEventToken2; +extern NSString * const kEventToken3; +extern NSString * const kEventToken4; diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Constants.m b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Constants.m new file mode 100644 index 000000000..9b1405814 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Constants.m @@ -0,0 +1,19 @@ +// +// Constants.m +// AdjustExample-tvOS +// +// Created by Uglješa Erceg on 03/12/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import "Constants.h" + +NSString * const kParamIdfv = @"idfv"; +NSString * const kParamAppToken = @"app_token"; +NSString * const kBaseForgetUrl = @"https://app.adjust.com/forget_device"; + +NSString * const kAppToken = @"{YourAppToken}"; +NSString * const kEventToken1 = @"{YourEventToken}"; +NSString * const kEventToken2 = @"{YourEventToken}"; +NSString * const kEventToken3 = @"{YourEventToken}"; +NSString * const kEventToken4 = @"{YourEventToken}"; \ No newline at end of file diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/URLRequest.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/URLRequest.h new file mode 100644 index 000000000..e077ac399 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/URLRequest.h @@ -0,0 +1,17 @@ +// +// URLRequest.h +// AdjustExample-tvOS +// +// Created by Uglješa Erceg on 03/12/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import + +@interface URLRequest : NSObject + ++ (void)forgetDeviceWithAppToken:(NSString *)appToken + idfv:(NSString *)idfv + responseHandler:(void (^)(NSString *response))responseHandler; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/URLRequest.m b/examples/AdjustExample-tvOS/AdjustExample-tvOS/URLRequest.m new file mode 100644 index 000000000..6bcd7b36f --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/URLRequest.m @@ -0,0 +1,71 @@ +// +// URLRequest.m +// AdjustExample-tvOS +// +// Created by Uglješa Erceg on 03/12/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import "Constants.h" +#import "URLRequest.h" + +@implementation URLRequest + ++ (void)forgetDeviceWithAppToken:(NSString *)appToken + idfv:(NSString *)idfv + responseHandler:(void (^)(NSString *response))responseHandler { + NSDictionary *parameters = @{ kParamAppToken : appToken, + kParamIdfv : idfv }; + NSURL *url = [NSURL URLWithString:kBaseForgetUrl]; + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + + request.timeoutInterval = 5.0; + request.HTTPMethod = @"POST"; + [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; + [request setHTTPBody:[self bodyForParameters:parameters]]; + + NSURLSession *session = [NSURLSession sharedSession]; + NSURLSessionDataTask *task = [session dataTaskWithRequest:request + completionHandler: + ^(NSData *data, NSURLResponse *response, NSError *error) { + responseHandler([NSString stringWithUTF8String:[data bytes]]); + }]; + [task resume]; +} + ++ (NSData *)bodyForParameters:(NSDictionary *)parameters { + NSString *bodyString = [self queryString:parameters]; + NSData *body = [NSData dataWithBytes:bodyString.UTF8String length:bodyString.length]; + + return body; +} + ++ (NSString *)queryString:(NSDictionary *)parameters { + NSMutableArray *pairs = [NSMutableArray array]; + + for (NSString *key in parameters) { + NSString *value = [parameters objectForKey:key]; + NSString *escapedKey = [self urlEncode:key]; + NSString *escapedValue = [self urlEncode:value]; + NSString *pair = [NSString stringWithFormat:@"%@=%@", escapedKey, escapedValue]; + + [pairs addObject:pair]; + } + + NSString *queryString = [pairs componentsJoinedByString:@"&"]; + + return queryString; +} + ++ (NSString *)urlEncode:(NSString *)stringToEncode { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, + (CFStringRef)stringToEncode, + NULL, + (CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ", + CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding))); +#pragma clang diagnostic pop +} + +@end \ No newline at end of file diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewController.m b/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewController.m deleted file mode 100644 index d2b8d79b5..000000000 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewController.m +++ /dev/null @@ -1,63 +0,0 @@ -// -// ViewController.m -// AdjustExample-tvOS -// -// Created by Pedro Filipe on 12/10/15. -// Copyright © 2015 adjust. All rights reserved. -// - -#import "ViewController.h" -#import "Adjust.h" - -@interface ViewController () - -@property (weak, nonatomic) IBOutlet UIButton *btnTrackSimpleEvent; -@property (weak, nonatomic) IBOutlet UIButton *btnTrackRevenueEvent; -@property (weak, nonatomic) IBOutlet UIButton *btnTrackEventWithCallback; -@property (weak, nonatomic) IBOutlet UIButton *btnTrackEventWithPartner; - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (IBAction)clickTrackSimpleEvent:(UIButton *)sender { - ADJEvent *event = [ADJEvent eventWithEventToken:@"{YourEventToken}"]; - - [Adjust trackEvent:event]; -} -- (IBAction)clickTrackRevenueEvent:(UIButton *)sender { - ADJEvent *event = [ADJEvent eventWithEventToken:@"{YourEventToken}"]; - - // add revenue 1 cent of an euro - [event setRevenue:0.015 currency:@"EUR"]; - - [Adjust trackEvent:event]; -} -- (IBAction)clickEventWithCallback:(UIButton *)sender { - ADJEvent *event = [ADJEvent eventWithEventToken:@"{YourEventToken}"]; - - // add callback parameters to this parameter - [event addCallbackParameter:@"key" value:@"value"]; - - [Adjust trackEvent:event]; -} -- (IBAction)clickEventWithPartner:(UIButton *)sender { - ADJEvent *event = [ADJEvent eventWithEventToken:@"{YourEventToken}"]; - - // add partner parameteres to all events and sessions - [event addPartnerParameter:@"foo" value:@"bar"]; - - [Adjust trackEvent:event]; -} - -@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewController.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.h similarity index 68% rename from examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewController.h rename to examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.h index 6df6c135a..94092bef3 100644 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewController.h +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.h @@ -1,5 +1,5 @@ // -// ViewController.h +// ViewControllertvOS.h // AdjustExample-tvOS // // Created by Pedro Filipe on 12/10/15. @@ -8,7 +8,7 @@ #import -@interface ViewController : UIViewController +@interface ViewControllertvOS : UIViewController @end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.m b/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.m new file mode 100644 index 000000000..df13e9b51 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.m @@ -0,0 +1,148 @@ +// +// ViewControllertvOS.m +// AdjustExample-tvOS +// +// Created by Pedro Filipe on 12/10/15. +// Copyright © 2015 adjust. All rights reserved. +// + +#import "Adjust.h" +#import "Constants.h" +#import "URLRequest.h" +#import "ViewControllertvOS.h" + +@interface ViewControllertvOS () + +@property (weak, nonatomic) IBOutlet UIButton *btnTrackSimpleEvent; +@property (weak, nonatomic) IBOutlet UIButton *btnTrackRevenueEvent; +@property (weak, nonatomic) IBOutlet UIButton *btnTrackCallbackEvent; +@property (weak, nonatomic) IBOutlet UIButton *btnTrackPartnerEvent; +@property (weak, nonatomic) IBOutlet UIButton *btnEnableOfflineMode; +@property (weak, nonatomic) IBOutlet UIButton *btnDisableOfflineMode; +@property (weak, nonatomic) IBOutlet UIButton *btnEnableSdk; +@property (weak, nonatomic) IBOutlet UIButton *btnDisableSdk; +@property (weak, nonatomic) IBOutlet UIButton *btnIsSdkEnabled; +@property (weak, nonatomic) IBOutlet UIButton *btnForgetThisDevice; + +@end + +@implementation ViewControllertvOS + +- (void)viewDidLoad { + [super viewDidLoad]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +- (IBAction)clickTrackSimpleEvent:(UIButton *)sender { + ADJEvent *event = [ADJEvent eventWithEventToken:kEventToken1]; + + [Adjust trackEvent:event]; +} + +- (IBAction)clickTrackRevenueEvent:(UIButton *)sender { + ADJEvent *event = [ADJEvent eventWithEventToken:kEventToken2]; + + // Add revenue 1 cent of an euro. + [event setRevenue:0.01 currency:@"EUR"]; + + [Adjust trackEvent:event]; +} + +- (IBAction)clickTrackCallbackEvent:(UIButton *)sender { + ADJEvent *event = [ADJEvent eventWithEventToken:kEventToken3]; + + // Add callback parameters to this event. + [event addCallbackParameter:@"a" value:@"b"]; + [event addCallbackParameter:@"key" value:@"value"]; + [event addCallbackParameter:@"a" value:@"c"]; + + [Adjust trackEvent:event]; +} + +- (IBAction)clickTrackPartnerEvent:(UIButton *)sender { + ADJEvent *event = [ADJEvent eventWithEventToken:kEventToken4]; + + // Add partner parameteres to this event. + [event addPartnerParameter:@"x" value:@"y"]; + [event addPartnerParameter:@"foo" value:@"bar"]; + [event addPartnerParameter:@"x" value:@"z"]; + + [Adjust trackEvent:event]; +} + +- (IBAction)clickEnableOfflineMode:(id)sender { + [Adjust setOfflineMode:YES]; +} + +- (IBAction)clickDisableOfflineMode:(id)sender { + [Adjust setOfflineMode:NO]; +} + +- (IBAction)clickEnableSdk:(id)sender { + [Adjust setEnabled:YES]; +} + +- (IBAction)clickDisableSdk:(id)sender { + [Adjust setEnabled:NO]; +} + +- (IBAction)clickIsSdkEnabled:(id)sender { + NSString *message; + + if ([Adjust isEnabled]) { + message = @"SDK is ENABLED!"; + } else { + message = @"SDK is DISABLED!"; + } + + UIAlertController *alert = + [UIAlertController alertControllerWithTitle:@"Is SDK Enabled?" + message:message + preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault + handler:^(UIAlertAction *action) {}]; + + [alert addAction:defaultAction]; + [self presentViewController:alert animated:YES completion:nil]; +} + +- (IBAction)clickForgetThisDevice:(id)sender { + NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; + + [URLRequest forgetDeviceWithAppToken:kAppToken + idfv:idfv + responseHandler:^(NSString *response) { + [self responseHandler:response]; + }]; +} + +- (void)responseHandler:(NSString *)response { + NSString *message; + + if ([[response lowercaseString] containsString:[@"Forgot device" lowercaseString]]) { + message = @"Device is forgotten!"; + } else { + message = @"Device isn't known!"; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [self showResultInMainThread:message]; + }); +} + +- (void)showResultInMainThread:(NSString *)message { + UIAlertController *alert = + [UIAlertController alertControllerWithTitle:@"Forget device" + message:message + preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault + handler:^(UIAlertAction *action) {}]; + + [alert addAction:defaultAction]; + [self presentViewController:alert animated:YES completion:nil]; +} + +@end