Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Update to MAT SDK 3.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
John Gu committed Aug 25, 2015
1 parent 94c0b72 commit caf4829
Show file tree
Hide file tree
Showing 25 changed files with 2,959 additions and 667 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Please see the Quick Start guide here:

[PhoneGap Quick Start](https://developers.mobileapptracking.com/phonegap-plugin/)

TUNE PhoneGap Plugin Version : 4.0.3
Android SDK Version : 3.9.1
iOS SDK Version : 3.9.1
TUNE PhoneGap Plugin Version : 4.1.0
Android SDK Version : 3.11.0
iOS SDK Version : 3.11.0
140 changes: 115 additions & 25 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@

console.log('onDeviceReady: mat = ' + mat);
}

function handleOpenURL(url)
{
console.log('handleOpenURL: url = ' + url);
}

function setMATDebugMode()
function setTUNEDebugMode()
{
mat.setDebugMode(true);
}
Expand All @@ -66,26 +66,34 @@
mat.setAllowDuplicates(true);
}

function setMATDelegate()
function setTUNEDelegate()
{
mat.setDelegate(true);
mat.setDelegate(true, resultHandler, errorHandler);
}

function startMAT()
function startTUNE()
{
// for main app
mat.init("877", "8c14d6bbe466b65211e781d62e301eec");
mat.setPackageName("com.hasoffers.phonegaptestapp");
mat.checkForDeferredDeeplink(750); // 750 ms
//mat.init("877", "8c14d6bbe466b65211e781d62e301eec", "com.hasoffers.phonegaptestapp", false);

// for wearables (e.g. Apple Watch)
//mat.init("877", "8c14d6bbe466b65211e781d62e301eec", "com.hasoffers.phonegaptestapp", true);

mat.setDelegate(true, resultHandler, errorHandler);

mat.checkForDeferredDeeplink(deeplinkReceived, deeplinkFailed);

mat.automateIapEventMeasurement(true);
}

function testSetters()
{
mat.setAge(23);
mat.setAppAdTracking(true);
mat.setAppAdMeasurement(true);
mat.setAppleVendorIdentifier("12345678-1234-1234-1234-123456789012");
mat.setCurrencyCode("AUD");

mat.setExistingUser(false);
mat.setFacebookEventLogging(true, false);
mat.setFacebookUserId("198273645");
Expand All @@ -96,13 +104,17 @@
mat.setLocationWithAltitude(3.3, 4.4, 5.5);
mat.setPackageName("com.mycompany.myapp");
mat.setPayingUser(true);
mat.setShouldAutoCollectAppleAdvertisingIdentifier(true);
mat.setShouldAutoCollectDeviceLocation(true);
mat.setShouldAutoDetectJailbroken(true);
mat.setShouldAutoGenerateAppleVendorIdentifier(true);
mat.setTRUSTeId("tempTrusteId");
mat.setTwitterUserId("1357908642");
mat.setUseCookieTracking(false);
mat.setUseCookieMeasurement(false);
mat.setUserEmail("[email protected]");
mat.setUserId("tempUserId");
mat.setUserName("tempUserName");

var preloadData = {
"publisherId":"1122334455",
"publisherReferenceId":"RX1357",
Expand All @@ -122,6 +134,37 @@
mat.getIsPayingUser(resultHandler, errorHandler);
}

function showInterstitial()
{
console.log('showInterstitial clicked');

var metadata = {
"gender": "female",
"birthdate": new Date(2015, 6, 1).getTime(),
"latitude": 67.88,
"longitude": -122.33,
"keywords": ["game", "puzzle", "animals"],
"customTargets": { "key1": "value1", "key2": "value2" },
"debug": true
};
mat.showInterstitial("Test", metadata);
}

function showBanner() {
console.log('showBanner clicked');
mat.showBanner("Test", null, 0);
}

function showBannerTop() {
console.log('showBannerTop clicked');
mat.showBanner("Test", null, 1);
}

function hideBanner() {
console.log('hideBanner clicked');
mat.hideBanner();
}

function measureSessionTest()
{
mat.measureSession();
Expand All @@ -131,7 +174,7 @@
{
// event name
mat.measureEvent("purchase1");

// event id
//mat.measureEvent(12345678);
}
Expand Down Expand Up @@ -166,7 +209,7 @@
"revenue":1
};
eventItems[1] = eventItem2;

var matEvent1 = {
"name": "purchase2",
"revenue": 0.99,
Expand All @@ -188,7 +231,7 @@
"attribute4": "attr4",
"attribute5": "attr5"
};

mat.measureEvent(matEvent1);
}

Expand Down Expand Up @@ -223,21 +266,68 @@
console.log('errorHandler: ' + error);
}

</script>
function deeplinkReceived (deeplink)
{
console.log('deferred deeplink success: ' + deeplink);

// TODO: add your code to handle the deeplink url as appropriate
}

function deeplinkFailed (error)
{
console.log('deferred deeplink failed: ' + error);
}

function handleOpenURL(url)
{
console.log('deeplink-url to be opened: ' + url);
}

</script>

<div>
<br>
<h1>MAT PhoneGap TestApp</h1>
<h1>MAT PhoneGap Test App</h1>
<br>
<div class="btnDiv"><button id="btnStart" class="btn" onclick="startMAT();">Start MAT</button></div>
<div class="btnDiv"><button id="btnDebug" class="btn" onclick="setMATDebugMode();">MAT Debug Mode</button></div>
<div class="btnDiv"><button id="btnAllowDuplicates" class="btn" onclick="setAllowDuplicates();">MAT Allow Duplicates</button></div>
<div class="btnDiv"><button id="btnDelegate" class="btn" onclick="setMATDelegate();">MAT Delegate</button></div>
<div class="btnDiv"><button id="btnSession" class="btn" onclick="measureSessionTest();">Measure Session</button></div>
<div class="btnDiv"><button id="btnEventName" class="btn" onclick="measureEventNameTest();">Measure Event Name</button></div>
<div class="btnDiv"><button id="btnEvent" class="btn" onclick="measureEventTest();">Measure Event With Items</button></div>
<div class="btnDiv"><button id="btnSetters" class="btn" onclick="testSetters();">Test Setter Methods</button></div>
<div class="btnDiv"><button id="btnGetters" class="btn" onclick="testGetters();">Test Getter Methods</button></div>
<div class="btnDiv">
<button id="btnStart" class="btn" onclick="startTUNE();">Start MAT SDK</button>
</div>
<div class="btnDiv">
<button id="btnDebug" class="btn" onclick="setTUNEDebugMode();">MAT Debug Mode</button>
</div>
<div class="btnDiv">
<button id="btnAllowDuplicates" class="btn" onclick="setAllowDuplicates();">MAT Allow Duplicates</button>
</div>
<div class="btnDiv">
<button id="btnDelegate" class="btn" onclick="setTUNEDelegate();">MAT Delegate</button>
</div>
<div class="btnDiv">
<button id="btnSession" class="btn" onclick="measureSessionTest();">Measure Session</button>
</div>
<div class="btnDiv">
<button id="btnEventName" class="btn" onclick="measureEventNameTest();">Measure Event Name</button>
</div>
<div class="btnDiv">
<button id="btnEvent" class="btn" onclick="measureEventTest();">Measure Event With Items</button>
</div>
<div class="btnDiv">
<button id="btnSetters" class="btn" onclick="testSetters();">Test Setter Methods</button>
</div>
<div class="btnDiv">
<button id="btnGetters" class="btn" onclick="testGetters();">Test Getter Methods</button>
</div>
<div class="btnDiv">
<button id="btnShowInterstitial" class="btn" onclick="showInterstitial();">Show Interstitial</button>
</div>
<div class="btnDiv">
<button id="btnShowBanner" class="btn" onclick="showBanner();">Show Banner</button>
</div>
<div class="btnDiv">
<button id="btnShowBannerTop" class="btn" onclick="showBannerTop();">Show Banner Top</button>
</div>
<div class="btnDiv">
<button id="btnHideBanner" class="btn" onclick="hideBanner();">Hide Banner</button>
</div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-tune",
"version": "4.0.3",
"version": "4.1.0",
"description": "This Cordova plugin allows you to measure installs and events with the TUNE SDK.",
"cordova": {
"id": "cordova-plugin-tune",
Expand Down
27 changes: 20 additions & 7 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-tune"
version="4.0.3">
version="4.1.0">

<name>MATPlugin</name>

<description>This plugin allows you to track installs and events using MobileAppTracking.</description>
<repo>https://github.com/MobileAppTracking/phonegap-plugin.git</repo>
<keywords>cordova,mat,mobileapptracking,tracking</keywords>
<keywords>cordova,mat,mobileapptracking,tracking,tune</keywords>
<license>Apache 2.0</license>

<engines>
Expand Down Expand Up @@ -39,10 +39,12 @@
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<activity
android:name="com.tune.crosspromo.TuneAdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</config-file>

<source-file src="src/android/lib/MobileAppTracker-3.9.1.jar" target-dir="libs/" />
<source-file src="src/android/lib/MobileAppTracker-3.11.0.jar" target-dir="libs/" />
<source-file src="src/android/com/mobileapptracking/MATPlugin.java"
target-dir="src/com/mobileapptracking" />

Expand All @@ -64,14 +66,25 @@
<source-file src="src/ios/MATPlugin.m" />
<header-file src="src/ios/MATPlugin.h" />

<!-- MobileAppTracker framework -->
<source-file src="src/ios/MobileAppTracker-3.9.1.a" framework="true" />

<!-- TUNE framework -->
<source-file src="src/ios/MobileAppTracker-3.11.0.a" framework="true" />
<header-file src="src/ios/MobileAppTracker.h" />
<header-file src="src/ios/MATEvent.h" />
<header-file src="src/ios/MATEventItem.h" />
<header-file src="src/ios/MATPreloadData.h" />

<header-file src="src/ios/Tune.h" />
<header-file src="src/ios/TuneEvent.h" />
<header-file src="src/ios/TuneEventItem.h" />
<header-file src="src/ios/TuneLocation.h" />
<header-file src="src/ios/TunePreloadData.h" />

<header-file src="src/ios/TuneAdMetadata.h" />
<header-file src="src/ios/TuneAdView.h" />
<header-file src="src/ios/TuneBanner.h" />
<header-file src="src/ios/TuneInterstitial.h" />

<!-- system frameworks -->
<framework src="AdSupport.framework" />
<framework src="CoreTelephony.framework" />
Expand Down
Loading

0 comments on commit caf4829

Please sign in to comment.