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

Commit

Permalink
Update for iOS 3.15.0, Android 3.11.4, add getTuneId
Browse files Browse the repository at this point in the history
  • Loading branch information
John Gu committed Dec 10, 2015
1 parent caf4829 commit c425aec
Show file tree
Hide file tree
Showing 17 changed files with 211 additions and 101 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.1.0
Android SDK Version : 3.11.0
iOS SDK Version : 3.11.0
TUNE PhoneGap Plugin Version : 4.2.0
Android SDK Version : 3.11.4
iOS SDK Version : 3.15.0
94 changes: 47 additions & 47 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -25,7 +25,7 @@
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>MAT PhoneGap Test App</title>

<style>
button.btn {
width: 80%; height: 40px;
Expand All @@ -41,53 +41,53 @@
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, true);

var mat;

function onDeviceReady()
{
mat = window.plugins.matPlugin;

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

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

function setTUNEDebugMode()
{
mat.setDebugMode(true);
}

function setAllowDuplicates()
{
mat.setAllowDuplicates(true);
}

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

function startTUNE()
{
// for main app
mat.init("877", "8c14d6bbe466b65211e781d62e301eec");
mat.setPackageName("com.hasoffers.phonegaptestapp");
//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);
Expand All @@ -114,30 +114,30 @@
mat.setUserEmail("[email protected]");
mat.setUserId("tempUserId");
mat.setUserName("tempUserName");

var preloadData = {
"publisherId":"1122334455",
"publisherReferenceId":"RX1357",
"agencyId":"66554477",
"publisherSub5":"some_pub_sub_value"
};

mat.setPreloadData(preloadData);
}

function testGetters()
{
console.log('testGetters clicked');
mat.getMatId(resultHandler, errorHandler);

mat.getTuneId(resultHandler, errorHandler);
mat.getOpenLogId(resultHandler, errorHandler);
mat.getIsPayingUser(resultHandler, errorHandler);
}

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

var metadata = {
"gender": "female",
"birthdate": new Date(2015, 6, 1).getTime(),
Expand All @@ -149,46 +149,46 @@
};
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();
}

function measureEventNameTest()
{
// event name
mat.measureEvent("purchase1");

// event id
//mat.measureEvent(12345678);
}

function measureEventTest()
{
measureEventTest1();
measureEventTest2();
}

function measureEventTest1()
{
var eventItems = new Array();

var eventItem1 = {
"item":"item1",
"quantity":1,
Expand All @@ -201,15 +201,15 @@
"attribute_sub5":"5"
};
eventItems[0] = eventItem1;

var eventItem2 = {
"item":"item2",
"quantity":2,
"unit_price":0.50,
"revenue":1
};
eventItems[1] = eventItem2;

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

mat.measureEvent(matEvent1);
}

function measureEventTest2()
{
var matEvent2 = {
Expand All @@ -247,44 +247,44 @@
"attribute1": "attr1",
"attribute5": "attr5"
};

mat.measureEvent(matEvent2);
}

function getSampleiTunesIAPReceipt()
{
return "dGhpcyBpcyBhIHNhbXBsZSBpb3MgYXBwIHN0b3JlIHJlY2VpcHQ=";
}

function resultHandler (result)
{
console.log('resultHandler: ' + result);
}

function errorHandler (error)
{
console.log('errorHandler: ' + error);
}

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 Test App</h1>
Expand Down Expand Up @@ -330,4 +330,4 @@ <h1>MAT PhoneGap Test App</h1>
</div>
</div>
</body>
</html>
</html>
40 changes: 40 additions & 0 deletions ifawrapper/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "cordova-plugin-ifawrapper",
"version": "1.0.0",
"description": "This Cordova plugin allows you to retrieve the Apple Advertising Identifier from an iOS device.",
"cordova": {
"id": "cordova-plugin-ifawrapper",
"platforms": [
"ios"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/MobileAppTracking/phonegap-plugin.git"
},
"keywords": [
"cordova",
"ios",
"ifa",
"idfa",
"apple",
"advertising",
"identifier",
"advertisingIdentifier",
"AdSupport",
"ecosystem:cordova",
"cordova-ios"
],
"engines": [
{
"name": "cordova",
"version": ">=3.0.0"
}
],
"author": "John Gu",
"license": "Apache 2.0",
"bugs": {
"url": "https://github.com/MobileAppTracking/phonegap-plugin/issues"
},
"homepage": "https://github.com/MobileAppTracking/phonegap-plugin#readme"
}
8 changes: 4 additions & 4 deletions ifawrapper/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
<plugins-plist key="IFAWrapperPlugin" string="IFAWrapperPlugin" />

<config-file target="config.xml" parent="/*">
<feature name="IFAWrapperPlugin">
<param name="ios-package" value="IFAWrapperPlugin" />
<param name="onload" value="true" />
</feature>
<feature name="IFAWrapperPlugin">
<param name="ios-package" value="IFAWrapperPlugin" />
<param name="onload" value="true" />
</feature>
</config-file>

<source-file src="src/ios/IFAWrapperPlugin.m" />
Expand Down
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.1.0",
"version": "4.2.0",
"description": "This Cordova plugin allows you to measure installs and events with the TUNE SDK.",
"cordova": {
"id": "cordova-plugin-tune",
Expand Down
6 changes: 3 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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.1.0">
version="4.2.0">

<name>MATPlugin</name>

Expand Down Expand Up @@ -44,7 +44,7 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</config-file>

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

Expand All @@ -67,7 +67,7 @@
<header-file src="src/ios/MATPlugin.h" />

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

<header-file src="src/ios/MobileAppTracker.h" />
<header-file src="src/ios/MATEvent.h" />
Expand Down
Loading

0 comments on commit c425aec

Please sign in to comment.