├── .gitignore ├── LICENSE ├── LICENSE.lesser ├── README.md ├── sdk-android ├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── TuneMarketingConsoleSDK │ ├── android-release-aar-flavor.gradle │ ├── android-release-aar.gradle │ ├── build.gradle │ └── src │ │ ├── androidTest │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── tune │ │ │ ├── DeeplinkTests.java │ │ │ ├── EndpointTests.java │ │ │ ├── GetterTests.java │ │ │ ├── LocationTests.java │ │ │ ├── ParametersTests.java │ │ │ ├── PreloadedAppTests.java │ │ │ ├── QueueTests.java │ │ │ ├── ServerTests.java │ │ │ ├── TuneActivityTests.java │ │ │ ├── TuneDeeplinkerTests.java │ │ │ ├── TuneFirstRunTests.java │ │ │ ├── TuneInterfaceTests.java │ │ │ ├── TuneMakeRequestTests.java │ │ │ ├── TuneNotInitializedTest.java │ │ │ ├── TuneStartupTests.java │ │ │ ├── TuneTestConstants.java │ │ │ ├── TuneTestParams.java │ │ │ ├── TuneTestQueue.java │ │ │ ├── TuneTestWrapper.java │ │ │ ├── TuneUnitTest.java │ │ │ ├── UtilTests.java │ │ │ ├── mocks │ │ │ ├── MockActivity.java │ │ │ ├── MockExecutorService.java │ │ │ ├── MockLocationProvider.java │ │ │ └── MockUrlRequester.java │ │ │ └── utils │ │ │ ├── TuneDateUtilsTests.java │ │ │ ├── TuneJsonUtilsTests.java │ │ │ └── TuneStringUtilsTests.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── tune │ │ ├── ITune.java │ │ ├── ITuneListener.java │ │ ├── Tune.java │ │ ├── TuneConstants.java │ │ ├── TuneDebugLog.java │ │ ├── TuneDeeplinkListener.java │ │ ├── TuneDeeplinker.java │ │ ├── TuneEncryption.java │ │ ├── TuneEvent.java │ │ ├── TuneEventItem.java │ │ ├── TuneEventQueue.java │ │ ├── TuneFirstRunLogic.java │ │ ├── TuneGender.java │ │ ├── TuneInternal.java │ │ ├── TuneParameters.java │ │ ├── TunePreloadData.java │ │ ├── TuneTestRequest.java │ │ ├── TuneUrlBuilder.java │ │ ├── TuneUrlKeys.java │ │ ├── application │ │ ├── TuneActivity.java │ │ ├── TuneActivityLifecycleCallbacks.java │ │ └── TuneApplication.java │ │ ├── http │ │ ├── TuneUrlRequester.java │ │ └── UrlRequester.java │ │ ├── integrations │ │ └── facebook │ │ │ └── TuneFBBridge.java │ │ ├── location │ │ └── TuneLocationListener.java │ │ ├── package-info.java │ │ └── utils │ │ ├── TuneDateUtils.java │ │ ├── TuneFileUtils.java │ │ ├── TuneJsonUtils.java │ │ ├── TuneOptional.java │ │ ├── TuneScreenUtils.java │ │ ├── TuneSharedPrefsDelegate.java │ │ ├── TuneStringUtils.java │ │ └── TuneUtils.java ├── build.gradle ├── config │ ├── android-checkstyle.gradle │ └── checkstyle │ │ ├── README │ │ ├── google_checks.xml │ │ └── tune_checks.xml ├── dist │ ├── TuneMarketingConsoleSDK-5.3.0.aar │ └── TuneMarketingConsoleSDK-6.1.1.aar ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── sdk-ios └── Tune │ ├── .gitignore │ ├── OCMock │ ├── iOS framework │ │ └── OCMock.framework │ │ │ ├── Headers │ │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ │ ├── OCMArg.h │ │ │ ├── OCMConstraint.h │ │ │ ├── OCMFunctions.h │ │ │ ├── OCMLocation.h │ │ │ ├── OCMMacroState.h │ │ │ ├── OCMRecorder.h │ │ │ ├── OCMStubRecorder.h │ │ │ ├── OCMock.h │ │ │ └── OCMockObject.h │ │ │ ├── Info.plist │ │ │ ├── Modules │ │ │ └── module.modulemap │ │ │ ├── OCMock │ │ │ └── _CodeSignature │ │ │ └── CodeResources │ ├── iOS library │ │ ├── OCMock │ │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ │ ├── OCMArg.h │ │ │ ├── OCMConstraint.h │ │ │ ├── OCMFunctions.h │ │ │ ├── OCMLocation.h │ │ │ ├── OCMMacroState.h │ │ │ ├── OCMRecorder.h │ │ │ ├── OCMStubRecorder.h │ │ │ ├── OCMock.h │ │ │ └── OCMockObject.h │ │ └── libOCMock.a │ └── tvOS │ │ └── OCMock.framework │ │ ├── Headers │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ ├── OCMArg.h │ │ ├── OCMConstraint.h │ │ ├── OCMFunctions.h │ │ ├── OCMLocation.h │ │ ├── OCMMacroState.h │ │ ├── OCMRecorder.h │ │ ├── OCMStubRecorder.h │ │ ├── OCMock.h │ │ └── OCMockObject.h │ │ ├── Info.plist │ │ ├── Modules │ │ └── module.modulemap │ │ ├── OCMock │ │ └── _CodeSignature │ │ └── CodeResources │ ├── Tune.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── Tune.xcscheme │ │ ├── TuneUniversal.xcscheme │ │ ├── TuneUniversal_static.xcscheme │ │ ├── TuneUniversal_tvOS.xcscheme │ │ ├── Tune_static.xcscheme │ │ └── Tune_tvOS.xcscheme │ ├── Tune │ ├── Info.plist │ ├── InfoPlist.strings │ ├── NSData+TuneGZIP.h │ ├── NSData+TuneGZIP.m │ ├── NSURLSession+Logging.h │ ├── NSURLSession+Logging.m │ ├── Tune+Internal.h │ ├── Tune.h │ ├── Tune.m │ ├── Tune.modulemap │ ├── TuneAnalyticsConstants.h │ ├── TuneAnalyticsConstants.m │ ├── TuneAnalyticsVariable.h │ ├── TuneAnalyticsVariable.m │ ├── TuneConfiguration.h │ ├── TuneConfiguration.m │ ├── TuneConstants.h │ ├── TuneConstants.m │ ├── TuneDateUtils.h │ ├── TuneDateUtils.m │ ├── TuneDeeplink.h │ ├── TuneDeeplink.m │ ├── TuneDeeplinker.h │ ├── TuneDeeplinker.m │ ├── TuneDeviceDetails.h │ ├── TuneDeviceDetails.m │ ├── TuneDeviceUtils.h │ ├── TuneDeviceUtils.m │ ├── TuneEncrypter.h │ ├── TuneEncrypter.m │ ├── TuneEvent+Internal.h │ ├── TuneEvent.h │ ├── TuneEvent.m │ ├── TuneEventItem+Internal.h │ ├── TuneEventItem.h │ ├── TuneEventItem.m │ ├── TuneEventKeys.h │ ├── TuneEventKeys.m │ ├── TuneEventQueue.h │ ├── TuneEventQueue.m │ ├── TuneFBBridge.h │ ├── TuneFBBridge.m │ ├── TuneFileManager.h │ ├── TuneFileManager.m │ ├── TuneFileUtils.h │ ├── TuneFileUtils.m │ ├── TuneHttpRequest.h │ ├── TuneHttpRequest.m │ ├── TuneHttpResponse.h │ ├── TuneHttpResponse.m │ ├── TuneHttpUtils.h │ ├── TuneHttpUtils.m │ ├── TuneIadUtils.h │ ├── TuneIadUtils.m │ ├── TuneIfa.h │ ├── TuneIfa.m │ ├── TuneInstallReceipt.h │ ├── TuneInstallReceipt.m │ ├── TuneKeyStrings.h │ ├── TuneKeyStrings.m │ ├── TuneLocation+Internal.h │ ├── TuneLocation.h │ ├── TuneLocation.m │ ├── TuneLocationHelper.h │ ├── TuneLocationHelper.m │ ├── TuneLog.h │ ├── TuneLog.m │ ├── TuneManager.h │ ├── TuneManager.m │ ├── TuneModule.h │ ├── TuneModule.m │ ├── TuneNetworkUtils.h │ ├── TuneNetworkUtils.m │ ├── TunePreloadData.h │ ├── TunePreloadData.m │ ├── TuneReachability.h │ ├── TuneReachability.m │ ├── TuneSessionManager.h │ ├── TuneSessionManager.m │ ├── TuneSkyhookCenter.h │ ├── TuneSkyhookCenter.m │ ├── TuneSkyhookConstants.h │ ├── TuneSkyhookConstants.m │ ├── TuneSkyhookObserver.h │ ├── TuneSkyhookObserver.m │ ├── TuneSkyhookPayload.h │ ├── TuneSkyhookPayload.m │ ├── TuneSkyhookPayloadConstants.h │ ├── TuneSkyhookPayloadConstants.m │ ├── TuneStoreKitDelegate.h │ ├── TuneStoreKitDelegate.m │ ├── TuneStringUtils.h │ ├── TuneStringUtils.m │ ├── TuneTracker.h │ ├── TuneTracker.m │ ├── TuneUserAgentCollector.h │ ├── TuneUserAgentCollector.m │ ├── TuneUserDefaultsUtils.h │ ├── TuneUserDefaultsUtils.m │ ├── TuneUserProfile.h │ ├── TuneUserProfile.m │ ├── TuneUserProfileKeys.h │ ├── TuneUserProfileKeys.m │ ├── TuneUtils.h │ ├── TuneUtils.m │ ├── Tune_tvos.h │ └── Tune_watchos.h │ ├── TuneTests │ ├── DictionaryLoader.h │ ├── DictionaryLoader.m │ ├── Info.plist │ ├── InfoPlist.strings │ ├── NSURLRequest+TuneUtils.h │ ├── NSURLRequest+TuneUtils.m │ ├── NSURLSession+TuneDelegateMockServer.h │ ├── NSURLSession+TuneDelegateMockServer.m │ ├── OCMock.framework │ │ ├── Headers │ │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ │ ├── OCMArg.h │ │ │ ├── OCMConstraint.h │ │ │ ├── OCMFunctions.h │ │ │ ├── OCMLocation.h │ │ │ ├── OCMMacroState.h │ │ │ ├── OCMRecorder.h │ │ │ ├── OCMStubRecorder.h │ │ │ ├── OCMock.h │ │ │ └── OCMockObject.h │ │ ├── Info.plist │ │ ├── Modules │ │ │ └── module.modulemap │ │ ├── OCMock │ │ └── _CodeSignature │ │ │ └── CodeResources │ ├── Resources │ │ ├── TuneConfiguration.plist │ │ ├── TuneExperimentManagerTests.json │ │ ├── TunePlaylistEmptySegmentTests.json │ │ ├── TunePlaylistMissingSegmentTests.json │ │ └── TunePowerHookValueTests.json │ ├── SimpleObserver.h │ ├── SimpleObserver.m │ ├── Tune+Testing.h │ ├── TuneBlankAppDelegate.h │ ├── TuneBlankAppDelegate.m │ ├── TuneBlankViewController.h │ ├── TuneBlankViewController.m │ ├── TuneDateUtilsTests.m │ ├── TuneDeeplinkerIntegrationTests.m │ ├── TuneDeeplinkerTests.m │ ├── TuneEncrypterTests.m │ ├── TuneEventItemTests.m │ ├── TuneEventQueue+Testing.h │ ├── TuneEventTests.m │ ├── TuneFileManagerTests.m │ ├── TuneHTTPErrorTests.m │ ├── TuneIadAttributionTests.m │ ├── TuneLogTests.m │ ├── TuneManager+Testing.h │ ├── TuneMeasureEventTests.m │ ├── TuneNotInitializedTests.m │ ├── TuneNotRedactedTests.m │ ├── TuneParametersTests.m │ ├── TunePreloadDataTests.m │ ├── TuneQueueTests.m │ ├── TuneReachabilityTests.m │ ├── TuneRedactedTests.m │ ├── TuneServerTests.m │ ├── TuneSessionManager+Testing.h │ ├── TuneSessionManagerTests.m │ ├── TuneSkyhookCenter+Testing.h │ ├── TuneSkyhookCenterTests.m │ ├── TuneTestParams.h │ ├── TuneTestParams.m │ ├── TuneTests.m │ ├── TuneTestsHelper.h │ ├── TuneTestsHelper.m │ ├── TuneTrackerInitializationTests.m │ ├── TuneUserAgentCollectorTests.m │ ├── TuneUserDefaultsUtilsTests.m │ ├── TuneUserProfile+Testing.h │ ├── TuneUserProfileTests.m │ ├── TuneUtilsTests.m │ ├── TuneXCTestCase.h │ └── TuneXCTestCase.m │ ├── Tune_tvOS │ ├── Tune_tvOS.h │ └── Tune_tvOS.modulemap │ └── Tune_tvOSTests │ ├── Info.plist │ └── Tune_tvOSTests.m └── sdk-windows ├── .gitignore ├── Phone ├── MATPhone8.sln ├── sdk │ ├── Bin │ │ └── Release │ │ │ ├── MATPhone8SDK.dll │ │ │ ├── MATPhone8SDK.pdb │ │ │ ├── Newtonsoft.Json.dll │ │ │ └── Newtonsoft.Json.xml │ ├── MATConstants.cs │ ├── MATEncryption.cs │ ├── MATEventItem.cs │ ├── MATEventQueue.cs │ ├── MATParameters.cs │ ├── MATPhone8-SDK.csproj │ ├── MATResponse.cs │ ├── MATTestRequest.cs │ ├── MATUrlBuilder.cs │ ├── MATUrlRequester.cs │ ├── MobileAppTracker.cs │ ├── Newtonsoft.Json.dll │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config └── test_app │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ ├── AlignmentGrid.png │ ├── ApplicationIcon.png │ ├── BadgeLogo.png │ ├── Logo.png │ ├── SplashScreen.png │ ├── SquareTile150x150.png │ ├── SquareTile71x71.png │ ├── StoreLogo.png │ ├── Tiles │ │ ├── FlipCycleTileLarge.png │ │ ├── FlipCycleTileMedium.png │ │ ├── FlipCycleTileSmall.png │ │ ├── IconicTileMediumLarge.png │ │ └── IconicTileSmall.png │ └── WideLogo.png │ ├── LocalizedStrings.cs │ ├── MATPhone8-TestApp.csproj │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ ├── AppManifest.xml │ ├── AssemblyInfo.cs │ └── WMAppManifest.xml │ └── Resources │ ├── AppResources.Designer.cs │ └── AppResources.resx ├── Universal ├── MATWindowsUniversal.sln ├── sdk │ ├── MATConstants.cs │ ├── MATEncryption.cs │ ├── MATEventItem.cs │ ├── MATEventQueue.cs │ ├── MATParameters.cs │ ├── MATResponse.cs │ ├── MATTestRequest.cs │ ├── MATUrlBuilder.cs │ ├── MATUrlRequester.cs │ ├── MATWindowsUniversal-SDK.csproj │ ├── MobileAppTracker.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── test_app │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── Logo.scale-100.png │ │ ├── SmallLogo.scale-100.png │ │ ├── SplashScreen.scale-100.png │ │ └── StoreLogo.scale-100.png │ ├── MATWindowsUniversal-TestApp.csproj │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config └── unit_test │ ├── EndpointTests.cs │ ├── Images │ ├── UnitTestLogo.scale-100.png │ ├── UnitTestSmallLogo.scale-100.png │ ├── UnitTestSplashScreen.scale-100.png │ └── UnitTestStoreLogo.scale-100.png │ ├── MATTestConstants.cs │ ├── MATTestParams.cs │ ├── MATTestWrapper.cs │ ├── MATUnitTest.cs │ ├── MATWindowsUniversalUnitTest.csproj │ ├── Package.appxmanifest │ ├── ParametersTest.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── QueueTests.cs │ ├── ServerTests.cs │ └── packages.config ├── builds ├── MATPhone8SDK.dll.lnk └── MATWindowsUniversalSDK.dll.lnk └── sdk-winrt ├── Tune.cpp ├── Tune.h ├── TuneEvent.cpp ├── TuneEvent.h ├── TuneEventItem.cpp ├── TuneEventItem.h ├── pch.cpp ├── pch.h └── targetver.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | *.xcworkspace 12 | !default.xcworkspace 13 | xcuserdata 14 | *.moved-aside 15 | Resources/Configuration/Private.xcconfig 16 | 17 | # OS X 18 | .DS_Store 19 | .pid_file 20 | .sass-cache 21 | 22 | # iOS SDK 23 | sdk-ios/Legacy/ 24 | sdk-ios/Tune/OCMock/ocmock-3.4.1.dmg 25 | sdk-ios/build-test/ 26 | sdk-ios/cocoapod-test/ 27 | 28 | #appledoc 29 | docs/docset-installed.txt 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | These SDKs are deprecated 2 | 3 | The MobileAppTracking SDK code is released under the [LGPL license](https://www.gnu.org/licenses/lgpl.html). For alternative licensing options, please contact TUNE, Inc. 4 | -------------------------------------------------------------------------------- /sdk-android/.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | 19 | # Local configuration file (sdk path, etc) 20 | local.properties 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Log Files 26 | *.log 27 | 28 | # Android Studio Navigation editor temp files 29 | .navigation/ 30 | 31 | # Android Studio captures folder 32 | captures/ 33 | 34 | # Android Studio 35 | *.iml 36 | .idea/* 37 | 38 | GoogleIO -------------------------------------------------------------------------------- /sdk-android/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing Code 2 | ==================== 3 | 4 | We appreciate your contributions to this repository! Since our infrastructure might make things a little different from usual processes, we wanted to clarify our specific process. 5 | 6 | TUNE maintains internal repositories for our external Github SDKs and plugins repositories, and we only push one way (from internal to external repositories.) So, while we can't directly merge in your pull requests, if accepted we'll incorporate your changes into our internal repository to be included in our external releases. In any case, after review we'll close your pull requests and let you know if your changes have been included as-is, rejected, or accepted with adjustments. 7 | 8 | Thanks again for helping us make our code the best it can be! 9 | -------------------------------------------------------------------------------- /sdk-android/README.md: -------------------------------------------------------------------------------- 1 | TUNE Android SDK 2 | ==================== 3 | 4 | #Build 5 | 6 | - Install [Android Studio](http://developer.android.com/tools/studio/index.html) 7 | 8 | - `./gradlew makeJar` creates `/dist/TuneMarketingConsoleSDK-x.y.z.jar` 9 | 10 | #Test 11 | 12 | - `./gradlew connectedCheck --info` runs instrumentation tests in `/TuneMarketingConsoleSDK/src/androidTest` 13 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/java/com/tune/TuneFirstRunTests.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | import android.support.test.runner.AndroidJUnit4; 4 | 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | 8 | import static org.junit.Assert.assertFalse; 9 | import static org.junit.Assert.assertTrue; 10 | 11 | /** 12 | * Test the TuneFirstRunLogic. 13 | * Note that default Tune initialization may (or may not) set the Advertiser Id, so we cannot test 14 | * sequences where that doesn't come in (or comes in out of order) 15 | */ 16 | @RunWith(AndroidJUnit4.class) 17 | public class TuneFirstRunTests extends TuneUnitTest { 18 | @Test 19 | public void testFirstRunWaiting() { 20 | assertTrue(tune.firstRunLogic.isWaiting()); 21 | } 22 | 23 | /** 24 | * Sequence A 1 25 | * 1. Advertiser Id 26 | * 2. Google Install Referrer (success) 27 | */ 28 | @Test 29 | public void testSequenceA1() { 30 | assertTrue(tune.firstRunLogic.isWaiting()); 31 | 32 | // Should still be waiting after the Advertising Id comes in 33 | tune.firstRunLogic.receivedAdvertisingId(); 34 | assertTrue(tune.firstRunLogic.isWaiting()); 35 | 36 | // Should be done waiting now. 37 | tune.firstRunLogic.googleInstallReferrerSequenceComplete(); 38 | assertFalse(tune.firstRunLogic.isWaiting()); 39 | } 40 | 41 | /** 42 | * Sequence A 2 43 | * 1. Advertiser Id 44 | * 2. Google Install Referrer (fail) 45 | */ 46 | @Test 47 | public void testSequenceA2() { 48 | assertTrue(tune.firstRunLogic.isWaiting()); 49 | 50 | // Should still be waiting after the Advertising Id comes in 51 | tune.firstRunLogic.receivedAdvertisingId(); 52 | assertTrue(tune.firstRunLogic.isWaiting()); 53 | 54 | // Should be done waiting even if the google sequence failed. 55 | tune.firstRunLogic.onInstallReferrerResponseError(TuneFirstRunLogic.InstallReferrerResponse_GeneralException); 56 | assertFalse(tune.firstRunLogic.isWaiting()); 57 | } 58 | } -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/java/com/tune/TuneInterfaceTests.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | import android.support.test.runner.AndroidJUnit4; 4 | 5 | import junit.framework.Assert; 6 | 7 | import org.junit.After; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static android.support.test.InstrumentationRegistry.getContext; 12 | 13 | /** 14 | * Some Unit tests need to be run as if they only have access to the ITune interface, and not the 15 | * internals. This test suite does not inherit from TuneUnitTest and therefore does not set up 16 | * tune before tests run. It will however shut Tune down afterwards. 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class TuneInterfaceTests { 20 | @After 21 | public void tearDown() throws Exception { 22 | ITune tune = Tune.getInstance(); 23 | if (tune instanceof TuneInternal) { 24 | ((TuneInternal)tune).shutDown(); 25 | } 26 | } 27 | 28 | @Test 29 | public void testInitWithContext() { 30 | ITune tune = Tune.init(getContext(), TuneTestConstants.advertiserId, TuneTestConstants.conversionKey); 31 | Assert.assertNotNull(tune); 32 | Assert.assertNotNull(Tune.getInstance()); 33 | } 34 | 35 | @Test 36 | public void testInitWithoutContext() { 37 | ITune tune = Tune.init(null, TuneTestConstants.advertiserId, TuneTestConstants.conversionKey); 38 | Assert.assertNull(tune); 39 | Assert.assertNull(Tune.getInstance()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/java/com/tune/TuneNotInitializedTest.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | import android.support.test.runner.AndroidJUnit4; 4 | 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | 8 | import static org.junit.Assert.assertNull; 9 | 10 | /** 11 | * Created by audrey on 3/8/18. 12 | */ 13 | @RunWith(AndroidJUnit4.class) 14 | public class TuneNotInitializedTest { 15 | 16 | @Test 17 | public void testTuneIsNullWhenTuneNotInitialized() { 18 | assertNull(Tune.getInstance()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/java/com/tune/TuneTestConstants.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | public class TuneTestConstants { 4 | public static final String advertiserId = "877"; 5 | public static final String conversionKey = "8c14d6bbe466b65211e781d62e301eec"; 6 | public static final String appId = "com.tune.test"; 7 | 8 | public static final int PARAMTEST_SLEEP = 500; 9 | public static final int ENDPOINTTEST_SLEEP = 500; 10 | public static final int SERVERTEST_SLEEP = 5000; 11 | public static final int MESSAGETEST_SLEEP = 2000; 12 | 13 | public static final int ANALYTICS_DISPATCH_PERIOD = 5; 14 | public static final int PLAYLIST_REQUEST_PERIOD = 5; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/java/com/tune/TuneTestQueue.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | import android.content.Context; 4 | 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | public class TuneTestQueue extends TuneEventQueue { 9 | 10 | public TuneTestQueue(Context context, TuneInternal mat) { 11 | super(context, mat); 12 | } 13 | 14 | public synchronized int getQueueSize() { 15 | return super.getQueueSize(); 16 | } 17 | 18 | public synchronized void clearQueue() { 19 | super.clearQueue(); 20 | } 21 | 22 | public synchronized JSONObject getQueueItem( int index ) throws JSONException { 23 | String key = Integer.toString(index); 24 | String eventJson = getKeyFromQueue(key); 25 | return new JSONObject(eventJson); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/java/com/tune/UtilTests.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | import android.support.test.runner.AndroidJUnit4; 4 | 5 | import com.tune.utils.TuneUtils; 6 | 7 | import java.io.ByteArrayInputStream; 8 | import java.io.InputStream; 9 | 10 | import org.junit.Test; 11 | import org.junit.runner.RunWith; 12 | 13 | import static org.junit.Assert.assertEquals; 14 | 15 | @RunWith(AndroidJUnit4.class) 16 | public class UtilTests { 17 | 18 | private static final String TEST_TYPICAL = "The quick brown fox jumps over the lazy dog"; 19 | 20 | private static final String TEST_CRLF_A = "\nThe quick brown fox jumps over the lazy dog"; 21 | private static final String TEST_CRLF_B = "The quick brown fox\njumps over the lazy dog"; 22 | private static final String TEST_CRLF_C = "The quick brown fox jumps over the lazy dog\n"; 23 | 24 | private static final String TEST_EMPTY = ""; 25 | 26 | @Test 27 | public void testReadStream() throws Exception { 28 | // Test the typical case 29 | assertEquals(TEST_TYPICAL, TuneUtils.readStream(createInputStream(TEST_TYPICAL))); 30 | 31 | // Test CRLF in the front 32 | assertEquals(TEST_CRLF_A, TuneUtils.readStream(createInputStream(TEST_CRLF_A))); 33 | 34 | // Test CRLF in the middle 35 | assertEquals(TEST_CRLF_B, TuneUtils.readStream(createInputStream(TEST_CRLF_B))); 36 | 37 | // The Trailing CRLF is stripped, which is ok. 38 | assertEquals(TEST_TYPICAL, TuneUtils.readStream(createInputStream(TEST_CRLF_C))); 39 | 40 | // Empty Strings should remain empty 41 | assertEquals(TEST_EMPTY, TuneUtils.readStream(createInputStream(TEST_EMPTY))); 42 | } 43 | 44 | private InputStream createInputStream(String str) { 45 | return new ByteArrayInputStream(str.getBytes()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/java/com/tune/mocks/MockUrlRequester.java: -------------------------------------------------------------------------------- 1 | package com.tune.mocks; 2 | 3 | import com.tune.TuneConstants; 4 | import com.tune.TuneDeeplinkListener; 5 | import com.tune.http.UrlRequester; 6 | 7 | import org.json.JSONException; 8 | import org.json.JSONObject; 9 | 10 | /** 11 | * Created by gowie on 2/8/16. 12 | */ 13 | public class MockUrlRequester implements UrlRequester { 14 | 15 | private boolean requestUrlShouldSucceed; 16 | private JSONObject fakeResponse = new JSONObject(); 17 | 18 | public MockUrlRequester() { 19 | requestUrlShouldSucceed = true; 20 | } 21 | 22 | @Override 23 | public void requestDeeplink(String deeplinkURL, String conversionKey, TuneDeeplinkListener listener) { 24 | if (listener != null) { 25 | if (requestUrlShouldSucceed) { 26 | // Notify listener of deeplink url 27 | listener.didReceiveDeeplink("testing://allthethings?success=yes"); 28 | } else { 29 | // Notify listener of error 30 | listener.didFailDeeplink("Deeplink not found"); 31 | } 32 | } 33 | } 34 | 35 | @Override 36 | public JSONObject requestUrl(String url, JSONObject json, boolean debugMode) { 37 | JSONObject response = fakeResponse; 38 | 39 | try { 40 | if (requestUrlShouldSucceed) { 41 | response.put(TuneConstants.SERVER_RESPONSE_SUCCESS, true); 42 | } else { 43 | response.put("error", "error"); 44 | } 45 | } catch (JSONException e) { 46 | e.printStackTrace(); 47 | } 48 | 49 | return response; 50 | } 51 | 52 | public void setRequestUrlShouldSucceed(boolean requestUrlShouldSucceed) { 53 | this.requestUrlShouldSucceed = requestUrlShouldSucceed; 54 | } 55 | 56 | public void includeInFakeResponse(String key, String value) throws Exception { 57 | fakeResponse.put(key, value); 58 | } 59 | 60 | public void clearFakeResponse() { 61 | this.fakeResponse = new JSONObject(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/androidTest/java/com/tune/utils/TuneStringUtilsTests.java: -------------------------------------------------------------------------------- 1 | package com.tune.utils; 2 | 3 | import android.support.test.runner.AndroidJUnit4; 4 | 5 | import com.tune.TuneUnitTest; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | 12 | /** 13 | * Created by gowie on 1/26/16. 14 | */ 15 | @RunWith(AndroidJUnit4.class) 16 | public class TuneStringUtilsTests extends TuneUnitTest { 17 | 18 | @Test 19 | public void testScrubNameForMongoRemovesAllUnwantedCharacters() { 20 | assertEquals("NoChange", TuneStringUtils.scrubStringForMongo("NoChange")); 21 | assertEquals("__NoDollars__", TuneStringUtils.scrubStringForMongo("$$NoDollars$$")); 22 | assertEquals("__NoPeriods__", TuneStringUtils.scrubStringForMongo("..NoPeriods..")); 23 | assertEquals("NoTrailingWhitespace", TuneStringUtils.scrubStringForMongo(" NoTrailingWhitespace ")); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/ITuneListener.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | import org.json.JSONObject; 4 | 5 | /** 6 | * Interface class that can be implemented to look at TUNE request statuses. 7 | * This class is used exclusively for testing purposes. 8 | */ 9 | public interface ITuneListener { 10 | /** 11 | * Callback for when an event has been enqueued and is about to be sent out. 12 | * @param url Full URL of the request to be made. 13 | * @param postData Any JSON that should be sent as POST data. 14 | */ 15 | void enqueuedRequest(String url, JSONObject postData); 16 | 17 | /** 18 | * Callback for when an event has succeeded, with server response. 19 | * @param url Full URL of the request that was made. 20 | * @param data TUNE server response for a successful request. 21 | */ 22 | void didSucceedWithData(String url, JSONObject data); 23 | 24 | /** 25 | * Callback for when an event has failed, with server response. 26 | * @param url Full URL of the request that was made. 27 | * @param error TUNE server response for a failed request, with error data. 28 | */ 29 | void didFailWithError(String url, JSONObject error); 30 | } 31 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/TuneDeeplinkListener.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | /** 4 | * Tune Deeplink Listener interface. 5 | */ 6 | public interface TuneDeeplinkListener { 7 | void didReceiveDeeplink(String deeplink); 8 | 9 | void didFailDeeplink(String error); 10 | } 11 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/TuneGender.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | /** 4 | * Gender enum for user. 5 | * @deprecated data no longer transmitted. API will be removed in version 7.0.0 6 | */ 7 | @Deprecated 8 | public enum TuneGender { 9 | MALE, 10 | FEMALE, 11 | UNKNOWN; 12 | 13 | static final String MALE_STRING_VAL = "0"; 14 | static final String FEMALE_STRING_VAL = "1"; 15 | } -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/TuneTestRequest.java: -------------------------------------------------------------------------------- 1 | package com.tune; 2 | 3 | import org.json.JSONObject; 4 | 5 | public interface TuneTestRequest { 6 | public abstract void constructedRequest(String url, String data, JSONObject postBody); 7 | } 8 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/application/TuneActivityLifecycleCallbacks.java: -------------------------------------------------------------------------------- 1 | package com.tune.application; 2 | 3 | import android.app.Activity; 4 | import android.app.Application; 5 | import android.os.Bundle; 6 | 7 | /** 8 | * Created by johng on 12/22/15. 9 | */ 10 | public class TuneActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks { 11 | 12 | @Override 13 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) { 14 | // Not capturing onCreate 15 | } 16 | 17 | @Override 18 | public void onActivityStarted(Activity activity) { 19 | // Not capturing onStart 20 | } 21 | 22 | @Override 23 | public void onActivityResumed(Activity activity) { 24 | TuneActivity.onResume(activity); 25 | } 26 | 27 | @Override 28 | public void onActivityPaused(Activity activity) { 29 | TuneActivity.onPause(activity); 30 | } 31 | 32 | @Override 33 | public void onActivityStopped(Activity activity) { 34 | // Not capturing onStop 35 | } 36 | 37 | @Override 38 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) { 39 | // Not capturing onSaveInstanceState 40 | } 41 | 42 | @Override 43 | public void onActivityDestroyed(Activity activity) { 44 | // Not capturing onDestroy 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/application/TuneApplication.java: -------------------------------------------------------------------------------- 1 | package com.tune.application; 2 | 3 | import android.app.Application; 4 | 5 | public class TuneApplication extends Application { 6 | @Override 7 | public void onCreate() { 8 | super.onCreate(); 9 | 10 | registerActivityLifecycleCallbacks(new TuneActivityLifecycleCallbacks()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/http/UrlRequester.java: -------------------------------------------------------------------------------- 1 | package com.tune.http; 2 | 3 | import com.tune.TuneDeeplinkListener; 4 | 5 | import org.json.JSONObject; 6 | 7 | /** 8 | * Created by gowie on 2/8/16. 9 | */ 10 | public interface UrlRequester { 11 | 12 | void requestDeeplink(String deeplinkURL, String conversionKey, TuneDeeplinkListener listener); 13 | 14 | JSONObject requestUrl(String url, JSONObject json, boolean debugMode); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The TUNE SDK for the native Android™ platform provides application session and event logging 3 | * functionality. Our SDK is compatible with all Android devices running Android API 14 and above. 4 | * 5 | * @see TUNE Android Quick Start 6 | */ 7 | package com.tune; 8 | -------------------------------------------------------------------------------- /sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/utils/TuneStringUtils.java: -------------------------------------------------------------------------------- 1 | package com.tune.utils; 2 | 3 | import android.net.Uri; 4 | 5 | import java.util.Collections; 6 | import java.util.LinkedHashSet; 7 | import java.util.Locale; 8 | import java.util.Set; 9 | 10 | /** 11 | * Created by gowie on 1/26/16. 12 | */ 13 | public class TuneStringUtils { 14 | 15 | /** 16 | * Creates a new trimmed string by replacing each Mongo-unsupported character with an underscore. 17 | * e.g. '.', '$' 18 | * 19 | * @param input string to be cleaned up 20 | * @return a new string object that is valid in Mongo 21 | */ 22 | public static String scrubStringForMongo(String input) { 23 | String trimmed = input.trim(); 24 | String noPeriods = trimmed.replaceAll("\\.", "_"); 25 | String noDollars = noPeriods.replaceAll("\\$", "_"); 26 | return noDollars; 27 | } 28 | 29 | public static String format(String format, Object... args) { 30 | return String.format(Locale.US, format, args); 31 | } 32 | 33 | /** 34 | * Check to see if a String is Null or Empty 35 | * @param str String to test 36 | * @return true if the string is null or empty. 37 | */ 38 | public static boolean isNullOrEmpty(String str) { 39 | return (str == null || str.length() == 0); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk-android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.1.2' 9 | classpath 'com.google.gms:google-services:3.1.0' 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | mavenCentral() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sdk-android/config/android-checkstyle.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'checkstyle' 2 | check.dependsOn 'checkstyle' 3 | 4 | checkstyle { 5 | toolVersion = '8.8' 6 | } 7 | 8 | task checkstyle(type: Checkstyle) { 9 | description = "Check Java style with Checkstyle" 10 | configFile = rootProject.file("config/checkstyle/tune_checks.xml") 11 | source = javaSources() 12 | classpath = files() 13 | ignoreFailures = true 14 | } 15 | 16 | def javaSources() { 17 | def files = [] 18 | android.sourceSets.each { sourceSet -> 19 | sourceSet.java.each { javaSource -> 20 | javaSource.getSrcDirs().each { 21 | if (it.exists()) { 22 | files.add(it) 23 | } 24 | } 25 | } 26 | } 27 | return files 28 | } 29 | -------------------------------------------------------------------------------- /sdk-android/config/checkstyle/README: -------------------------------------------------------------------------------- 1 | Original Google Checkstyle template found here: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml 2 | 3 | Modifications for Tune: 4 | 1. `max` Extended the max line length from 100 to 160 characters 5 | 2. `basicOffset` Indentation (spaces) from 2 to 4 6 | 3. `arrayInitIndent` Array Indentation from 2 to 4 (to match Basic Offset) 7 | 4. `allowedAbbreviationLength` Allowed Abbreviation Length from 1 to 3 (which is really 2 to 4) 8 | -------------------------------------------------------------------------------- /sdk-android/dist/TuneMarketingConsoleSDK-5.3.0.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-android/dist/TuneMarketingConsoleSDK-5.3.0.aar -------------------------------------------------------------------------------- /sdk-android/dist/TuneMarketingConsoleSDK-6.1.1.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-android/dist/TuneMarketingConsoleSDK-6.1.1.aar -------------------------------------------------------------------------------- /sdk-android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /sdk-android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon May 21 10:01:09 PDT 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /sdk-android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':TuneMarketingConsoleSDK' 2 | -------------------------------------------------------------------------------- /sdk-ios/Tune/.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | *.xcworkspace 12 | !default.xcworkspace 13 | xcuserdata 14 | profile 15 | *.moved-aside 16 | Resources/Configuration/Private.xcconfig 17 | 18 | # OS X 19 | .DS_Store 20 | .pid_file 21 | .sass-cache 22 | 23 | #appledoc 24 | docs/docset-installed.txt 25 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCObserverMockObject; 20 | 21 | 22 | @interface NSNotificationCenter(OCMAdditions) 23 | 24 | - (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Headers/OCMArg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMArg : NSObject 20 | 21 | // constraining arguments 22 | 23 | + (id)any; 24 | + (SEL)anySelector; 25 | + (void *)anyPointer; 26 | + (id __autoreleasing *)anyObjectRef; 27 | + (id)isNil; 28 | + (id)isNotNil; 29 | + (id)isEqual:(id)value; 30 | + (id)isNotEqual:(id)value; 31 | + (id)isKindOfClass:(Class)cls; 32 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 33 | + (id)checkWithBlock:(BOOL (^)(id obj))block; 34 | 35 | // manipulating arguments 36 | 37 | + (id *)setTo:(id)value; 38 | + (void *)setToValue:(NSValue *)value; 39 | + (id)invokeBlock; 40 | + (id)invokeBlockWithArgs:(id)first,... NS_REQUIRES_NIL_TERMINATION; 41 | 42 | + (id)defaultValue; 43 | 44 | // internal use only 45 | 46 | + (id)resolveSpecialValues:(NSValue *)value; 47 | 48 | @end 49 | 50 | #define OCMOCK_ANY [OCMArg any] 51 | 52 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 53 | #define OCMOCK_VALUE(variable) \ 54 | ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) 55 | #else 56 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Headers/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @interface OCMConstraint : NSObject 21 | 22 | + (instancetype)constraint; 23 | - (BOOL)evaluate:(id)value; 24 | 25 | // if you are looking for any, isNil, etc, they have moved to OCMArg 26 | 27 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 28 | 29 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 30 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 31 | 32 | 33 | @end 34 | 35 | @interface OCMAnyConstraint : OCMConstraint 36 | @end 37 | 38 | @interface OCMIsNilConstraint : OCMConstraint 39 | @end 40 | 41 | @interface OCMIsNotNilConstraint : OCMConstraint 42 | @end 43 | 44 | @interface OCMIsNotEqualConstraint : OCMConstraint 45 | { 46 | @public 47 | id testValue; 48 | } 49 | 50 | @end 51 | 52 | @interface OCMInvocationConstraint : OCMConstraint 53 | { 54 | @public 55 | NSInvocation *invocation; 56 | } 57 | 58 | @end 59 | 60 | @interface OCMBlockConstraint : OCMConstraint 61 | { 62 | BOOL (^block)(id); 63 | } 64 | 65 | - (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; 66 | 67 | @end 68 | 69 | 70 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 71 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 72 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Headers/OCMFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | #if defined(__cplusplus) 21 | #define OCMOCK_EXTERN extern "C" 22 | #else 23 | #define OCMOCK_EXTERN extern 24 | #endif 25 | 26 | 27 | OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Headers/OCMLocation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCMFunctions.h" 19 | 20 | 21 | @interface OCMLocation : NSObject 22 | { 23 | id testCase; 24 | NSString *file; 25 | NSUInteger line; 26 | } 27 | 28 | + (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 29 | 30 | - (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 31 | 32 | - (id)testCase; 33 | - (NSString *)file; 34 | - (NSUInteger)line; 35 | 36 | @end 37 | 38 | OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); 39 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Headers/OCMMacroState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMRecorder; 21 | @class OCMStubRecorder; 22 | @class OCMockObject; 23 | 24 | 25 | @interface OCMMacroState : NSObject 26 | { 27 | OCMRecorder *recorder; 28 | } 29 | 30 | + (void)beginStubMacro; 31 | + (OCMStubRecorder *)endStubMacro; 32 | 33 | + (void)beginExpectMacro; 34 | + (OCMStubRecorder *)endExpectMacro; 35 | 36 | + (void)beginRejectMacro; 37 | + (OCMStubRecorder *)endRejectMacro; 38 | 39 | + (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; 40 | + (void)endVerifyMacro; 41 | 42 | + (OCMMacroState *)globalState; 43 | 44 | - (OCMRecorder *)recorder; 45 | 46 | - (void)switchToClassMethod; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Headers/OCMRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMockObject; 20 | @class OCMInvocationMatcher; 21 | 22 | 23 | @interface OCMRecorder : NSProxy 24 | { 25 | OCMockObject *mockObject; 26 | OCMInvocationMatcher *invocationMatcher; 27 | } 28 | 29 | - (instancetype)init; 30 | - (instancetype)initWithMockObject:(OCMockObject *)aMockObject; 31 | 32 | - (void)setMockObject:(OCMockObject *)aMockObject; 33 | 34 | - (OCMInvocationMatcher *)invocationMatcher; 35 | 36 | - (id)classMethod; 37 | - (id)ignoringNonObjectArgs; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Info.plist -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module OCMock { 2 | umbrella header "OCMock.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/OCMock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-ios/Tune/OCMock/iOS framework/OCMock.framework/OCMock -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/OCMock/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCObserverMockObject; 20 | 21 | 22 | @interface NSNotificationCenter(OCMAdditions) 23 | 24 | - (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/OCMock/OCMArg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMArg : NSObject 20 | 21 | // constraining arguments 22 | 23 | + (id)any; 24 | + (SEL)anySelector; 25 | + (void *)anyPointer; 26 | + (id __autoreleasing *)anyObjectRef; 27 | + (id)isNil; 28 | + (id)isNotNil; 29 | + (id)isEqual:(id)value; 30 | + (id)isNotEqual:(id)value; 31 | + (id)isKindOfClass:(Class)cls; 32 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 33 | + (id)checkWithBlock:(BOOL (^)(id obj))block; 34 | 35 | // manipulating arguments 36 | 37 | + (id *)setTo:(id)value; 38 | + (void *)setToValue:(NSValue *)value; 39 | + (id)invokeBlock; 40 | + (id)invokeBlockWithArgs:(id)first,... NS_REQUIRES_NIL_TERMINATION; 41 | 42 | + (id)defaultValue; 43 | 44 | // internal use only 45 | 46 | + (id)resolveSpecialValues:(NSValue *)value; 47 | 48 | @end 49 | 50 | #define OCMOCK_ANY [OCMArg any] 51 | 52 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 53 | #define OCMOCK_VALUE(variable) \ 54 | ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) 55 | #else 56 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/OCMock/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @interface OCMConstraint : NSObject 21 | 22 | + (instancetype)constraint; 23 | - (BOOL)evaluate:(id)value; 24 | 25 | // if you are looking for any, isNil, etc, they have moved to OCMArg 26 | 27 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 28 | 29 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 30 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 31 | 32 | 33 | @end 34 | 35 | @interface OCMAnyConstraint : OCMConstraint 36 | @end 37 | 38 | @interface OCMIsNilConstraint : OCMConstraint 39 | @end 40 | 41 | @interface OCMIsNotNilConstraint : OCMConstraint 42 | @end 43 | 44 | @interface OCMIsNotEqualConstraint : OCMConstraint 45 | { 46 | @public 47 | id testValue; 48 | } 49 | 50 | @end 51 | 52 | @interface OCMInvocationConstraint : OCMConstraint 53 | { 54 | @public 55 | NSInvocation *invocation; 56 | } 57 | 58 | @end 59 | 60 | @interface OCMBlockConstraint : OCMConstraint 61 | { 62 | BOOL (^block)(id); 63 | } 64 | 65 | - (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; 66 | 67 | @end 68 | 69 | 70 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 71 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 72 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/OCMock/OCMFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | #if defined(__cplusplus) 21 | #define OCMOCK_EXTERN extern "C" 22 | #else 23 | #define OCMOCK_EXTERN extern 24 | #endif 25 | 26 | 27 | OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/OCMock/OCMLocation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCMFunctions.h" 19 | 20 | 21 | @interface OCMLocation : NSObject 22 | { 23 | id testCase; 24 | NSString *file; 25 | NSUInteger line; 26 | } 27 | 28 | + (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 29 | 30 | - (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 31 | 32 | - (id)testCase; 33 | - (NSString *)file; 34 | - (NSUInteger)line; 35 | 36 | @end 37 | 38 | OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); 39 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/OCMock/OCMMacroState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMRecorder; 21 | @class OCMStubRecorder; 22 | @class OCMockObject; 23 | 24 | 25 | @interface OCMMacroState : NSObject 26 | { 27 | OCMRecorder *recorder; 28 | } 29 | 30 | + (void)beginStubMacro; 31 | + (OCMStubRecorder *)endStubMacro; 32 | 33 | + (void)beginExpectMacro; 34 | + (OCMStubRecorder *)endExpectMacro; 35 | 36 | + (void)beginRejectMacro; 37 | + (OCMStubRecorder *)endRejectMacro; 38 | 39 | + (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; 40 | + (void)endVerifyMacro; 41 | 42 | + (OCMMacroState *)globalState; 43 | 44 | - (OCMRecorder *)recorder; 45 | 46 | - (void)switchToClassMethod; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/OCMock/OCMRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMockObject; 20 | @class OCMInvocationMatcher; 21 | 22 | 23 | @interface OCMRecorder : NSProxy 24 | { 25 | OCMockObject *mockObject; 26 | OCMInvocationMatcher *invocationMatcher; 27 | } 28 | 29 | - (instancetype)init; 30 | - (instancetype)initWithMockObject:(OCMockObject *)aMockObject; 31 | 32 | - (void)setMockObject:(OCMockObject *)aMockObject; 33 | 34 | - (OCMInvocationMatcher *)invocationMatcher; 35 | 36 | - (id)classMethod; 37 | - (id)ignoringNonObjectArgs; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/OCMock/OCMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMInvocationStub; 21 | @class OCMStubRecorder; 22 | @class OCMInvocationMatcher; 23 | @class OCMInvocationExpectation; 24 | 25 | 26 | @interface OCMockObject : NSProxy 27 | { 28 | BOOL isNice; 29 | BOOL expectationOrderMatters; 30 | NSMutableArray *stubs; 31 | NSMutableArray *expectations; 32 | NSMutableArray *exceptions; 33 | NSMutableArray *invocations; 34 | } 35 | 36 | + (id)mockForClass:(Class)aClass; 37 | + (id)mockForProtocol:(Protocol *)aProtocol; 38 | + (id)partialMockForObject:(NSObject *)anObject; 39 | 40 | + (id)niceMockForClass:(Class)aClass; 41 | + (id)niceMockForProtocol:(Protocol *)aProtocol; 42 | 43 | + (id)observerMock; 44 | 45 | - (instancetype)init; 46 | 47 | - (void)setExpectationOrderMatters:(BOOL)flag; 48 | 49 | - (id)stub; 50 | - (id)expect; 51 | - (id)reject; 52 | 53 | - (id)verify; 54 | - (id)verifyAtLocation:(OCMLocation *)location; 55 | 56 | - (void)verifyWithDelay:(NSTimeInterval)delay; 57 | - (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; 58 | 59 | - (void)stopMocking; 60 | 61 | // internal use only 62 | 63 | - (void)addStub:(OCMInvocationStub *)aStub; 64 | - (void)addExpectation:(OCMInvocationExpectation *)anExpectation; 65 | 66 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 67 | - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; 68 | - (BOOL)handleSelector:(SEL)sel; 69 | 70 | - (void)verifyInvocation:(OCMInvocationMatcher *)matcher; 71 | - (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; 72 | 73 | @end 74 | 75 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/iOS library/libOCMock.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-ios/Tune/OCMock/iOS library/libOCMock.a -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCObserverMockObject; 20 | 21 | 22 | @interface NSNotificationCenter(OCMAdditions) 23 | 24 | - (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Headers/OCMArg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMArg : NSObject 20 | 21 | // constraining arguments 22 | 23 | + (id)any; 24 | + (SEL)anySelector; 25 | + (void *)anyPointer; 26 | + (id __autoreleasing *)anyObjectRef; 27 | + (id)isNil; 28 | + (id)isNotNil; 29 | + (id)isEqual:(id)value; 30 | + (id)isNotEqual:(id)value; 31 | + (id)isKindOfClass:(Class)cls; 32 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 33 | + (id)checkWithBlock:(BOOL (^)(id obj))block; 34 | 35 | // manipulating arguments 36 | 37 | + (id *)setTo:(id)value; 38 | + (void *)setToValue:(NSValue *)value; 39 | + (id)invokeBlock; 40 | + (id)invokeBlockWithArgs:(id)first,... NS_REQUIRES_NIL_TERMINATION; 41 | 42 | + (id)defaultValue; 43 | 44 | // internal use only 45 | 46 | + (id)resolveSpecialValues:(NSValue *)value; 47 | 48 | @end 49 | 50 | #define OCMOCK_ANY [OCMArg any] 51 | 52 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 53 | #define OCMOCK_VALUE(variable) \ 54 | ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) 55 | #else 56 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Headers/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @interface OCMConstraint : NSObject 21 | 22 | + (instancetype)constraint; 23 | - (BOOL)evaluate:(id)value; 24 | 25 | // if you are looking for any, isNil, etc, they have moved to OCMArg 26 | 27 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 28 | 29 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 30 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 31 | 32 | 33 | @end 34 | 35 | @interface OCMAnyConstraint : OCMConstraint 36 | @end 37 | 38 | @interface OCMIsNilConstraint : OCMConstraint 39 | @end 40 | 41 | @interface OCMIsNotNilConstraint : OCMConstraint 42 | @end 43 | 44 | @interface OCMIsNotEqualConstraint : OCMConstraint 45 | { 46 | @public 47 | id testValue; 48 | } 49 | 50 | @end 51 | 52 | @interface OCMInvocationConstraint : OCMConstraint 53 | { 54 | @public 55 | NSInvocation *invocation; 56 | } 57 | 58 | @end 59 | 60 | @interface OCMBlockConstraint : OCMConstraint 61 | { 62 | BOOL (^block)(id); 63 | } 64 | 65 | - (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; 66 | 67 | @end 68 | 69 | 70 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 71 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 72 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Headers/OCMFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | #if defined(__cplusplus) 21 | #define OCMOCK_EXTERN extern "C" 22 | #else 23 | #define OCMOCK_EXTERN extern 24 | #endif 25 | 26 | 27 | OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Headers/OCMLocation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCMFunctions.h" 19 | 20 | 21 | @interface OCMLocation : NSObject 22 | { 23 | id testCase; 24 | NSString *file; 25 | NSUInteger line; 26 | } 27 | 28 | + (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 29 | 30 | - (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 31 | 32 | - (id)testCase; 33 | - (NSString *)file; 34 | - (NSUInteger)line; 35 | 36 | @end 37 | 38 | OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); 39 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Headers/OCMMacroState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMRecorder; 21 | @class OCMStubRecorder; 22 | @class OCMockObject; 23 | 24 | 25 | @interface OCMMacroState : NSObject 26 | { 27 | OCMRecorder *recorder; 28 | } 29 | 30 | + (void)beginStubMacro; 31 | + (OCMStubRecorder *)endStubMacro; 32 | 33 | + (void)beginExpectMacro; 34 | + (OCMStubRecorder *)endExpectMacro; 35 | 36 | + (void)beginRejectMacro; 37 | + (OCMStubRecorder *)endRejectMacro; 38 | 39 | + (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; 40 | + (void)endVerifyMacro; 41 | 42 | + (OCMMacroState *)globalState; 43 | 44 | - (OCMRecorder *)recorder; 45 | 46 | - (void)switchToClassMethod; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Headers/OCMRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMockObject; 20 | @class OCMInvocationMatcher; 21 | 22 | 23 | @interface OCMRecorder : NSProxy 24 | { 25 | OCMockObject *mockObject; 26 | OCMInvocationMatcher *invocationMatcher; 27 | } 28 | 29 | - (instancetype)init; 30 | - (instancetype)initWithMockObject:(OCMockObject *)aMockObject; 31 | 32 | - (void)setMockObject:(OCMockObject *)aMockObject; 33 | 34 | - (OCMInvocationMatcher *)invocationMatcher; 35 | 36 | - (id)classMethod; 37 | - (id)ignoringNonObjectArgs; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Info.plist -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module OCMock { 2 | umbrella header "OCMock.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /sdk-ios/Tune/OCMock/tvOS/OCMock.framework/OCMock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-ios/Tune/OCMock/tvOS/OCMock.framework/OCMock -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/NSData+TuneGZIP.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+ArtisanGZIP.h 3 | // 4 | // Version 1.0 5 | // 6 | // Created by Nick Lockwood on 03/06/2012. 7 | // Copyright (C) 2012 Charcoal Design 8 | // 9 | // Distributed under the permissive zlib License 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/nicklockwood/Gzip 13 | // 14 | // This software is provided 'as-is', without any express or implied 15 | // warranty. In no event will the authors be held liable for any damages 16 | // arising from the use of this software. 17 | // 18 | // Permission is granted to anyone to use this software for any purpose, 19 | // including commercial applications, and to alter it and redistribute it 20 | // freely, subject to the following restrictions: 21 | // 22 | // 1. The origin of this software must not be misrepresented; you must not 23 | // claim that you wrote the original software. If you use this software 24 | // in a product, an acknowledgment in the product documentation would be 25 | // appreciated but is not required. 26 | // 27 | // 2. Altered source versions must be plainly marked as such, and must not be 28 | // misrepresented as being the original software. 29 | // 30 | // 3. This notice may not be removed or altered from any source distribution. 31 | // 32 | 33 | 34 | #import 35 | 36 | 37 | @interface NSData (TuneGZIP) 38 | 39 | - (NSData *)tuneGzippedDataWithCompressionLevel:(float)level; 40 | - (NSData *)tuneGzippedData; 41 | - (NSData *)tuneGunzippedData; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/NSURLSession+Logging.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLSession+Logging.h 3 | // Tune 4 | // 5 | // Created by Ernest Cho on 12/8/17. 6 | // Copyright © 2017 tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSURLSession (Logging) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/Tune+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tune+Internal.h 3 | // Tune 4 | // 5 | // Created by Tune on 03/20/14. 6 | // Copyright (c) 2013 Tune. All rights reserved. 7 | // 8 | 9 | #import "Tune.h" 10 | 11 | @class TuneTracker; 12 | 13 | @interface Tune () 14 | 15 | + (NSOperationQueue *)tuneQueue; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/Tune.modulemap: -------------------------------------------------------------------------------- 1 | framework module Tune { 2 | umbrella header "Tune.h" 3 | exclude header "UIViewController+NameTag.h" 4 | 5 | export * 6 | module * { export * } 7 | } 8 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneAnalyticsConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneAnalyticsConstants.h 3 | // MobileAppTracker 4 | // 5 | // Created by Charles Gilliam on 7/28/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneAnalyticsConstants : NSObject 12 | 13 | #pragma mark - Data Types 14 | FOUNDATION_EXPORT NSString *const TUNE_DATA_TYPE_STRING; 15 | FOUNDATION_EXPORT NSString *const TUNE_DATA_TYPE_DATETIME; 16 | FOUNDATION_EXPORT NSString *const TUNE_DATA_TYPE_BOOLEAN; 17 | FOUNDATION_EXPORT NSString *const TUNE_DATA_TYPE_FLOAT; 18 | FOUNDATION_EXPORT NSString *const TUNE_DATA_TYPE_GEOLOCATION; 19 | FOUNDATION_EXPORT NSString *const TUNE_DATA_TYPE_VERSION; 20 | 21 | #pragma mark - Hash Types 22 | FOUNDATION_EXPORT NSString *const TUNE_HASH_TYPE_NONE; 23 | FOUNDATION_EXPORT NSString *const TUNE_HASH_TYPE_SHA256; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneAnalyticsConstants.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneAnalyticsConstants.m 3 | // MobileAppTracker 4 | // 5 | // Created by Charles Gilliam on 7/28/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneAnalyticsConstants.h" 10 | 11 | @implementation TuneAnalyticsConstants 12 | 13 | #pragma mark - Data Types 14 | NSString *const TUNE_DATA_TYPE_STRING = @"string"; 15 | NSString *const TUNE_DATA_TYPE_DATETIME = @"datetime"; 16 | NSString *const TUNE_DATA_TYPE_BOOLEAN = @"boolean"; 17 | NSString *const TUNE_DATA_TYPE_FLOAT = @"float"; 18 | NSString *const TUNE_DATA_TYPE_GEOLOCATION = @"geolocation"; 19 | NSString *const TUNE_DATA_TYPE_VERSION = @"version"; 20 | 21 | #pragma mark - Hash Types 22 | NSString *const TUNE_HASH_TYPE_NONE = @"none"; 23 | NSString *const TUNE_HASH_TYPE_SHA256 = @"sha256"; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneConfiguration.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneConfiguration.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Copyright (c) 2015 Tune. All rights reserved. 6 | // 7 | 8 | 9 | #import 10 | 11 | @interface TuneConfiguration : NSObject 12 | 13 | + (TuneConfiguration *)sharedConfiguration; 14 | 15 | @property (nonatomic, assign) BOOL collectDeviceLocation; 16 | @property (nonatomic, assign) BOOL checkForJailbreak; 17 | 18 | @property (nonatomic, copy) NSNumber *analyticsDispatchPeriod; 19 | @property (nonatomic, copy) NSNumber *analyticsMessageStorageLimit; 20 | 21 | @property (nonatomic, copy) NSString *pluginName; 22 | 23 | + (NSString *)frameworkVersion; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneConfiguration.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneConfiguration.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Daniel Koch on 8/3/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneConfiguration.h" 10 | #import "Tune.h" 11 | 12 | @implementation TuneConfiguration 13 | 14 | + (TuneConfiguration *)sharedConfiguration { 15 | static TuneConfiguration *config; 16 | static dispatch_once_t onceToken; 17 | dispatch_once(&onceToken, ^{ 18 | config = [TuneConfiguration new]; 19 | }); 20 | return config; 21 | } 22 | 23 | - (instancetype)init { 24 | self = [super init]; 25 | if (self) { 26 | [self setDefaultConfiguration]; 27 | } 28 | return self; 29 | } 30 | 31 | + (NSString *)frameworkVersion { 32 | return TUNEVERSION; 33 | } 34 | 35 | - (void)setDefaultConfiguration { 36 | self.collectDeviceLocation = NO; 37 | 38 | self.analyticsMessageStorageLimit = @(250); 39 | self.pluginName = nil; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneConstants.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 12/2/15. 6 | // Copyright © 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef TuneConstants_h 12 | #define TuneConstants_h 13 | 14 | #pragma mark - enumerated types 15 | 16 | /** Error codes. */ 17 | typedef NS_ENUM(NSInteger, TuneErrorCode) 18 | { 19 | /** 20 | Error code when no advertiser ID is provided. 21 | */ 22 | TuneNoAdvertiserIDProvided = 1101, 23 | /** 24 | Error code when no conversion key is provided. 25 | */ 26 | TuneNoConversionKeyProvided = 1102, 27 | /** 28 | Error code when an invalid conversion key is provided. 29 | */ 30 | TuneInvalidConversionKey = 1103, 31 | /** 32 | Error code when an event request has failed. 33 | */ 34 | TuneServerErrorResponse = 1111, 35 | /** 36 | Error code when an event's name is empty, or when attempting to measure a "close" event. 37 | */ 38 | TuneInvalidEvent = 1131, 39 | /** 40 | Error code when an invalid Advertiser Id or Tune Conversion Key is used. 41 | */ 42 | TuneMeasurementWithoutInitializing = 1132, 43 | /** 44 | Error code when there are duplicate "session" event measurements calls in the same session. 45 | */ 46 | TuneInvalidDuplicateSession = 1133 47 | }; 48 | 49 | /** Gender type constants. */ 50 | typedef NS_ENUM(NSInteger, TuneGender) 51 | { 52 | /** 53 | Gender type MALE. Equals 0. 54 | */ 55 | TuneGenderMale = 0, 56 | /** 57 | Gender type FEMALE. Equals 1. 58 | */ 59 | TuneGenderFemale = 1, 60 | /** 61 | Gender type UNKNOWN. Equals 2. 62 | */ 63 | TuneGenderUnknown = 2 64 | }; 65 | 66 | 67 | #endif /* TuneConstants_h */ 68 | 69 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneConstants.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneConstants.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Will Beebe on 4/18/16. 6 | // Copyright © 2016 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneConstants.h" 10 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneDateUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDateUtils.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 7/28/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneDateUtils : NSObject 12 | 13 | /** 14 | Date formatter using format "yyyy-MM-dd'T'HH:mm:ss+00:00'", UTC timezone and locale "en_US_POSIX". 15 | */ 16 | + (NSDateFormatter *)dateFormatterIso8601; 17 | 18 | /** 19 | Date formatter using format "yyyy-MM-dd'T'HH:mm:ss'Z'", UTC timezone and locale "en_US_POSIX". 20 | */ 21 | + (NSDateFormatter *)dateFormatterIso8601UTC; 22 | 23 | + (BOOL)date:(NSDate *)date isBetweenDate:(NSDate *)beginDate andEndDate:(NSDate *)endDate; 24 | 25 | + (int)daysBetween:(NSDate *)beginDate and:(NSDate *)endDate; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneDateUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDateUtils.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 7/28/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneDateUtils.h" 10 | 11 | // Consider converting this to an NSDate category 12 | @implementation TuneDateUtils 13 | 14 | + (NSDateFormatter *)dateFormatterIso8601 { 15 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; 16 | [dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]]; 17 | [dateFormatter setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]]; 18 | [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss+00:00"]; 19 | return dateFormatter; 20 | } 21 | 22 | + (NSDateFormatter *)dateFormatterIso8601UTC { 23 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; 24 | [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]]; 25 | [dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]]; 26 | [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss'Z'"]; 27 | 28 | return dateFormatter; 29 | } 30 | 31 | + (BOOL)date:(NSDate *)date isBetweenDate:(NSDate *)beginDate andEndDate:(NSDate *)endDate { 32 | return [date compare:beginDate] != NSOrderedAscending && [date compare:endDate] != NSOrderedDescending; 33 | } 34 | 35 | + (int)daysBetween:(NSDate *)beginDate and:(NSDate *)endDate { 36 | NSUInteger unitFlags = NSCalendarUnitDay; 37 | NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; 38 | NSDateComponents *components = [calendar components:unitFlags fromDate:beginDate toDate:endDate options:0]; 39 | return (int)[components day]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneDeeplink.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDeeplink.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by John Gu on 9/15/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneDeeplink : NSObject 12 | 13 | @property (strong, nonatomic) NSURL *url; 14 | 15 | - (id)initWithNSURL:(NSURL *)url; 16 | + (void)processDeeplinkURL:(NSURL *)url; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneDeeplink.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDeeplink.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by John Gu on 9/15/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneDeeplink.h" 10 | #import "TuneManager.h" 11 | #import "TuneSkyhookCenter.h" 12 | #import "TuneSkyhookConstants.h" 13 | #import "TuneSkyhookPayloadConstants.h" 14 | #import "TuneUserProfile.h" 15 | 16 | @implementation TuneDeeplink 17 | 18 | 19 | - (id)initWithNSURL:(NSURL *)url { 20 | self = [super init]; 21 | if(self) { 22 | self.url = url; 23 | } 24 | return self; 25 | } 26 | 27 | #pragma mark - Skyhooks 28 | 29 | - (void)processAnalytics { 30 | // report on app open 31 | [[TuneSkyhookCenter defaultCenter] postQueuedSkyhook:TuneAppOpenedFromURL object:nil userInfo:@{TunePayloadDeeplink:self}]; 32 | } 33 | 34 | #pragma mark - Static processing of deep links 35 | 36 | + (void)processDeeplinkURL:(NSURL *)url { 37 | TuneDeeplink *deeplink = [[TuneDeeplink alloc] initWithNSURL:url]; 38 | 39 | [deeplink processAnalytics]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneDeviceDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDeviceDetails.h 3 | // In-App Messaging Test App 4 | // 5 | // Created by Scott Wasserman on 7/17/14. 6 | // Copyright (c) 2014 Tune Mobile. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // Consider removing this class entirely, it's lost most of it's methods with IAM removal. 12 | // The remaining methods are fairly trivial. 13 | @interface TuneDeviceDetails : NSObject 14 | 15 | #if !TARGET_OS_WATCH 16 | + (BOOL)appIsRunningIniOS9OrAfter; 17 | + (BOOL)appIsRunningIniOS10OrAfter; 18 | + (BOOL)appIsRunningIniOSVersionOrAfter:(CGFloat)version; 19 | #endif 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneDeviceDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDeviceDetails.m 3 | // In-App Messaging Test App 4 | // 5 | // Created by Scott Wasserman on 7/17/14. 6 | // Copyright (c) 2014 Tune Mobile. All rights reserved. 7 | // 8 | 9 | #import "TuneDeviceDetails.h" 10 | #import "TuneUtils.h" 11 | 12 | @implementation TuneDeviceDetails 13 | 14 | #if !TARGET_OS_WATCH 15 | + (BOOL)appIsRunningIniOS9OrAfter { 16 | return [self appIsRunningIniOSVersionOrAfter:9.0]; 17 | } 18 | 19 | + (BOOL)appIsRunningIniOS10OrAfter { 20 | return [self appIsRunningIniOSVersionOrAfter:10.0]; 21 | } 22 | 23 | + (BOOL)appIsRunningIniOSVersionOrAfter:(CGFloat)version { 24 | return [[UIDevice currentDevice].systemVersion floatValue] >= version; 25 | } 26 | #endif 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneDeviceUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDeviceUtils.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 8/19/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneDeviceUtils : NSObject 12 | 13 | /** Returns the string interface idiom. */ 14 | + (NSString *)artisanInterfaceIdiomString; 15 | 16 | + (BOOL)currentDeviceIsTestFlight; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneDeviceUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDeviceUtils.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 8/19/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneDeviceUtils.h" 10 | #import "TuneUtils.h" 11 | 12 | #include 13 | 14 | @implementation TuneDeviceUtils 15 | 16 | #if !TARGET_OS_WATCH 17 | + (NSString *)artisanInterfaceIdiomString { 18 | switch (UI_USER_INTERFACE_IDIOM()) { 19 | case UIUserInterfaceIdiomPad: 20 | return @"iPad"; 21 | break; 22 | case UIUserInterfaceIdiomPhone: 23 | return @"iPhone"; 24 | break; 25 | case UIUserInterfaceIdiomUnspecified: 26 | return @"iPhone"; 27 | break; 28 | default: 29 | return @"iPhone"; 30 | } 31 | } 32 | #endif 33 | 34 | + (BOOL)currentDeviceIsTestFlight { 35 | BOOL hasEmbeddedMobileProvision = [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"] != nil; 36 | BOOL isSandboxReceipt = [[[[NSBundle mainBundle] appStoreReceiptURL] lastPathComponent] isEqualToString:@"sandboxReceipt"]; 37 | BOOL isTestFlight = isSandboxReceipt && !hasEmbeddedMobileProvision; 38 | 39 | return isTestFlight; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneEncrypter.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneEncrypter.h 3 | // TuneEncrypter 4 | // 5 | // Created by Tune on 1/23/12. 6 | // Copyright (c) 2012 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | /*! 14 | An Encryptor Class that provides string encryption methods and is used by 15 | Tune. 16 | */ 17 | 18 | @interface TuneEncrypter : NSObject 19 | 20 | /*! 21 | Encrypts the input string using the specified key. 22 | @param str The string to be encrypted. 23 | @param key The key used to encrypt the string. 24 | */ 25 | + (NSString *)encryptString:(NSString *)str withKey:(NSString *)key; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneEvent+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneEvent+Internal.h 3 | // Tune 4 | // 5 | // Created by Harshal Ogale on 5/5/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneEvent.h" 10 | 11 | @class TuneLocation; 12 | 13 | @interface TuneEvent () 14 | 15 | @property(nonatomic, copy) NSString *eventName; 16 | 17 | @property(nonatomic, copy, readonly) NSString *actionName; 18 | @property(nonatomic, copy) NSString *iBeaconRegionId; // KEY_GEOFENCE_NAME 19 | @property(nonatomic, strong) TuneLocation *location; 20 | @property(nonatomic, assign) BOOL postConversion; // KEY_POST_CONVERSION 21 | 22 | // The assoctiated properties in the header, as primitive numbers, can't be set to nil 23 | // For our purposes we need to know if a variable wasn't set -- by checking for nil 24 | @property(nonatomic, copy) NSNumber *eventIdObject; 25 | @property(nonatomic, copy) NSNumber *revenueObject; 26 | @property(nonatomic, copy) NSNumber *transactionStateObject; 27 | @property(nonatomic, copy) NSNumber *ratingObject; 28 | @property(nonatomic, copy) NSNumber *levelObject; 29 | @property(nonatomic, copy) NSNumber *quantityObject; 30 | 31 | @property(nonatomic, strong) NSMutableArray *tags; 32 | @property(nonatomic, strong) NSMutableSet *addedTags; 33 | @property(nonatomic, copy) NSSet *notAllowedAttributes; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneEventItem+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneEventItem+Internal.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 9/3/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneEventItem.h" 10 | 11 | @interface TuneEventItem () 12 | 13 | @property(nonatomic, strong) NSMutableArray *tags; 14 | @property(nonatomic, strong) NSMutableSet *addedTags; 15 | @property(nonatomic, copy) NSSet *notAllowedAttributes; 16 | 17 | // We do not do anything currently with the tune event items, so don't bother letting users set tags for them 18 | - (void)addTag:(NSString *)name withStringValue:(NSString *)value; 19 | - (void)addTag:(NSString *)name withDateTimeValue:(NSDate *)value; 20 | - (void)addTag:(NSString *)name withNumberValue:(NSNumber *)value; 21 | - (void)addTag:(NSString *)name withGeolocationValue:(TuneLocation *)value; 22 | 23 | // These aren't currently enabled, but will be in a later release 24 | - (void)addTag:(NSString *)name withBooleanValue:(NSNumber *)value; 25 | - (void)addTag:(NSString *)name withStringValue:(NSString *)value hashed:(BOOL)shouldHash; 26 | - (void)addTag:(NSString *)name withVersionValue:(NSString *)value; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneEventKeys.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneEventKeys.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 8/18/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_ID; 12 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_REVENUE; 13 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_CURRENCY_CODE; 14 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_REFERENCE_ID; 15 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_RECEIPT; 16 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_TRANSACTION_STATE; 17 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_CONTENT_TYPE; 18 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_CONTENT_ID; 19 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_LEVEL; 20 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_QUANTITY; 21 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_SEARCH_STRING; 22 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_RATING; 23 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_DATE1; 24 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_DATE2; 25 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB1; 26 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB2; 27 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB3; 28 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB4; 29 | FOUNDATION_EXPORT NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB5; 30 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneEventKeys.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneEventKeys.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 8/18/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneEventKeys.h" 10 | 11 | NSString * const TUNE_KEY_EVENT_ID = @"eventId"; 12 | NSString * const TUNE_KEY_EVENT_REVENUE = @"revenue"; 13 | NSString * const TUNE_KEY_EVENT_CURRENCY_CODE = @"currencyCode"; 14 | NSString * const TUNE_KEY_EVENT_REFERENCE_ID = @"refId"; 15 | NSString * const TUNE_KEY_EVENT_RECEIPT = @"receipt"; 16 | NSString * const TUNE_KEY_EVENT_TRANSACTION_STATE = @"transactionState"; 17 | NSString * const TUNE_KEY_EVENT_CONTENT_TYPE = @"content_type"; 18 | NSString * const TUNE_KEY_EVENT_CONTENT_ID = @"content_id"; 19 | NSString * const TUNE_KEY_EVENT_LEVEL = @"level"; 20 | NSString * const TUNE_KEY_EVENT_QUANTITY = @"quantity"; 21 | NSString * const TUNE_KEY_EVENT_SEARCH_STRING = @"search_string"; 22 | NSString * const TUNE_KEY_EVENT_RATING = @"rating"; 23 | NSString * const TUNE_KEY_EVENT_DATE1 = @"date1"; 24 | NSString * const TUNE_KEY_EVENT_DATE2 = @"date2"; 25 | NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB1 = @"attribute_sub1"; 26 | NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB2 = @"attribute_sub2"; 27 | NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB3 = @"attribute_sub3"; 28 | NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB4 = @"attribute_sub4"; 29 | NSString * const TUNE_KEY_EVENT_ATTRIBUTE_SUB5 = @"attribute_sub5"; 30 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneFBBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneFBBridge.h 3 | // Tune 4 | // 5 | // Created by John Bender on 10/8/14. 6 | // Copyright (c) 2014 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TuneEvent; 12 | 13 | @interface TuneFBBridge : NSObject 14 | 15 | + (void)sendEvent:(TuneEvent *)name limitEventAndDataUsage:(BOOL)limit; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneFileManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneFileManager.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Daniel Koch on 8/12/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "TuneModule.h" 12 | 13 | @interface TuneFileManager : NSObject 14 | 15 | + (NSDictionary *)loadAnalyticsFromDisk; 16 | + (BOOL)saveAnalyticsEventToDisk:(NSString *)eventJSON withId:(NSString *)eventId; 17 | + (BOOL)saveAnalyticsToDisk:(NSDictionary *)analytics; 18 | + (BOOL)deleteAnalyticsEventsFromDisk:(NSArray *)eventsToDelete; 19 | + (BOOL)deleteAnalyticsFromDisk; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneFileUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneFileUtils.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Daniel Koch on 8/4/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneFileUtils : NSObject 12 | 13 | // Property List 14 | + (id)loadPropertyList:(NSString *)filePathName; 15 | + (id)loadPropertyList:(NSString *)filePathName mutabilityOption:(NSPropertyListMutabilityOptions)opt; 16 | + (BOOL)savePropertyList:(id)object filePathName:(NSString *)filePathName plistFormat:(int)plistFormat; 17 | 18 | // File System Modification 19 | 20 | /** 21 | Creates a folder if one does not exist. Does not allow iCloud backup. 22 | @param folderPath full path of the folder. 23 | */ 24 | + (BOOL)createDirectory:(NSString *)folderPath; 25 | + (BOOL)fileExists:(NSString *)filePath; 26 | + (BOOL)deleteFileOrDirectory:(NSString *)fileOrDirectory; 27 | + (BOOL)moveFileOrDirectory:(NSString *)fileOrDirectory toFileOrDirectory:(NSString *)toFileOrDirectory; 28 | + (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)url; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneHttpResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneHttpResponse.h 3 | // Tune 4 | // 5 | // Created by Kevin Jenkins on 4/11/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface TuneHttpResponse : NSObject 12 | 13 | @property (nonatomic, strong) NSHTTPURLResponse *urlResponse; 14 | @property (nonatomic, copy) NSDictionary *responseDictionary; 15 | @property (nonatomic, strong) NSError *error; 16 | 17 | - (id)initWithURLResponse:(NSHTTPURLResponse*)response andError:(NSError*)error; 18 | 19 | - (BOOL)wasSuccessful; 20 | - (BOOL)failed; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneHttpResponse.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneHttpResponse.m 3 | // Tune 4 | // 5 | // Created by Kevin Jenkins on 4/11/13. 6 | // 7 | // 8 | 9 | #import "TuneHttpResponse.h" 10 | 11 | @implementation TuneHttpResponse 12 | 13 | #pragma mark - Initialization 14 | - (id)initWithURLResponse:(NSHTTPURLResponse*)response andError:(NSError*)error { 15 | self = [self init]; 16 | if (self) { 17 | _urlResponse = response; 18 | _error = error; 19 | } 20 | return self; 21 | } 22 | 23 | #pragma mark - Convenience Methods 24 | - (BOOL)wasSuccessful { 25 | return (self.error == nil && self.urlResponse.statusCode >= 200 && self.urlResponse.statusCode < 300); 26 | } 27 | 28 | - (BOOL)failed { 29 | return !self.wasSuccessful; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneHttpUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneHttpUtils.h 3 | // Tune 4 | // 5 | // Created by Michael Raber on 5/24/12. 6 | // Copyright (c) 2012 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TuneManager.h" 11 | 12 | @interface TuneHttpUtils : NSObject 13 | 14 | + (void)addIdentifyingHeaders:(NSMutableURLRequest *)request; 15 | + (NSString *)httpRequest:(NSString *)method action:(NSString *)action data:(NSDictionary *)data; 16 | 17 | + (void)performAsynchronousRequest:(NSURLRequest *)request completionHandler:(void(^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler; 18 | + (void)performSynchronousRequest:(NSURLRequest *)request completionHandler:(void(^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler; 19 | 20 | + (NSData *)sendSynchronousRequest:(NSURLRequest *)request response:(NSURLResponse **)response error:(NSError **)error; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneIadUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneIadUtils.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 9/30/16. 6 | // Copyright © 2016 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #if TARGET_OS_IOS 12 | #import 13 | 14 | 15 | @interface TuneIadUtils : NSObject 16 | 17 | + (BOOL)shouldCheckIadAttribution; 18 | 19 | @end 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneIadUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneIadUtils.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 9/30/16. 6 | // Copyright © 2016 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneIadUtils.h" 10 | #import "TuneKeyStrings.h" 11 | #import "TuneManager.h" 12 | #import "TuneUserProfile.h" 13 | #import "TuneUserDefaultsUtils.h" 14 | 15 | #if TARGET_OS_IOS 16 | 17 | @implementation TuneIadUtils 18 | 19 | + (BOOL)shouldCheckIadAttribution { 20 | return [UIApplication sharedApplication] && [ADClient sharedClient] 21 | && [[TuneManager currentManager].userProfile iadAttribution] == nil 22 | && [TuneUserDefaultsUtils userDefaultValueforKey:TUNE_KEY_IAD_ATTRIBUTION_CHECKED] == nil; 23 | } 24 | 25 | @end 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneIfa.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneIfa.h 3 | // MobileAppTracker 4 | // 5 | // Created by Harshal Ogale on 8/3/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneIfa : NSObject 12 | 13 | @property (nonatomic, copy, readonly) NSString *ifa; 14 | @property (nonatomic, assign, readonly) BOOL trackingEnabled; 15 | 16 | /*! 17 | Collects IFA if ASIdentifierManager class in AdSupport.framework is dynamically accessible. 18 | @return An instance of TuneIfa 19 | */ 20 | + (TuneIfa *)ifaInfo; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneIfa.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneIfa.m 3 | // MobileAppTracker 4 | // 5 | // Created by Harshal Ogale on 8/3/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneIfa.h" 10 | #import "TuneUtils.h" 11 | 12 | @interface TuneIfa () 13 | 14 | @property (nonatomic, copy) NSString *ifa; 15 | @property (nonatomic, assign) BOOL trackingEnabled; 16 | 17 | @end 18 | 19 | @implementation TuneIfa 20 | 21 | + (TuneIfa *)ifaInfo 22 | { 23 | TuneIfa *info = nil; 24 | 25 | Class aIdManager = [TuneUtils getClassFromString:@"ASIdentifierManager"]; 26 | 27 | if(aIdManager) 28 | { 29 | #pragma clang diagnostic push 30 | #pragma clang diagnostic ignored "-Wundeclared-selector" 31 | id sharedManager = [aIdManager performSelector:@selector(sharedManager)]; 32 | NSUUID *ifaUUID = (NSUUID *)[sharedManager performSelector:@selector(advertisingIdentifier)]; 33 | 34 | SEL selIsAdvertisingTrackingEnabled = @selector(isAdvertisingTrackingEnabled); 35 | #pragma clang diagnostic pop 36 | NSMethodSignature* signature = [sharedManager methodSignatureForSelector:selIsAdvertisingTrackingEnabled]; 37 | NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:signature]; 38 | [invocation setTarget:sharedManager]; 39 | [invocation setSelector:selIsAdvertisingTrackingEnabled]; 40 | [invocation invoke]; 41 | 42 | BOOL adTrackingEnabled = NO; 43 | [invocation getReturnValue:&adTrackingEnabled]; 44 | 45 | info = [TuneIfa new]; 46 | info.ifa = [ifaUUID UUIDString]; 47 | info.trackingEnabled = adTrackingEnabled; 48 | } 49 | 50 | return info; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneInstallReceipt.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneInstallReceipt.h 3 | // Tune 4 | // 5 | // Created by John Bender on 3/24/14. 6 | // Copyright (c) 2014 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneInstallReceipt : NSObject 12 | 13 | + (NSData *)installReceipt; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneInstallReceipt.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneInstallReceipt.m 3 | // Tune 4 | // 5 | // Created by John Bender on 3/24/14. 6 | // Copyright (c) 2014 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneInstallReceipt.h" 10 | 11 | @implementation TuneInstallReceipt 12 | 13 | + (NSData *)installReceipt { 14 | 15 | #if TESTING 16 | return [@"fakeReceiptDataString" dataUsingEncoding:NSUTF8StringEncoding]; 17 | #else 18 | 19 | NSURL *appStoreReceiptURL = [[NSBundle mainBundle] appStoreReceiptURL]; 20 | NSData *receiptData = [NSData dataWithContentsOfURL:appStoreReceiptURL]; 21 | 22 | return receiptData; 23 | #endif 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneLocation+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneLocation+Internal.h 3 | // MobileAppTracker 4 | // 5 | // Created by Harshal Ogale on 8/3/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneLocation.h" 10 | 11 | @interface TuneLocation () 12 | 13 | @property (nonatomic, copy) NSNumber *horizontalAccuracy; 14 | @property (nonatomic, copy) NSDate *timestamp; 15 | @property (nonatomic, copy) NSNumber *verticalAccuracy; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneLocation.h 3 | // MobileAppTracker 4 | // 5 | // Created by Harshal Ogale on 8/3/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | Receives location information about the device. 13 | */ 14 | @interface TuneLocation : NSObject 15 | 16 | /** 17 | Altitude of the device at the time an event is recorded. 18 | */ 19 | @property (nonatomic, copy) NSNumber *altitude; 20 | 21 | /** 22 | Latitude of the device an event is recorded. 23 | */ 24 | @property (nonatomic, copy) NSNumber *latitude; 25 | 26 | /** 27 | Longitude of the device an event is recorded. 28 | */ 29 | @property (nonatomic, copy) NSNumber *longitude; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneLocation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneLocation.m 3 | // MobileAppTracker 4 | // 5 | // Created by Harshal Ogale on 8/3/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneLocation+Internal.h" 10 | 11 | @implementation TuneLocation 12 | 13 | - (id)copyWithZone:(NSZone *)zone { 14 | TuneLocation *location = [[[self class] allocWithZone:zone] init]; 15 | 16 | location.longitude = [self.longitude copyWithZone:zone]; 17 | location.latitude = [self.latitude copyWithZone:zone]; 18 | location.altitude = [self.altitude copyWithZone:zone]; 19 | 20 | location.horizontalAccuracy = [self.horizontalAccuracy copyWithZone:zone]; 21 | location.verticalAccuracy = [self.verticalAccuracy copyWithZone:zone]; 22 | location.timestamp = [self.timestamp copyWithZone:zone]; 23 | 24 | return location; 25 | } 26 | 27 | #pragma mark - NSCoding 28 | 29 | - (id)initWithCoder:(NSCoder *)aDecoder { 30 | self = [super init]; 31 | if (!self) { 32 | return nil; 33 | } 34 | 35 | self.longitude = [aDecoder decodeObjectForKey:@"longitude"]; 36 | self.latitude = [aDecoder decodeObjectForKey:@"latitude"]; 37 | self.altitude = [aDecoder decodeObjectForKey:@"altitude"]; 38 | self.horizontalAccuracy = [aDecoder decodeObjectForKey:@"horizontalAccuracy"]; 39 | self.verticalAccuracy = [aDecoder decodeObjectForKey:@"verticalAccuracy"]; 40 | self.timestamp = [aDecoder decodeObjectForKey:@"timestamp"]; 41 | 42 | return self; 43 | } 44 | 45 | - (void)encodeWithCoder:(NSCoder *)aCoder { 46 | [aCoder encodeObject:self.longitude forKey:@"longitude"]; 47 | [aCoder encodeObject:self.latitude forKey:@"latitude"]; 48 | [aCoder encodeObject:self.altitude forKey:@"altitude"]; 49 | [aCoder encodeObject:self.horizontalAccuracy forKey:@"horizontalAccuracy"]; 50 | [aCoder encodeObject:self.verticalAccuracy forKey:@"verticalAccuracy"]; 51 | [aCoder encodeObject:self.timestamp forKey:@"timestamp"]; 52 | } 53 | 54 | #pragma mark - 55 | 56 | - (NSString *)debugDescription { 57 | return [NSString stringWithFormat:@"<%@: %p> %@, %@, %@, %@, %@, %@", [self class], (void *)self, self.latitude, self.longitude, self.altitude, self.horizontalAccuracy, self.verticalAccuracy, self.timestamp]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneLocationHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneLocationHelper.h 3 | // Tune 4 | // 5 | // Created by Harshal Ogale on 7/6/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TuneLocation; 12 | 13 | /*! 14 | Provides access to device location (latitude, longitude, altitude). 15 |
    16 |
  • Does not request location access permission from end user.
  • 17 |
  • Implements location delegate. If location is not readily available, updates the location on its own.
  • 18 |
  • The latest location is accessed only once each time deviceLocation is called.
  • 19 |
20 | */ 21 | @interface TuneLocationHelper : NSObject 22 | 23 | /*! 24 | Duration in seconds by which an event measurement request may be delayed while waiting for device location update 25 | */ 26 | FOUNDATION_EXPORT const NSTimeInterval TUNE_LOCATION_UPDATE_DELAY; 27 | 28 | /*! 29 | When location access is permitted, the current device location is included in the mutable array input param. 30 | If this is the first time location is being requested or if the location info is more than 60 seconds old, 31 | then this method initiates a new location fetch request. Note: This method should be called on the main thread. 32 | @param resultArr a mutable array to be used by the method to return location info 33 | */ 34 | + (void)getOrRequestDeviceLocation:(NSMutableArray *)resultArr; 35 | 36 | /*! 37 | Checks if the end-user has permitted device location access 38 | @return YES if location access is permitted, NO otherwise 39 | */ 40 | + (BOOL)isLocationEnabled; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneLog.h 3 | // Tune 4 | // 5 | // Created by Jennifer Owens on 6/27/18. 6 | // Copyright © 2018 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^TuneLogBlock)(NSString * _Nonnull message); 12 | 13 | @interface TuneLog : NSObject 14 | 15 | @property (nonatomic, nullable, copy) TuneLogBlock logBlock; 16 | @property (nonatomic, readwrite, assign) BOOL verbose; 17 | 18 | + (nonnull instancetype)shared; 19 | 20 | - (void)logError:(nullable NSString *)message; 21 | - (void)logVerbose:(nullable NSString *)message; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneLog.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneLog.m 3 | // Tune 4 | // 5 | // Created by Jennifer Owens on 6/27/18. 6 | // Copyright © 2018 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneLog.h" 10 | 11 | @implementation TuneLog 12 | 13 | + (instancetype)shared { 14 | static TuneLog *tuneLog; 15 | 16 | static dispatch_once_t onceToken; 17 | dispatch_once(&onceToken, ^{ 18 | tuneLog = [TuneLog new]; 19 | }); 20 | 21 | return tuneLog; 22 | } 23 | 24 | - (instancetype)init { 25 | self = [super init]; 26 | if (self) { 27 | self.verbose = NO; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | - (void)logError:(NSString *)message { 34 | TuneLogBlock temp = self.logBlock; 35 | if (temp && message) { 36 | temp(message); 37 | } 38 | } 39 | 40 | - (void)logVerbose:(NSString *)message { 41 | TuneLogBlock temp = self.logBlock; 42 | if (temp && self.verbose && message) { 43 | temp(message); 44 | } 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneManager.h 3 | // MobileAppTracker 4 | // 5 | // Created by Matt Gowie on 7/22/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TuneConfiguration; 12 | @class TuneFileManager; 13 | @class TuneSessionManager; 14 | @class TuneSkyhookCenter; 15 | @class TuneUserProfile; 16 | 17 | // This singleton is responsible for keeping references to all major components 18 | // so various parts of the system can be initialized with the TuneManager and then 19 | // have access to its many counterparts. 20 | 21 | @interface TuneManager : NSObject 22 | 23 | @property (strong, nonatomic) TuneUserProfile *userProfile; 24 | @property (strong, nonatomic) TuneSessionManager *sessionManager; 25 | 26 | + (TuneManager *)currentManager; 27 | - (void)instantiateModules; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneModule.h 3 | // MobileAppTracker 4 | // 5 | // Created by Matt Gowie on 7/22/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // Base class for any Tune component classes that need Skyhooks or a reference to the 12 | // TuneManager class. 13 | 14 | @class TuneManager; 15 | 16 | @interface TuneModule : NSObject 17 | 18 | @property (weak, nonatomic) TuneManager *tuneManager; 19 | 20 | - (id)initWithTuneManager:(TuneManager *)tuneManager; 21 | + (id)moduleWithTuneManager:(TuneManager *)tuneManager; 22 | 23 | - (void)bringUp; 24 | - (void)bringDown; 25 | 26 | - (void)registerSkyhooks; 27 | - (void)unregisterSkyhooks; 28 | - (NSString *)name; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneModule.m 3 | // MobileAppTracker 4 | // 5 | // Created by Matt Gowie on 7/22/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneModule.h" 10 | #import "TuneManager.h" 11 | #import "TuneSkyhookCenter.h" 12 | 13 | @implementation TuneModule 14 | 15 | #pragma mark - Initialization 16 | - (id)initWithTuneManager:(TuneManager *)tuneManager { 17 | self = [self init]; 18 | if (self) { 19 | _tuneManager = tuneManager; 20 | } 21 | return self; 22 | } 23 | 24 | + (id)moduleWithTuneManager:(TuneManager *)tuneManager { 25 | return [[[self class] alloc] initWithTuneManager:tuneManager]; 26 | } 27 | 28 | - (void)dealloc { 29 | [[TuneSkyhookCenter defaultCenter] removeObserver:self]; 30 | } 31 | 32 | #pragma mark - Enable/Disable 33 | 34 | - (void)bringUp { 35 | [NSException raise:NSInternalInconsistencyException 36 | format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; 37 | } 38 | 39 | - (void)bringDown { 40 | [NSException raise:NSInternalInconsistencyException 41 | format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; 42 | } 43 | 44 | #pragma mark - Skyhook 45 | 46 | - (void)registerSkyhooks { 47 | // override in subclass 48 | } 49 | 50 | - (void)unregisterSkyhooks { 51 | [[TuneSkyhookCenter defaultCenter] removeObserver:self]; 52 | } 53 | 54 | #pragma mark - Identification 55 | - (NSString *)name { 56 | return NSStringFromClass([self class]); 57 | } 58 | 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneNetworkUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneNetworkUtils.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 9/2/16. 6 | // Copyright © 2016 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TuneReachability.h" 11 | 12 | @interface TuneNetworkUtils : NSObject 13 | 14 | + (BOOL)isNetworkReachable; 15 | 16 | #if TARGET_OS_IOS 17 | + (TuneNetworkStatus)networkReachabilityStatus; 18 | #endif 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneNetworkUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneNetworkUtils.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 9/2/16. 6 | // Copyright © 2016 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneNetworkUtils.h" 10 | 11 | 12 | @implementation TuneNetworkUtils 13 | 14 | #if TARGET_OS_IOS 15 | + (TuneNetworkStatus)networkReachabilityStatus { 16 | return [[TuneReachability sharedInstance] currentReachabilityStatus]; 17 | } 18 | #endif 19 | 20 | + (BOOL)isNetworkReachable { 21 | BOOL reachable = YES; 22 | 23 | #if TARGET_OS_IOS 24 | reachable = TuneNotReachable != [self networkReachabilityStatus]; 25 | #endif 26 | 27 | return reachable; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TunePreloadData.m: -------------------------------------------------------------------------------- 1 | // 2 | // TunePreloadData.m 3 | // Tune 4 | // 5 | // Created by Harshal Ogale on 4/27/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TunePreloadData.h" 10 | 11 | 12 | @implementation TunePreloadData 13 | 14 | + (instancetype)preloadDataWithPublisherId:(NSString *)publisherId 15 | { 16 | return [[TunePreloadData alloc] initWithPublisherId:publisherId]; 17 | } 18 | 19 | - (instancetype)initWithPublisherId:(NSString *)pubId { 20 | self = [super init]; 21 | if (self) { 22 | _publisherId = pubId; 23 | } 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneSessionManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSessionManager.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Daniel Koch on 8/17/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TuneModule.h" 11 | 12 | @interface TuneSessionManager : TuneModule 13 | 14 | /* Returns the time since the session began. If there is no current 15 | session, 0 will be returned. */ 16 | - (NSTimeInterval)timeSinceSessionStart; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneSkyhookConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSkyhookConstants.h 3 | // MobileAppTracker 4 | // 5 | // Created by Matt Gowie on 7/22/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #pragma mark - Analytics Hooks 12 | FOUNDATION_EXPORT NSString *const TuneCustomEventOccurred; 13 | FOUNDATION_EXPORT NSString *const TuneAppOpenedFromURL; 14 | FOUNDATION_EXPORT NSString *const TuneEventTracked; 15 | 16 | #pragma mark - Session Hooks 17 | FOUNDATION_EXPORT NSString *const TuneSessionManagerSessionDidStart; 18 | FOUNDATION_EXPORT NSString *const TuneSessionManagerSessionDidEnd; 19 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneSkyhookConstants.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSkyhookConstants.m 3 | // MobileAppTracker 4 | // 5 | // Created by Matt Gowie on 7/22/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneSkyhookConstants.h" 10 | 11 | #pragma mark - Analytics Hooks 12 | NSString *const TuneCustomEventOccurred = @"TuneCustomEventOccurred"; 13 | NSString *const TuneAppOpenedFromURL = @"TuneAppOpenedFromURL"; 14 | NSString *const TuneEventTracked = @"TuneEventTracked"; // Posted on every event via AnalyticsManager#storeAndTrackAnalyticsEvents 15 | 16 | #pragma mark - Session Hooks 17 | NSString *const TuneSessionManagerSessionDidStart = @"TuneSessionManagerSessionDidStart"; 18 | NSString *const TuneSessionManagerSessionDidEnd = @"TuneSessionManagerSessionDidEnd"; 19 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneSkyhookObserver.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSkyhookObserver.h 3 | // MobileAppTracker 4 | // 5 | // Created by Matt Gowie on 7/22/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TuneSkyhookPayload; 12 | 13 | // Maintains information for a given skyhook observer 14 | @interface TuneSkyhookObserver : NSObject 15 | 16 | @property (weak, readonly) id observer; 17 | @property (readonly) SEL selector; 18 | @property (weak, readonly) id sender; 19 | @property (readonly) int priority; 20 | 21 | - (id)initWithObserver:(id)observer selector:(SEL)selector sender:(id)sender priority:(int)priority; 22 | - (void)sendPayload:(TuneSkyhookPayload *)payload; 23 | - (BOOL)matchesSender:(id)sender; 24 | 25 | /* Returns YES if the observer still exists, otherwise returns NO. If it returns NO, we should 26 | remove this skyhook observer from the list of observers. */ 27 | - (BOOL)isStillValid; 28 | - (NSString *)description; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneSkyhookPayload.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSkyhookPayload.h 3 | // MobileAppTracker 4 | // 5 | // Created by Matt Gowie on 7/22/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneSkyhookPayload : NSObject 12 | 13 | @property (readonly) NSDictionary *userInfo; 14 | @property (weak, readonly) id object; 15 | @property (readonly) NSString *skyhookName; 16 | 17 | /* The observer sets this if there's any data it wants to pass back. */ 18 | @property (strong, nonatomic) id returnObject; 19 | 20 | - (instancetype)initWithName:(NSString *)skyhookName object:(id)skyhookObject userInfo:(NSDictionary *)userInfo; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneSkyhookPayload.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSkyhookPayload.m 3 | // MobileAppTracker 4 | // 5 | // Created by Matt Gowie on 7/22/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneSkyhookPayload.h" 10 | 11 | @implementation TuneSkyhookPayload 12 | 13 | - (id)initWithName:(NSString *)skyhookName object:(id)skyhookObject userInfo:(NSDictionary *)userInfo { 14 | self = [self init]; 15 | 16 | if (self) { 17 | _skyhookName = skyhookName; 18 | _object = skyhookObject; 19 | _userInfo = [userInfo copy]; 20 | _returnObject = nil; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneSkyhookPayloadConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSkyhookPayloadConstants.h 3 | // MobileAppTracker 4 | // 5 | // Created by Charles Gilliam on 7/30/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneSkyhookPayloadConstants : NSObject 12 | 13 | #pragma mark - Session Variable 14 | FOUNDATION_EXPORT NSString *const TunePayloadSessionVariableName; 15 | FOUNDATION_EXPORT NSString *const TunePayloadSessionVariableValue; 16 | FOUNDATION_EXPORT NSString *const TunePayloadSessionVariableSaveType; 17 | FOUNDATION_EXPORT NSString *const TunePayloadSessionVariableSaveTypeTag; 18 | FOUNDATION_EXPORT NSString *const TunePayloadSessionVariableSaveTypeProfile; 19 | 20 | #pragma mark - Custom Event 21 | FOUNDATION_EXPORT NSString *const TunePayloadCustomEvent; 22 | 23 | #pragma mark - Tracked Event 24 | FOUNDATION_EXPORT NSString *const TunePayloadTrackedEvent; 25 | 26 | #pragma mark - Profile clear 27 | FOUNDATION_EXPORT NSString *const TunePayloadProfileVariablesToClear; 28 | 29 | #pragma mark - Playlist 30 | FOUNDATION_EXPORT NSString *const TunePayloadNewPlaylist; 31 | FOUNDATION_EXPORT NSString *const TunePayloadPlaylistLoadedFromDisk; 32 | FOUNDATION_EXPORT NSString *const TunePayloadFirstPlaylistDownloaded; 33 | 34 | #pragma mark - Push and Local Notification 35 | FOUNDATION_EXPORT NSString *const TunePayloadNotification; 36 | 37 | #pragma mark - Campaign 38 | FOUNDATION_EXPORT NSString *const TunePayloadCampaign; 39 | FOUNDATION_EXPORT NSString *const TunePayloadCampaignStep; 40 | 41 | #pragma mark - Deeplinks 42 | FOUNDATION_EXPORT NSString *const TunePayloadDeeplink; 43 | 44 | @end 45 | 46 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneSkyhookPayloadConstants.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSkyhookPayloadConstants.m 3 | // MobileAppTracker 4 | // 5 | // Created by Charles Gilliam on 7/30/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #import "TuneSkyhookPayloadConstants.h" 10 | 11 | @implementation TuneSkyhookPayloadConstants 12 | 13 | #pragma mark - Session Variable 14 | NSString *const TunePayloadSessionVariableName = @"TunePayloadSessionVariableName"; 15 | NSString *const TunePayloadSessionVariableValue = @"TunePayloadSessionVariableValue"; 16 | NSString *const TunePayloadSessionVariableSaveType = @"TunePayloadSessionVariableSaveType"; 17 | NSString *const TunePayloadSessionVariableSaveTypeTag = @"TunePayloadSessionVariableSaveTypeTag"; 18 | NSString *const TunePayloadSessionVariableSaveTypeProfile = @"TunePayloadSessionVariableSaveTypeProfile"; 19 | 20 | #pragma mark - Custom Event 21 | NSString *const TunePayloadCustomEvent = @"TuneCustomEvent"; 22 | 23 | #pragma mark - Tracked Event 24 | NSString *const TunePayloadTrackedEvent = @"TunePayloadTrackedEvent"; 25 | 26 | #pragma mark - Profile clear 27 | NSString *const TunePayloadProfileVariablesToClear = @"TunePayloadClearedVariables"; 28 | 29 | #pragma mark - Playlist 30 | NSString *const TunePayloadNewPlaylist = @"TunePayloadNewPlaylist"; 31 | NSString *const TunePayloadPlaylistLoadedFromDisk = @"TunePayloadPlaylistLoadedFromDisk"; 32 | NSString *const TunePayloadFirstPlaylistDownloaded = @"TunePayloadFirstPlaylistDownloaded"; 33 | 34 | #pragma mark - Push and Local Notification 35 | NSString *const TunePayloadNotification = @"TunePayloadNotification"; 36 | 37 | #pragma mark - Campaign 38 | NSString *const TunePayloadCampaign = @"TunePayloadCampaign"; 39 | NSString *const TunePayloadCampaignStep = @"TunePayloadCampaignStep"; 40 | 41 | #pragma mark - Deeplinks 42 | NSString *const TunePayloadDeeplink = @"TunePayloadDeeplink"; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneStoreKitDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneStoreKitDelegate.h 3 | // Tune 4 | // 5 | // Created by Harshal Ogale on 4/20/15. 6 | // Copyright (c) 2015 TUNE. All rights reserved. 7 | // 8 | 9 | #if !TARGET_OS_WATCH 10 | 11 | #import 12 | #import 13 | 14 | 15 | @interface TuneStoreKitDelegate : NSObject 16 | 17 | + (void)startObserver; 18 | + (void)stopObserver; 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneStringUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneStringUtils.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 7/27/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneStringUtils : NSObject 12 | 13 | /** Returns a URL encoded version of the given UTF-8 string. 14 | 15 | @param unencodedString The NSString you want to encode 16 | 17 | @returns The encoded string. If you pass nil, it will return nil. 18 | */ 19 | + (NSString *)urlEncodeString:(NSString *)unencodedString; 20 | 21 | /** 22 | Removes percent-encoding from given string. 23 | 24 | @param string encoded string 25 | 26 | @returns NSString* un-encoded string 27 | */ 28 | + (NSString *)removePercentEncoding:(NSString *)string; 29 | 30 | /** 31 | Adds percent-encoding to given string. 32 | 33 | @param string un-encoded string 34 | 35 | @returns NSString* encoded string 36 | */ 37 | + (NSString *)addPercentEncoding:(NSString *)string; 38 | 39 | /** 40 | Checks whether given string contains a given substring 41 | 42 | @param string The full string to search in 43 | 44 | @param subString The substring to check whether it exists in the full string 45 | 46 | @returns BOOL Whether full string contains substring or not 47 | */ 48 | + (BOOL)string:(NSString *)string containsString:(NSString *)subString; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneStringUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneStringUtils.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 7/27/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneStringUtils.h" 10 | #import "TuneDateUtils.h" 11 | 12 | static NSMutableCharacterSet *tune_urlEncodingAllowedCharacterSet; 13 | static NSString *tune_ignoredCharacters = @"!*'\"();:@&=+$,/?%#[] \n"; 14 | 15 | @implementation TuneStringUtils 16 | 17 | + (void)initialize { 18 | tune_urlEncodingAllowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; 19 | [tune_urlEncodingAllowedCharacterSet removeCharactersInString:tune_ignoredCharacters]; 20 | } 21 | 22 | + (NSString *)urlEncodeString:(NSString *)unEncodedString { 23 | if (unEncodedString == nil) return @""; 24 | 25 | NSString *encodedString = [unEncodedString stringByAddingPercentEncodingWithAllowedCharacters:tune_urlEncodingAllowedCharacterSet]; 26 | return encodedString; 27 | } 28 | 29 | + (NSString *)removePercentEncoding:(NSString *)string { 30 | if (string == nil) return nil; 31 | 32 | NSString *output = [string stringByRemovingPercentEncoding]; 33 | return output; 34 | } 35 | 36 | + (NSString *)addPercentEncoding:(NSString *)string { 37 | if (string == nil) return nil; 38 | 39 | NSString *output = [string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLPathAllowedCharacterSet]]; 40 | return output; 41 | } 42 | 43 | + (BOOL)string:(NSString *)string containsString:(NSString *)subString { 44 | NSRange range = [string rangeOfString:subString]; 45 | return range.location != NSNotFound; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneTracker.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneTracker.h 3 | // Tune 4 | // 5 | // Created by John Bender on 2/28/14. 6 | // Copyright (c) 2014 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TuneEvent; 12 | 13 | @protocol TuneDelegate; 14 | @protocol TuneTrackerDelegate; 15 | 16 | @interface TuneTracker : NSObject 17 | 18 | @property (nonatomic, assign) id trackerDelegate; 19 | 20 | @property (nonatomic, assign) BOOL fbLogging; 21 | @property (nonatomic, assign) BOOL fbLimitUsage; 22 | 23 | #if TESTING 24 | @property (nonatomic, assign) BOOL allowDuplicateRequests; 25 | #endif 26 | 27 | + (TuneTracker *)sharedInstance; 28 | 29 | #if TESTING 30 | + (void)resetSharedInstance; 31 | #endif 32 | 33 | - (void)startTracker; 34 | 35 | - (void)applicationDidOpenURL:(NSString *)urlString sourceApplication:(NSString *)sourceApplication; 36 | 37 | - (void)measureEvent:(TuneEvent *)event; 38 | 39 | - (void)measureTuneLinkClick:(NSString *)clickedTuneLinkUrl; 40 | 41 | - (BOOL)isiAdAttribution; 42 | 43 | - (void)urlStringForEvent:(TuneEvent *)event 44 | trackingLink:(NSString**)trackingLink 45 | encryptParams:(NSString**)encryptParams; 46 | @end 47 | 48 | @protocol TuneTrackerDelegate 49 | @optional 50 | - (void)_tuneURLTestingCallbackWithParamsToBeEncrypted:(NSString*)paramsToBeEncrypted withPlaintextParams:(NSString*)plaintextParams; 51 | @end 52 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneUserAgentCollector.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneUserAgentCollector.h 3 | // Branch 4 | // 5 | // Created by Ernest Cho on 8/29/19. 6 | // Copyright © 2019 Branch, Inc. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | // Copied and modified from Branch SDK 14 | @interface TuneUserAgentCollector : NSObject 15 | 16 | + (TuneUserAgentCollector *)shared; 17 | 18 | @property (nonatomic, copy, readwrite) NSString *userAgent; 19 | 20 | - (void)loadUserAgentWithCompletion:(nullable void (^)(NSString * _Nullable userAgent))completion; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/TuneUserDefaultsUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneUserDefaultsUtils.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 8/17/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneAnalyticsVariable.h" 10 | 11 | /** 12 | Wrapper for interacting with NSUserDefaults standardDefaults. Note that the setters in this class do not include a call to NSUserDefaults synchronize() method. The SDK calls NSUserDefaults synchronize() method only once just before the app becomes inactive. 13 | */ 14 | @interface TuneUserDefaultsUtils : NSObject 15 | 16 | /** 17 | Returns value for new key if it exists, else returns value for old key. 18 | e.g. 19 | - regular variable: old key = "some_key", new key = "_TUNE_some_key" 20 | - custom variable: old key = "some_other_key", new key = "_TUNE_CUSTOM_VARIABLE_some_other_key" 21 | */ 22 | + (id)userDefaultValueforKey:(NSString *)key; 23 | + (void)setUserDefaultValue:(id)value forKey:(NSString* )key; 24 | + (void)clearUserDefaultValue:(NSString *)key; 25 | 26 | + (NSInteger)incrementUserDefaultCountForKey:(NSString *)key; 27 | + (NSInteger)incrementUserDefaultCountForKey:(NSString *)key byValue:(NSInteger)value; 28 | 29 | + (TuneAnalyticsVariable *)userDefaultCustomVariableforKey:(NSString *)key; 30 | + (void)setUserDefaultCustomVariable:(TuneAnalyticsVariable *)value forKey:(NSString *)key; 31 | + (void)clearCustomVariable:(NSString *)key; 32 | 33 | + (void)synchronizeUserDefaults; 34 | 35 | #if TESTING 36 | + (void)setUserDefaultValue:(id)value forKey:(NSString* )key addKeyPrefix:(BOOL)addPrefix; 37 | + (void)clearAll; 38 | + (void)useNSUserDefaults:(BOOL)enabled; 39 | #endif 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/Tune_tvos.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tune_tvos.h 3 | // Tune 4 | // 5 | // Created by Harshal Ogale on 9/24/15. 6 | // Copyright © 2015 TUNE, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef Tune_tvos_h 10 | #define Tune_tvos_h 11 | 12 | #import "Tune.h" 13 | 14 | #endif /* Tune_tvos_h */ 15 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune/Tune_watchos.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tune_watchos.h 3 | // Tune 4 | // 5 | // Created by Harshal Ogale on 9/24/15. 6 | // Copyright © 2015 TUNE, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef Tune_watchos_h 10 | #define Tune_watchos_h 11 | 12 | #import "Tune.h" 13 | 14 | #endif /* Tune_watchos_h */ 15 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/DictionaryLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // DictionaryLoader.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 7/28/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DictionaryLoader : NSObject 12 | 13 | + (NSDictionary*)dictionaryFromPListFileNamed:(NSString*)fileName; 14 | 15 | + (NSArray*)arrayFromPListFileNamed:(NSString*)fileName; 16 | 17 | + (NSDictionary *)dictionaryFromJSONFileNamed:(NSString *)fileName; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/DictionaryLoader.m: -------------------------------------------------------------------------------- 1 | // 2 | // DictionaryLoader.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 7/28/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "DictionaryLoader.h" 10 | 11 | @implementation DictionaryLoader 12 | 13 | + (NSDictionary *)dictionaryFromPListFileNamed:(NSString *)fileName 14 | { 15 | NSString *pathToDictionary = [[NSBundle bundleForClass:[self class]] pathForResource:fileName ofType:@"plist"]; 16 | NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:pathToDictionary]; 17 | return dictionary; 18 | } 19 | + (NSArray *)arrayFromPListFileNamed:(NSString *)fileName 20 | { 21 | NSString *pathToDictionary = [[NSBundle bundleForClass:[self class]] pathForResource:fileName ofType:@"plist"]; 22 | NSArray *array = [[NSArray alloc] initWithContentsOfFile:pathToDictionary]; 23 | return array; 24 | } 25 | 26 | +(NSDictionary *) dictionaryFromJSONFileNamed:(NSString *)fileName { 27 | NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:fileName ofType:@"json"]; 28 | 29 | NSString *jsonString = [NSString stringWithContentsOfFile:path 30 | encoding:NSUTF8StringEncoding 31 | error:NULL]; 32 | 33 | id dict = [NSJSONSerialization JSONObjectWithData:[jsonString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil]; 34 | if ([dict isKindOfClass:NSDictionary.class]) { 35 | return dict; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UISupportedInterfaceOrientations 6 | 7 | UIInterfaceOrientationPortrait 8 | UIInterfaceOrientationPortraitUpsideDown 9 | UIInterfaceOrientationLandscapeLeft 10 | UIInterfaceOrientationLandscapeRight 11 | 12 | CFBundleDevelopmentRegion 13 | $(DEVELOPMENT_LANGUAGE) 14 | CFBundleExecutable 15 | $(EXECUTABLE_NAME) 16 | CFBundleIdentifier 17 | $(PRODUCT_BUNDLE_IDENTIFIER) 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | $(PRODUCT_NAME) 22 | CFBundlePackageType 23 | BNDL 24 | CFBundleShortVersionString 25 | 1.0 26 | CFBundleVersion 27 | 1 28 | 29 | 30 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/NSURLRequest+TuneUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLRequest+TuneUtils.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Daniel Koch on 8/14/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TuneHttpRequest.h" 11 | 12 | @interface NSURLRequest (TuneUtils) 13 | 14 | - (BOOL)tuneIsEqualToNSURLRequest:(NSURLRequest *)request; 15 | - (BOOL)tuneIsEqualToTuneHttpRequest:(TuneHttpRequest *)request; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/NSURLRequest+TuneUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLRequest+TuneUtils.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Daniel Koch on 8/14/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NSURLRequest+TuneUtils.h" 11 | #import "TuneHttpRequest.h" 12 | 13 | @implementation NSURLRequest (TuneUtils) 14 | 15 | - (BOOL)tuneIsEqualToNSURLRequest:(NSURLRequest *)request { 16 | if ([request HTTPBody].length != [self HTTPBody].length) { 17 | return NO; 18 | } else if (![[request HTTPMethod] isEqualToString:[self HTTPMethod]]){ 19 | return NO; 20 | } else if (![[request valueForHTTPHeaderField:TuneHttpRequestHeaderContentType] isEqualToString:[self valueForHTTPHeaderField:TuneHttpRequestHeaderContentType]]) { 21 | return NO; 22 | } 23 | 24 | return YES; 25 | } 26 | 27 | - (BOOL)tuneIsEqualToTuneHttpRequest:(TuneHttpRequest *)request { 28 | if ([request HTTPBody].length != [self HTTPBody].length) { 29 | return NO; 30 | } else if (![[request HTTPMethod] isEqualToString:[self HTTPMethod]]){ 31 | return NO; 32 | } else if (![[request valueForHTTPHeaderField:TuneHttpRequestHeaderContentType] isEqualToString:[self valueForHTTPHeaderField:TuneHttpRequestHeaderContentType]]) { 33 | return NO; 34 | } 35 | 36 | return YES; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/NSURLSession+TuneDelegateMockServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLSession+TuneDelegateMockServer.h 3 | // Tune 4 | // 5 | // Created by Ernest Cho on 11/17/17. 6 | // Copyright © 2017 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // This mock server is used to verify Tune network error handling. 12 | // This does NOT mock whole data, just modifies real responses. 13 | @interface NSURLSession (TuneDelegateMockServer) 14 | 15 | + (void)swizzleDataTaskToReturnNoData; 16 | + (void)unswizzleDataTaskToReturnNoData; 17 | 18 | + (void)swizzleDataTaskToHttp400; 19 | + (void)unswizzleDataTaskToHttp400; 20 | 21 | + (void)swizzleDataTaskToHttpError; 22 | + (void)unswizzleDataTaskToHttpError; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCObserverMockObject; 20 | 21 | 22 | @interface NSNotificationCenter(OCMAdditions) 23 | 24 | - (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Headers/OCMArg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMArg : NSObject 20 | 21 | // constraining arguments 22 | 23 | + (id)any; 24 | + (SEL)anySelector; 25 | + (void *)anyPointer; 26 | + (id __autoreleasing *)anyObjectRef; 27 | + (id)isNil; 28 | + (id)isNotNil; 29 | + (id)isEqual:(id)value; 30 | + (id)isNotEqual:(id)value; 31 | + (id)isKindOfClass:(Class)cls; 32 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 33 | + (id)checkWithBlock:(BOOL (^)(id obj))block; 34 | 35 | // manipulating arguments 36 | 37 | + (id *)setTo:(id)value; 38 | + (void *)setToValue:(NSValue *)value; 39 | + (id)invokeBlock; 40 | + (id)invokeBlockWithArgs:(id)first,... NS_REQUIRES_NIL_TERMINATION; 41 | 42 | + (id)defaultValue; 43 | 44 | // internal use only 45 | 46 | + (id)resolveSpecialValues:(NSValue *)value; 47 | 48 | @end 49 | 50 | #define OCMOCK_ANY [OCMArg any] 51 | 52 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 53 | #define OCMOCK_VALUE(variable) \ 54 | ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) 55 | #else 56 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Headers/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @interface OCMConstraint : NSObject 21 | 22 | + (instancetype)constraint; 23 | - (BOOL)evaluate:(id)value; 24 | 25 | // if you are looking for any, isNil, etc, they have moved to OCMArg 26 | 27 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 28 | 29 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 30 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 31 | 32 | 33 | @end 34 | 35 | @interface OCMAnyConstraint : OCMConstraint 36 | @end 37 | 38 | @interface OCMIsNilConstraint : OCMConstraint 39 | @end 40 | 41 | @interface OCMIsNotNilConstraint : OCMConstraint 42 | @end 43 | 44 | @interface OCMIsNotEqualConstraint : OCMConstraint 45 | { 46 | @public 47 | id testValue; 48 | } 49 | 50 | @end 51 | 52 | @interface OCMInvocationConstraint : OCMConstraint 53 | { 54 | @public 55 | NSInvocation *invocation; 56 | } 57 | 58 | @end 59 | 60 | @interface OCMBlockConstraint : OCMConstraint 61 | { 62 | BOOL (^block)(id); 63 | } 64 | 65 | - (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; 66 | 67 | @end 68 | 69 | 70 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 71 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 72 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Headers/OCMFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | #if defined(__cplusplus) 21 | #define OCMOCK_EXTERN extern "C" 22 | #else 23 | #define OCMOCK_EXTERN extern 24 | #endif 25 | 26 | 27 | OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Headers/OCMLocation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCMFunctions.h" 19 | 20 | 21 | @interface OCMLocation : NSObject 22 | { 23 | id testCase; 24 | NSString *file; 25 | NSUInteger line; 26 | } 27 | 28 | + (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 29 | 30 | - (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 31 | 32 | - (id)testCase; 33 | - (NSString *)file; 34 | - (NSUInteger)line; 35 | 36 | @end 37 | 38 | OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); 39 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Headers/OCMMacroState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMRecorder; 21 | @class OCMStubRecorder; 22 | @class OCMockObject; 23 | 24 | 25 | @interface OCMMacroState : NSObject 26 | { 27 | OCMRecorder *recorder; 28 | } 29 | 30 | + (void)beginStubMacro; 31 | + (OCMStubRecorder *)endStubMacro; 32 | 33 | + (void)beginExpectMacro; 34 | + (OCMStubRecorder *)endExpectMacro; 35 | 36 | + (void)beginRejectMacro; 37 | + (OCMStubRecorder *)endRejectMacro; 38 | 39 | + (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; 40 | + (void)endVerifyMacro; 41 | 42 | + (OCMMacroState *)globalState; 43 | 44 | - (OCMRecorder *)recorder; 45 | 46 | - (void)switchToClassMethod; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Headers/OCMRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMockObject; 20 | @class OCMInvocationMatcher; 21 | 22 | 23 | @interface OCMRecorder : NSProxy 24 | { 25 | OCMockObject *mockObject; 26 | OCMInvocationMatcher *invocationMatcher; 27 | } 28 | 29 | - (instancetype)init; 30 | - (instancetype)initWithMockObject:(OCMockObject *)aMockObject; 31 | 32 | - (void)setMockObject:(OCMockObject *)aMockObject; 33 | 34 | - (OCMInvocationMatcher *)invocationMatcher; 35 | 36 | - (id)classMethod; 37 | - (id)ignoringNonObjectArgs; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Headers/OCMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMInvocationStub; 21 | @class OCMStubRecorder; 22 | @class OCMInvocationMatcher; 23 | @class OCMInvocationExpectation; 24 | 25 | 26 | @interface OCMockObject : NSProxy 27 | { 28 | BOOL isNice; 29 | BOOL expectationOrderMatters; 30 | NSMutableArray *stubs; 31 | NSMutableArray *expectations; 32 | NSMutableArray *exceptions; 33 | NSMutableArray *invocations; 34 | } 35 | 36 | + (id)mockForClass:(Class)aClass; 37 | + (id)mockForProtocol:(Protocol *)aProtocol; 38 | + (id)partialMockForObject:(NSObject *)anObject; 39 | 40 | + (id)niceMockForClass:(Class)aClass; 41 | + (id)niceMockForProtocol:(Protocol *)aProtocol; 42 | 43 | + (id)observerMock; 44 | 45 | - (instancetype)init; 46 | 47 | - (void)setExpectationOrderMatters:(BOOL)flag; 48 | 49 | - (id)stub; 50 | - (id)expect; 51 | - (id)reject; 52 | 53 | - (id)verify; 54 | - (id)verifyAtLocation:(OCMLocation *)location; 55 | 56 | - (void)verifyWithDelay:(NSTimeInterval)delay; 57 | - (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; 58 | 59 | - (void)stopMocking; 60 | 61 | // internal use only 62 | 63 | - (void)addStub:(OCMInvocationStub *)aStub; 64 | - (void)addExpectation:(OCMInvocationExpectation *)anExpectation; 65 | 66 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 67 | - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; 68 | - (BOOL)handleSelector:(SEL)sel; 69 | 70 | - (void)verifyInvocation:(OCMInvocationMatcher *)matcher; 71 | - (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; 72 | 73 | @end 74 | 75 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-ios/Tune/TuneTests/OCMock.framework/Info.plist -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module OCMock { 2 | umbrella header "OCMock.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/OCMock.framework/OCMock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-ios/Tune/TuneTests/OCMock.framework/OCMock -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/Resources/TuneConfiguration.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AppDelegateClassName 6 | TuneBlankAppDelegate 7 | UserNotificationDelegateClassName 8 | TuneBlankAppDelegate 9 | DisabledClasses 10 | 11 | DisabledInPlist 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/Resources/TuneExperimentManagerTests.json: -------------------------------------------------------------------------------- 1 | { 2 | "power_hooks": { 3 | "itemsToDisplay" : { 4 | "value" : "10", 5 | "experiment_value" : "55", 6 | "start_date" : "2008-08-26T13:38:20Z", 7 | "end_date" : "2115-08-26T13:38:20Z", 8 | "variation_id" : "abc", 9 | "experiment_id" : "123" 10 | }, 11 | "showMainScreen" : { 12 | "value" : "YES", 13 | "experiment_value" : "NO", 14 | "start_date" : "2008-08-26T13:38:20Z", 15 | "end_date" : "2115-08-26T13:38:20Z", 16 | "variation_id" : "def", 17 | "experiment_id" : "456" 18 | } 19 | }, 20 | "experiment_details": { 21 | "123" : { 22 | "name" : "Number of Items to Display Experiment", 23 | "id" : "123", 24 | "type" : "power_hook", 25 | "current_variation" : { 26 | "id" : "abc", 27 | "name" : "Variation A" 28 | } 29 | }, 30 | "456" : { 31 | "name" : "Testing w/ Main screen hidden", 32 | "id" : "456", 33 | "type" : "power_hook", 34 | "current_variation" : { 35 | "id" : "def", 36 | "name" : "Variation B" 37 | } 38 | }, 39 | "789" : { 40 | "name" : "Testing a Message", 41 | "id" : "789", 42 | "type" : "in_app", 43 | "current_variation" : { 44 | "id" : "foobar", 45 | "name" : "Variation B" 46 | } 47 | } 48 | } 49 | "schema_version": "1.0" 50 | } 51 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/Resources/TunePlaylistEmptySegmentTests.json: -------------------------------------------------------------------------------- 1 | { 2 | "power_hooks": { 3 | "couponDiscount" : { 4 | "value" : "0.35" 5 | } 6 | }, 7 | "messages": {}, 8 | "experiment_details": {}, 9 | "segments": {}, 10 | "schema_version": "1.0" 11 | } -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/Resources/TunePlaylistMissingSegmentTests.json: -------------------------------------------------------------------------------- 1 | { 2 | "power_hooks": { 3 | "couponDiscount" : { 4 | "value" : "0.35" 5 | } 6 | }, 7 | "messages": {}, 8 | "experiment_details": {}, 9 | "schema_version": "1.0" 10 | } -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/Resources/TunePowerHookValueTests.json: -------------------------------------------------------------------------------- 1 | { 2 | "power_hooks": { 3 | "couponDiscount" : { 4 | "value" : "0.35" 5 | } 6 | }, 7 | "messages": {}, 8 | "experiment_details": {}, 9 | "segments": { 10 | "abc" : "Segment Name 1", 11 | "def" : "Segment Name 2" 12 | }, 13 | "schema_version": "1.0" 14 | } -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/SimpleObserver.h: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleObserver.h 3 | // ARUXFLIP 4 | // 5 | // Created by Kyle Slattery on 12/5/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @class TuneSkyhookPayload; 12 | 13 | @interface SimpleObserver : NSObject 14 | 15 | @property (nonatomic) int skyhookPostCount; 16 | @property (nonatomic, readonly) TuneSkyhookPayload* lastPayload; 17 | 18 | - (void)skyhookPosted:(TuneSkyhookPayload *)payload; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/SimpleObserver.m: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleObserver.m 3 | // ARUXFLIP 4 | // 5 | // Created by Kyle Slattery on 12/5/13. 6 | // 7 | // 8 | 9 | #import "SimpleObserver.h" 10 | 11 | @implementation SimpleObserver 12 | 13 | - (id)init { 14 | self = [super init]; 15 | 16 | if (self) { 17 | self.skyhookPostCount = 0; 18 | } 19 | 20 | return self; 21 | } 22 | 23 | - (void)skyhookPosted:(TuneSkyhookPayload *)payload { 24 | self.skyhookPostCount += 1; 25 | _lastPayload = payload; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/Tune+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tune+Testing.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 9/25/15. 6 | // Copyright © 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "Tune.h" 10 | #import "Tune+Internal.h" 11 | 12 | @interface Tune (Testing) 13 | 14 | + (void)setPluginName:(NSString *)pluginName; 15 | + (void)resetTuneTrackerSharedInstance; 16 | + (void)setAllowDuplicateRequests:(BOOL)allowDup; 17 | 18 | + (void)waitUntilAllOperationsAreFinishedOnQueue; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneBlankAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneBlankAppDelegate.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by John Gu on 9/15/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | @interface TuneBlankAppDelegate : UIResponder 14 | 15 | @property (nonatomic) int didRegisterCount; 16 | @property (nonatomic) int didReceiveCount; 17 | @property (nonatomic) int didReceiveLocalCount; 18 | @property (nonatomic) int didContinueCount; 19 | @property (nonatomic) int handleActionCount; 20 | @property (nonatomic) int willPresentCount; 21 | @property (nonatomic) int openURLCount; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneBlankViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneBlankViewController.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 8/28/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TuneBlankViewController : UIViewController 12 | 13 | @property (nonatomic) int viewWillAppearCount; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneBlankViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneBlankViewController.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 8/28/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneBlankViewController.h" 10 | 11 | @interface TuneBlankViewController () 12 | 13 | @end 14 | 15 | @implementation TuneBlankViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | } 20 | 21 | - (void)viewWillAppear:(BOOL)animated { 22 | [super viewWillAppear:animated]; 23 | self.viewWillAppearCount += 1; 24 | } 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneDeeplinkerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneDeepLinkerTests.m 3 | // TuneTests 4 | // 5 | // Created by Ernest Cho on 12/20/18. 6 | // Copyright © 2018 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TuneDeeplinker.h" 11 | 12 | @interface TuneDeepLinkerTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation TuneDeepLinkerTests 17 | 18 | - (void)setUp { 19 | 20 | } 21 | 22 | - (void)tearDown { 23 | 24 | } 25 | 26 | - (void)testIsTuneLink_Nil { 27 | XCTAssertFalse([TuneDeeplinker isTuneLink:nil]); 28 | } 29 | 30 | - (void)testIsTuneLink_EmptyString { 31 | XCTAssertFalse([TuneDeeplinker isTuneLink:@""]); 32 | } 33 | 34 | - (void)testIsTuneLink_InvalidURL { 35 | XCTAssertFalse([TuneDeeplinker isTuneLink:@"12345678"]); 36 | } 37 | 38 | - (void)testIsTuneLink_Google { 39 | XCTAssertFalse([TuneDeeplinker isTuneLink:@"https://www.google.com"]); 40 | } 41 | 42 | - (void)testIsTuneLink_tlnkio { 43 | XCTAssertTrue([TuneDeeplinker isTuneLink:@"https://tlnk.io/stuff"]); 44 | } 45 | 46 | - (void)testIsTuneLink_abctlnkio { 47 | XCTAssertTrue([TuneDeeplinker isTuneLink:@"https://abc.tlnk.io/stuff"]); 48 | } 49 | 50 | - (void)testIsTuneLink_123tlnkio { 51 | XCTAssertTrue([TuneDeeplinker isTuneLink:@"https://123.tlnk.io/stuff"]); 52 | } 53 | 54 | - (void)testIsTuneLink_applink { 55 | XCTAssertTrue([TuneDeeplinker isTuneLink:@"https://app.link/stuff"]); 56 | } 57 | 58 | - (void)testIsTuneLink_abcapplink { 59 | XCTAssertTrue([TuneDeeplinker isTuneLink:@"https://abc.app.link/stuff"]); 60 | } 61 | 62 | - (void)testIsTuneLink_123applink { 63 | XCTAssertTrue([TuneDeeplinker isTuneLink:@"https://123.app.link/stuff"]); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneEventQueue+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneEventQueue+Testing.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 9/25/15. 6 | // Copyright © 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneEventQueue.h" 10 | 11 | @interface TuneEventQueue (Testing) 12 | 13 | // expose private properties 14 | @property (nonatomic, strong, readwrite) NSMutableArray *events; 15 | @property (nonatomic, weak) id delegate; 16 | 17 | + (void)resetSharedQueue; 18 | 19 | - (void)waitUntilAllOperationsAreFinishedOnQueue; 20 | - (void)cancelAllOperationsOnQueue; 21 | - (NSMutableArray *)events; 22 | - (NSDictionary *)eventAtIndex:(NSUInteger)index; 23 | - (NSUInteger)queueSize; 24 | - (void)drainQueue; 25 | - (void)dumpQueue; 26 | - (void)setForceNetworkError:(BOOL)isError code:(NSInteger)code; 27 | - (NSTimeInterval)retryDelayForAttempt:(NSInteger)attempt; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneManager+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneManager+Testing.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 9/25/15. 6 | // Copyright © 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneManager.h" 10 | 11 | @interface TuneManager (Testing) 12 | 13 | - (void) registerSkyhooks; 14 | - (void) nilModules; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneMeasureEventTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneMeasureEventTests.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Matt Gowie on 8/10/15. 6 | // Copyright (c) 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "Tune+Testing.h" 12 | #import "TuneManager.h" 13 | #import "TuneSkyhookCenter.h" 14 | #import "TuneSkyhookConstants.h" 15 | #import "TuneSkyhookPayload.h" 16 | #import "TuneSkyhookPayloadConstants.h" 17 | #import "Tune+Testing.h" 18 | #import "TuneXCTestCase.h" 19 | 20 | @interface TuneMeasureEventTests : TuneXCTestCase { 21 | TuneEvent* customEventFromSkyhook; 22 | TuneSkyhookCenter *skyhookCenter; 23 | } 24 | 25 | @end 26 | 27 | @implementation TuneMeasureEventTests 28 | 29 | - (void)setUp { 30 | [super setUp]; 31 | 32 | [Tune initializeWithTuneAdvertiserId:kTestAdvertiserId tuneConversionKey:kTestConversionKey tunePackageName:kTestBundleId]; 33 | skyhookCenter = [TuneSkyhookCenter defaultCenter]; 34 | } 35 | 36 | - (void)tearDown { 37 | waitForQueuesToFinish(); 38 | 39 | customEventFromSkyhook = nil; 40 | 41 | [skyhookCenter removeObserver:self]; 42 | 43 | [super tearDown]; 44 | } 45 | 46 | - (void)testMeasureEventPostsCustomEventSkyhook { 47 | 48 | NSLog(@"[TuneSkyhookCenter defaultCenter]: %@", [TuneSkyhookCenter defaultCenter]); 49 | [[TuneSkyhookCenter defaultCenter] addObserver:self 50 | selector:@selector(setCustomEventSkyhook:) 51 | name:TuneCustomEventOccurred 52 | object:nil]; 53 | 54 | [Tune measureEventName:@"TestingCustomEventSkyhook"]; 55 | 56 | [skyhookCenter startSkyhookQueue]; 57 | 58 | // Need to wait due to operation queue. 59 | [[Tune tuneQueue] waitUntilAllOperationsAreFinished]; 60 | [skyhookCenter waitTilQueueFinishes]; 61 | 62 | XCTAssertNotNil(customEventFromSkyhook); 63 | XCTAssertEqual(@"TestingCustomEventSkyhook", customEventFromSkyhook.eventName); 64 | } 65 | 66 | -(void)setCustomEventSkyhook:(TuneSkyhookPayload*)payload { 67 | customEventFromSkyhook = [payload userInfo][TunePayloadCustomEvent]; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneNotInitializedTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneNotInitializedTests.m 3 | // TuneTests 4 | // 5 | // Created by Audrey Troutt on 3/2/18. 6 | // Copyright © 2018 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Tune.h" 11 | #import "TuneUserProfile.h" 12 | #import "TuneManager.h" 13 | 14 | @interface TuneNotInitializedTests : XCTestCase 15 | 16 | @end 17 | 18 | @implementation TuneNotInitializedTests 19 | 20 | - (void)testProveTuneIsNotInitialized { 21 | // there's no advertiserId because no init has happened 22 | XCTAssertNil([[TuneManager currentManager].userProfile advertiserId]); 23 | // there's no conversionKey because no init has happened 24 | XCTAssertNil([[TuneManager currentManager].userProfile conversionKey]); 25 | // the package name is pulled from the test target, so it is set. 26 | XCTAssertEqualObjects(@"com.tune.TuneTests", [[TuneManager currentManager].userProfile packageName]); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneReachabilityTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneReachabilityTests.m 3 | // TuneTests 4 | // 5 | // Created by Jennifer Owens on 4/19/18. 6 | // Copyright © 2018 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "TuneReachability.h" 12 | 13 | @interface TuneReachabilityTests : XCTestCase 14 | 15 | @end 16 | 17 | @implementation TuneReachabilityTests 18 | 19 | - (void)setUp { 20 | [super setUp]; 21 | // Put setup code here. This method is called before the invocation of each test method in the class. 22 | } 23 | 24 | - (void)tearDown { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testNetworkUnreachableEnumTranslation { 30 | TuneReachability *reachability = [TuneReachability sharedInstance]; 31 | 32 | NSString *test = [reachability translateReachabilityStatus:TuneNotReachable]; 33 | XCTAssertNil(test); 34 | } 35 | 36 | - (void)testWifiEnumTranslation { 37 | TuneReachability *reachability = [TuneReachability sharedInstance]; 38 | 39 | NSString *test = [reachability translateReachabilityStatus:TuneReachableViaWiFi]; 40 | XCTAssertTrue([test isEqualToString:@"wifi"]); 41 | } 42 | 43 | - (void)testMobileEnumTranslation { 44 | TuneReachability *reachability = [TuneReachability sharedInstance]; 45 | 46 | NSString *testOfWifi = [reachability translateReachabilityStatus:TuneReachableViaWWAN]; 47 | XCTAssertTrue([testOfWifi isEqualToString:@"mobile"]); 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneSessionManager+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSessionManager+Testing.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 9/25/15. 6 | // Copyright © 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneSessionManager.h" 10 | 11 | @interface TuneSessionManager (Testing) 12 | 13 | @property (readonly) BOOL sessionStarted; 14 | @property (readonly) NSDate *sessionStartTime; 15 | @property (readonly) NSString *sessionId; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneSkyhookCenter+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneSkyhookCenter+Testing.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 9/25/15. 6 | // Copyright © 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneSkyhookCenter.h" 10 | 11 | @interface TuneSkyhookCenter (Testing) 12 | 13 | + (void)nilDefaultCenter; 14 | 15 | - (void)handleSessionStart; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneTestParams.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneTestParams.h 3 | // Tune 4 | // 5 | // Created by John Bender on 12/19/13. 6 | // Copyright (c) 2013 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TuneTestsHelper.h" 11 | 12 | #define ASSERT_KEY_VALUE( key, value ) XCTAssertTrue( [params checkKey:key isEqualToValue:value], \ 13 | @"key '%@' must equal '%@'; found '%@' instead", key, value, [params valueForKey:key] ); 14 | #define ASSERT_NO_VALUE_FOR_KEY( key ) XCTAssertFalse( [params checkKeyHasValue:key], \ 15 | @"must not have a value for '%@', but found '%@'", key, [params valueForKey:key] ); 16 | 17 | 18 | @interface TuneTestParams : NSObject 19 | 20 | @property (nonatomic, strong) NSMutableDictionary *params; 21 | 22 | - (BOOL)isEqualToParams:(TuneTestParams*)other; 23 | - (BOOL)isEmpty; 24 | 25 | - (BOOL)extractParamsFromQueryString:(NSString*)string; 26 | - (BOOL)extractParamsFromJson:(NSString*)json; 27 | 28 | - (NSString*)valueForKey:(NSString*)key; 29 | 30 | - (BOOL)checkIsEmpty; 31 | - (BOOL)checkKeyHasValue:(NSString*)key; 32 | - (BOOL)checkKey:(NSString*)key isEqualToValue:(NSString*)value; 33 | 34 | /*! 35 | Checks default values for all params except "conversion_user_agent" param. 36 | This allows running testcases that are unable to wait for user-agent population which may require ~1 sec on the main thread. 37 | */ 38 | - (BOOL)checkDefaultValues; 39 | - (BOOL)checkDataItems:(NSArray*)items; 40 | - (BOOL)checkNoDataItems; 41 | - (BOOL)checkReceiptEquals:(NSData*)receiptValue; 42 | - (BOOL)checkAppleReceiptEquals:(NSData*)receiptValue; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneTestsHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneTestsHelper.h 3 | // Tune 4 | // 5 | // Created by John Bender on 12/18/13. 6 | // Copyright (c) 2013 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | FOUNDATION_EXPORT NSString* const kTestAdvertiserId; 12 | FOUNDATION_EXPORT NSString* const kTestConversionKey; 13 | FOUNDATION_EXPORT NSString* const kTestBundleId; 14 | FOUNDATION_EXPORT const NSTimeInterval TUNE_TEST_NETWORK_REQUEST_DURATION; 15 | 16 | void RESET_EVERYTHING(void); 17 | void RESET_EVERYTHING_OPTIONAL_MOCKING(void); 18 | 19 | void REMOVE_MOCKS(void); 20 | 21 | void clearUserDefaults(void); 22 | 23 | void waitFor( NSTimeInterval duration ); 24 | void waitFor1( NSTimeInterval duration, BOOL* finished ); 25 | 26 | void waitForQueuesToFinish(void); 27 | 28 | void emptyRequestQueue(void); 29 | 30 | int char2hex(unsigned char c); 31 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneUserProfile+Testing.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneUserProfile+Testing.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Charles Gilliam on 9/25/15. 6 | // Copyright © 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneUserProfile.h" 10 | 11 | @interface TuneUserProfile (Testing) 12 | 13 | // Expose for testing 14 | @property (nonatomic, strong, readwrite) NSMutableDictionary *userVariables; 15 | 16 | - (void)storeProfileKey:(NSString *)key value:(id)value; 17 | - (void)initiateSession:(TuneSkyhookPayload *)payload; 18 | - (NSSet *)getCustomProfileVariables; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneXCTestCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // TuneXCTestCase.h 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 5/11/16. 6 | // Copyright © 2016 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TuneTestsHelper.h" 11 | #import "TuneConfiguration.h" 12 | #import "TuneManager.h" 13 | 14 | @interface TuneXCTestCase : XCTestCase 15 | 16 | /** 17 | Uses mock objects for each of the provided classes. 18 | @param classesToMock Array of class objects 19 | */ 20 | - (void)setUpWithMocks:(NSArray *)classesToMock; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /sdk-ios/Tune/TuneTests/TuneXCTestCase.m: -------------------------------------------------------------------------------- 1 | // 2 | // TuneXCTestCase.m 3 | // TuneMarketingConsoleSDK 4 | // 5 | // Created by Harshal Ogale on 5/11/16. 6 | // Copyright © 2016 Tune. All rights reserved. 7 | // 8 | 9 | #import "TuneXCTestCase.h" 10 | 11 | @implementation TuneXCTestCase 12 | 13 | - (void)setUp { 14 | [super setUp]; 15 | 16 | RESET_EVERYTHING(); 17 | } 18 | 19 | - (void)setUpWithMocks:(NSArray *)classesToMock { 20 | [super setUp]; 21 | RESET_EVERYTHING_OPTIONAL_MOCKING(); 22 | } 23 | 24 | - (void)tearDown { 25 | REMOVE_MOCKS(); 26 | 27 | [super tearDown]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune_tvOS/Tune_tvOS.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tune-tvos.h 3 | // Tune-tvos 4 | // 5 | // Created by Harshal Ogale on 12/2/15. 6 | // Copyright © 2015 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef Tune_tvos_h 12 | #define Tune_tvos_h 13 | 14 | #import "Tune.h" 15 | 16 | #endif /* Tune_tvos_h */ 17 | 18 | //! Project version number for Tune-tvos. 19 | FOUNDATION_EXPORT double Tune_tvosVersionNumber; 20 | 21 | //! Project version string for Tune-tvos. 22 | FOUNDATION_EXPORT const unsigned char Tune_tvosVersionString[]; 23 | 24 | // In this header, you should import all the public headers of your framework using statements like #import 25 | 26 | 27 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune_tvOS/Tune_tvOS.modulemap: -------------------------------------------------------------------------------- 1 | framework module Tune_tvOS { 2 | umbrella header "Tune_tvOS.h" 3 | exclude header "UIViewController+NameTag.h" 4 | 5 | export * 6 | module * { export * } 7 | } 8 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune_tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /sdk-ios/Tune/Tune_tvOSTests/Tune_tvOSTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tune_tvOSTests.m 3 | // Tune_tvOSTests 4 | // 5 | // Created by Ernest Cho on 1/26/18. 6 | // Copyright © 2018 Tune. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Tune_tvOSTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tune_tvOSTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | - (void)testHelloWorld { 40 | 41 | } 42 | 43 | - (void)helloWorldTest { 44 | 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/Bin/Release/MATPhone8SDK.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/sdk/Bin/Release/MATPhone8SDK.dll -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/Bin/Release/MATPhone8SDK.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/sdk/Bin/Release/MATPhone8SDK.pdb -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/Bin/Release/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/sdk/Bin/Release/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/MATConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MobileAppTracking 8 | { 9 | class MATConstants 10 | { 11 | public const string DOMAIN = "engine.mobileapptracking.com"; 12 | public const string IV = "heF9BATUfWuISyO8"; 13 | public const string SDK_TYPE = "windows"; 14 | public const string SDK_VERSION = "3.5.2"; 15 | public const string SETTINGS_MATID_KEY = "mat_id"; 16 | public const string SETTINGS_MATLASTOPENLOGID_KEY = "mat_last_open_log_id"; 17 | public const string SETTINGS_MATOPENLOGID_KEY = "mat_open_log_id"; 18 | public const string SETTINGS_IS_PAYING_USER_KEY = "mat_is_paying_user"; 19 | public const string SETTINGS_PHONENUMBER_KEY = "mat_phone_number"; 20 | public const string SETTINGS_USERID_KEY = "mat_user_id"; 21 | public const string SETTINGS_USEREMAIL_KEY = "mat_user_email"; 22 | public const string SETTINGS_USERNAME_KEY = "mat_user_name"; 23 | public const string SETTINGS_MATEVENTQUEUE_KEY = "mat_event_queue"; 24 | 25 | public const int MAX_NUMBER_OF_RETRY_ATTEMPTS = 5; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/MATEventItem.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace MobileAppTracking 4 | { 5 | [DataContract] 6 | public class MATEventItem 7 | { 8 | [DataMember] 9 | public string item; 10 | [DataMember] 11 | public int quantity; 12 | [DataMember] 13 | public double unit_price; 14 | [DataMember] 15 | public double revenue; 16 | 17 | [DataMember] 18 | public string attribute_sub1; 19 | [DataMember] 20 | public string attribute_sub2; 21 | [DataMember] 22 | public string attribute_sub3; 23 | [DataMember] 24 | public string attribute_sub4; 25 | [DataMember] 26 | public string attribute_sub5; 27 | 28 | public MATEventItem(string item, int quantity = 0, double unit_price = 0, double revenue = 0, 29 | string sub1 = "", string sub2 = "", string sub3 = "", string sub4 = "", string sub5 = "") 30 | { 31 | this.item = item; 32 | this.quantity = quantity; 33 | this.unit_price = unit_price; 34 | this.revenue = revenue; 35 | this.attribute_sub1 = sub1; 36 | this.attribute_sub2 = sub2; 37 | this.attribute_sub3 = sub3; 38 | this.attribute_sub4 = sub4; 39 | this.attribute_sub5 = sub5; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/MATResponse.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace MobileAppTracking 3 | { 4 | public interface MATResponse 5 | { 6 | void EnqueuedActionWithRefId(string refId); 7 | 8 | void DidSucceedWithData(string response); 9 | 10 | void DidFailWithError(string error); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/MATTestRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MobileAppTracking 4 | { 5 | public interface MATTestRequest 6 | { 7 | void ParamsToBeEncrypted(String param); 8 | 9 | void ConstructedRequest(String url); 10 | } 11 | } -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/sdk/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using System.Resources; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("MATPhone8-SDK")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("MATPhone8-SDK")] 14 | [assembly: AssemblyCopyright("Copyright © 2013")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("0bf78316-cfed-4755-93dc-06682bfd2f2a")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Revision and Build Numbers 34 | // by using the '*' as shown below: 35 | [assembly: AssemblyVersion("3.5.2.0")] 36 | [assembly: AssemblyFileVersion("3.5.2.0")] 37 | [assembly: NeutralResourcesLanguageAttribute("en-US")] 38 | -------------------------------------------------------------------------------- /sdk-windows/Phone/sdk/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/AlignmentGrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/AlignmentGrid.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/ApplicationIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/ApplicationIcon.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/BadgeLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/BadgeLogo.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/Logo.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/SplashScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/SplashScreen.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/SquareTile150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/SquareTile150x150.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/SquareTile71x71.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/SquareTile71x71.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/StoreLogo.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/Tiles/FlipCycleTileLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/Tiles/FlipCycleTileLarge.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/Tiles/FlipCycleTileMedium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/Tiles/FlipCycleTileMedium.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/Tiles/FlipCycleTileSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/Tiles/FlipCycleTileSmall.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/Tiles/IconicTileMediumLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/Tiles/IconicTileMediumLarge.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/Tiles/IconicTileSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/Tiles/IconicTileSmall.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Assets/WideLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Phone/test_app/Assets/WideLogo.png -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/LocalizedStrings.cs: -------------------------------------------------------------------------------- 1 | using MATPhone8TestApp.Resources; 2 | 3 | namespace MATPhone8TestApp 4 | { 5 | /// 6 | /// Provides access to string resources. 7 | /// 8 | public class LocalizedStrings 9 | { 10 | private static AppResources _localizedResources = new AppResources(); 11 | 12 | public AppResources LocalizedResources { get { return _localizedResources; } } 13 | } 14 | } -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | MATPhone8-TestApp 12 | johng 13 | Assets\StoreLogo.png 14 | 15 | 16 | 17 | 6.3.1 18 | 6.3.1 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | AgHostSvcs.dll 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Properties/AppManifest.xml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using System.Resources; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("MATPhone8-TestApp")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("MATPhone8-TestApp")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("0c37c311-649d-44cb-9243-2ea90b9bd64a")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Revision and Build Numbers 34 | // by using the '*' as shown below: 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | [assembly: NeutralResourcesLanguageAttribute("en-US")] 38 | -------------------------------------------------------------------------------- /sdk-windows/Phone/test_app/Properties/WMAppManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Assets\ApplicationIcon.png 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Assets\Tiles\FlipCycleTileSmall.png 17 | 0 18 | Assets\Tiles\FlipCycleTileMedium.png 19 | MAT Test App 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /sdk-windows/Universal/sdk/MATConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MobileAppTracking 8 | { 9 | class MATConstants 10 | { 11 | public const string DOMAIN = "engine.mobileapptracking.com"; 12 | public const string IV = "heF9BATUfWuISyO8"; 13 | public const string SDK_TYPE = "windows"; 14 | public const string SDK_VERSION = "3.6.0"; 15 | public const string SETTINGS_MATEVENTQUEUE_KEY = "mat_event_queue"; 16 | public const string SETTINGS_MATEVENTQUEUE_DATA_KEY = "mat_event_queue_data"; 17 | public const string SETTINGS_MATEVENTQUEUE_ATTEMPT_KEY = "mat_event_queue_attempt"; 18 | public const string SETTINGS_MATEVENTQUEUESIZE_KEY = "mat_event_queue_size"; 19 | public const string SETTINGS_MATID_KEY = "mat_id"; 20 | public const string SETTINGS_MATLASTOPENLOGID_KEY = "mat_last_open_log_id"; 21 | public const string SETTINGS_MATOPENLOGID_KEY = "mat_open_log_id"; 22 | public const string SETTINGS_IS_PAYING_USER_KEY = "mat_is_paying_user"; 23 | public const string SETTINGS_PHONENUMBER_KEY = "mat_phone_number"; 24 | public const string SETTINGS_USERID_KEY = "mat_user_id"; 25 | public const string SETTINGS_USEREMAIL_KEY = "mat_user_email"; 26 | public const string SETTINGS_USERNAME_KEY = "mat_user_name"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk-windows/Universal/sdk/MATEventItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MobileAppTracking 4 | { 5 | public class MATEventItem : Object 6 | { 7 | public string item; 8 | public int quantity; 9 | public double unit_price; 10 | public double revenue; 11 | 12 | public string attribute_sub1; 13 | public string attribute_sub2; 14 | public string attribute_sub3; 15 | public string attribute_sub4; 16 | public string attribute_sub5; 17 | 18 | public MATEventItem(string item, int quantity = 0, double unit_price = 0, double revenue = 0, 19 | string sub1 = "", string sub2 = "", string sub3 = "", string sub4 = "", string sub5 = "") 20 | { 21 | this.item = item; 22 | this.quantity = quantity; 23 | this.unit_price = unit_price; 24 | this.revenue = revenue; 25 | this.attribute_sub1 = sub1; 26 | this.attribute_sub2 = sub2; 27 | this.attribute_sub3 = sub3; 28 | this.attribute_sub4 = sub4; 29 | this.attribute_sub5 = sub5; 30 | } 31 | 32 | public override bool Equals(Object obj) 33 | { 34 | // If parameter is null return false. 35 | if (obj == null) 36 | { 37 | return false; 38 | } 39 | 40 | // If parameter cannot be cast to MATEventItem return false. 41 | MATEventItem p = obj as MATEventItem; 42 | if ((Object)p == null) 43 | { 44 | return false; 45 | } 46 | 47 | // Return true if the fields match: 48 | return (item.Equals(p.item) && 49 | quantity.Equals(p.quantity) && 50 | unit_price.Equals(p.unit_price) && 51 | revenue.Equals(p.revenue) && 52 | attribute_sub1.Equals(p.attribute_sub1) && 53 | attribute_sub2.Equals(p.attribute_sub2) && 54 | attribute_sub3.Equals(p.attribute_sub3) && 55 | attribute_sub4.Equals(p.attribute_sub4) && 56 | attribute_sub5.Equals(p.attribute_sub5)); 57 | } 58 | 59 | public override int GetHashCode() 60 | { 61 | return base.GetHashCode(); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /sdk-windows/Universal/sdk/MATResponse.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace MobileAppTracking 3 | { 4 | public interface MATResponse 5 | { 6 | void EnqueuedActionWithRefId(string refId); 7 | 8 | void DidSucceedWithData(string response); 9 | 10 | void DidFailWithError(string error); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sdk-windows/Universal/sdk/MATTestRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MobileAppTracking 4 | { 5 | public interface MATTestRequest 6 | { 7 | void ParamsToBeEncrypted(String param); 8 | 9 | void ConstructedRequest(String url); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sdk-windows/Universal/sdk/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MATWindowsUniversal-SDK")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MATWindowsUniversal-SDK")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("3.6.0.0")] 28 | [assembly: AssemblyFileVersion("3.6.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /sdk-windows/Universal/sdk/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/Assets/Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Universal/test_app/Assets/Logo.scale-100.png -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/Assets/SmallLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Universal/test_app/Assets/SmallLogo.scale-100.png -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Universal/test_app/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Universal/test_app/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | TestApp81 6 | John 7 | Assets\StoreLogo.png 8 | 9 | 10 | 6.3.0 11 | 6.3.0 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MATWindows8.1-TestApp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MATWindows8.1-TestApp")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /sdk-windows/Universal/test_app/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/Images/UnitTestLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Universal/unit_test/Images/UnitTestLogo.scale-100.png -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/Images/UnitTestSmallLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Universal/unit_test/Images/UnitTestSmallLogo.scale-100.png -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/Images/UnitTestSplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Universal/unit_test/Images/UnitTestSplashScreen.scale-100.png -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/Images/UnitTestStoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/Universal/unit_test/Images/UnitTestStoreLogo.scale-100.png -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/MATTestConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MATWindows81UnitTest 8 | { 9 | class MATTestConstants 10 | { 11 | public static string ADVERTISER_ID = "877"; 12 | public static string KEY = "8c14d6bbe466b65211e781d62e301eec"; 13 | public static string PACKAGE_NAME = "com.mobileapptracking.windowsunittest"; 14 | public static string APP_VERSION = "1.0.0.0"; 15 | public static string DEVICE_BRAND = "VMware, Inc."; 16 | public static string DEVICE_MODEL = "VMware Virtual Platform"; 17 | public static string USER_AGENT = "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; WebView/2.0; rv:11.0) like Gecko"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/MATUnitTest.cs: -------------------------------------------------------------------------------- 1 | using MobileAppTracking; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; 9 | using System.Diagnostics; 10 | 11 | namespace MATWindows81UnitTest 12 | { 13 | public class MATUnitTest : MATTestRequest 14 | { 15 | protected MATTestParams param; 16 | 17 | [TestInitialize] 18 | public virtual void Setup() 19 | { 20 | MATTestWrapper.InitializeValues(MATTestConstants.ADVERTISER_ID, MATTestConstants.KEY); 21 | MATTestWrapper.Instance.SetMATEventQueueWrapper(); 22 | MATTestWrapper.Instance.SetMatTestRequest(this); 23 | 24 | MATTestWrapper.Instance.SetAllowDuplicates(true); 25 | MATTestWrapper.Instance.SetDebugMode(true); 26 | MATTestWrapper.Instance.SetPackageName(MATTestConstants.PACKAGE_NAME); 27 | 28 | param = new MATTestParams(); 29 | } 30 | 31 | public void AssertKeyValue(string key, string value) 32 | { 33 | Assert.IsTrue(value.Equals(param.ValueForKey(key))); 34 | } 35 | 36 | public void AssertNoValueForKey(string key) 37 | { 38 | Assert.IsFalse(param.CheckKeyHasValue(key)); 39 | } 40 | 41 | public void ParamsToBeEncrypted(string data) 42 | { 43 | Assert.IsTrue(param.ExtractParamsString(data)); 44 | } 45 | 46 | public void ConstructedRequest(string url) 47 | { 48 | Assert.IsTrue(param.ExtractParamsString(url)); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | MATWindows81UnitTest 6 | johng 7 | Images\UnitTestStoreLogo.png 8 | MATWindows8._1UnitTest 9 | 10 | 11 | 6.3.0 12 | 6.3.0 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MATWindows8.1UnitTest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MATWindows8.1UnitTest")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | -------------------------------------------------------------------------------- /sdk-windows/Universal/unit_test/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /sdk-windows/builds/MATPhone8SDK.dll.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/builds/MATPhone8SDK.dll.lnk -------------------------------------------------------------------------------- /sdk-windows/builds/MATWindowsUniversalSDK.dll.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BranchMetrics/sdk-release/5039ba92748bf9dd2bdf9ca8dff4264fdb9b6985/sdk-windows/builds/MATWindowsUniversalSDK.dll.lnk -------------------------------------------------------------------------------- /sdk-windows/sdk-winrt/Tune.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TuneEvent.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | using namespace std; 11 | 12 | namespace TuneSDK 13 | { 14 | class Tune 15 | { 16 | public: 17 | Tune(wstring tune_advertiser_id, wstring tune_conversion_key); 18 | void MeasureSession(); 19 | void MeasureEvent(wstring event_name); 20 | void MeasureEvent(TuneEvent tune_event); 21 | void SetDebugMode(bool debug); 22 | void SetExistingUser(bool existing); 23 | void SetFacebookUserId(wstring id); 24 | void SetGoogleUserId(wstring id); 25 | void SetPackageName(wstring package_name); 26 | void SetTwitterUserId(wstring id); 27 | void SetUserId(wstring id); 28 | private: 29 | Microsoft::WRL::ComPtr httpClient; 30 | Microsoft::WRL::ComPtr response; 31 | 32 | void Measure(TuneEvent tune_event); 33 | wstring BuildUrl(wstring action, TuneEvent tune_event); 34 | void HttpGet(wstring url); 35 | wstring CreateGuid(); 36 | time_t UnixTimestamp(); 37 | wstring SafeAppend(wstring url, wstring key, wstring value); 38 | wstring SafeAppend(wstring url, wstring key, time_t value); 39 | wstring SafeAppend(wstring url, wstring key, int value); 40 | wstring SafeAppend(wstring url, wstring key, double value); 41 | }; 42 | } -------------------------------------------------------------------------------- /sdk-windows/sdk-winrt/TuneEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "TuneEvent.h" 3 | 4 | #include 5 | 6 | HRESULT TuneEvent::StringifyEventItems(HSTRING *result) { 7 | HRESULT hr; 8 | 9 | ComPtr jsonArray; 10 | if (FAILED(hr = Windows::Foundation::ActivateInstance(Wrappers::HStringReference(RuntimeClass_Windows_Data_Json_JsonArray).Get(), &jsonArray))) 11 | return hr; 12 | 13 | ComPtr> jsonArrayVector; 14 | if (FAILED(hr = jsonArray.As(&jsonArrayVector))) 15 | return hr; 16 | 17 | ComPtr jsonValueStatics; 18 | if (FAILED(hr = Foundation::GetActivationFactory(Wrappers::HStringReference(RuntimeClass_Windows_Data_Json_JsonValue).Get(), &jsonValueStatics))) 19 | return hr; 20 | 21 | ComPtr jsonValue; 22 | 23 | // Iterate through event items and add to JsonArray 24 | for (auto item = event_items.begin(); item != event_items.end(); ++item) { 25 | Wrappers::HString itemString; 26 | if (FAILED(hr = item->Stringify(itemString.GetAddressOf()))) 27 | return hr; 28 | 29 | if (FAILED(hr = jsonValueStatics->Parse(itemString.Get(), &jsonValue))) 30 | return hr; 31 | 32 | if (FAILED(hr = jsonArrayVector->Append(jsonValue.Get()))) 33 | return hr; 34 | } 35 | 36 | if (FAILED(hr = jsonArray.As(&jsonValue))) 37 | return hr; 38 | 39 | return jsonValue->Stringify(result); 40 | } -------------------------------------------------------------------------------- /sdk-windows/sdk-winrt/TuneEvent.h: -------------------------------------------------------------------------------- 1 | #include "TuneEventItem.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | struct TuneEvent { 9 | wstring event_name; 10 | int event_id = 0; 11 | double revenue = 0; 12 | wstring currency_code; 13 | wstring advertiser_ref_id; 14 | vector event_items; 15 | wstring content_type; 16 | wstring content_id; 17 | int level = 0; 18 | int quantity = 0; 19 | wstring search_string; 20 | double rating = 0; 21 | time_t date1 = 0; 22 | time_t date2 = 0; 23 | wstring attribute1; 24 | wstring attribute2; 25 | wstring attribute3; 26 | wstring attribute4; 27 | wstring attribute5; 28 | 29 | HRESULT StringifyEventItems(HSTRING *result); 30 | }; -------------------------------------------------------------------------------- /sdk-windows/sdk-winrt/TuneEventItem.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct TuneEventItem { 7 | wstring name; 8 | int quantity = 0; 9 | double revenue = 0; 10 | double unit_price = 0; 11 | wstring attribute1; 12 | wstring attribute2; 13 | wstring attribute3; 14 | wstring attribute4; 15 | wstring attribute5; 16 | 17 | HRESULT Stringify(HSTRING *result); 18 | }; -------------------------------------------------------------------------------- /sdk-windows/sdk-winrt/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /sdk-windows/sdk-winrt/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "targetver.h" 4 | 5 | #ifndef WIN32_LEAN_AND_MEAN 6 | #define WIN32_LEAN_AND_MEAN 7 | #endif 8 | 9 | #include 10 | 11 | #include 12 | using namespace Microsoft::WRL; 13 | using namespace ABI::Windows; 14 | -------------------------------------------------------------------------------- /sdk-windows/sdk-winrt/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | --------------------------------------------------------------------------------