Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #33 from Adobe-Marketing-Cloud/january
Browse files Browse the repository at this point in the history
January changes
  • Loading branch information
hunterpeterson committed Jan 16, 2015
2 parents 0482f9c + 7136785 commit eb8586d
Show file tree
Hide file tree
Showing 47 changed files with 229 additions and 54 deletions.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions sdks/Android/ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Included are notes from the latest major revision to current.
For full SDK documentation, please visit:
https://marketing.adobe.com/resources/help/en_US/mobile/android/

4.4.0 (15 Jan, 2015)
- New - Ability to add custom context data to lifecycle
- Version is now included in the jar file name.

4.3.0 (20 Nov, 2014)
- New - Adobe Marketing Cloud ID integration
- Improved debug logs for clarity
Expand Down
83 changes: 79 additions & 4 deletions sdks/Cordova/ADBMobile/Android/ADBMobile_PhoneGap.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.adobe;
package com.sample.phonegap;

import android.location.Location;
import android.util.Log;
import android.widget.Switch;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CallbackContext;

import org.json.JSONArray;
Expand Down Expand Up @@ -76,6 +75,12 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
} else if (action.equals("trackLocation")) {
this.trackLocation(args, callbackContext);
return true;
} else if (action.equals("trackBeacon")) {
this.trackBeacon(args, callbackContext);
return true;
} else if (action.equals("trackingClearCurrentBeacon")) {
this.trackingClearCurrentBeacon(callbackContext);
return true;
} else if (action.equals("trackLifetimeValueIncrease")) {
this.trackLifetimeValueIncrease(args, callbackContext);
return true;
Expand Down Expand Up @@ -331,6 +336,55 @@ public void run() {
}));
}

private void trackBeacon(final JSONArray args, final CallbackContext callbackContext) {
cordova.getThreadPool().execute((new Runnable() {
@Override
public void run() {
try {
HashMap<String, Object> cData = null;
String uuid = args.getString(0);
String major = args.getString(1);
String minor = args.getString(2);
int proxInt = Integer.parseInt(args.getString(3));
Analytics.BEACON_PROXIMITY prox = proxInt >= 0 && proxInt < Analytics.BEACON_PROXIMITY.values().length ?
Analytics.BEACON_PROXIMITY.values()[proxInt]: Analytics.BEACON_PROXIMITY.values()[0];


// set cData if it is passed in along with action
if (args.get(4) != JSONObject.NULL)
{
JSONObject cDataJSON = args.getJSONObject(4);
if (cDataJSON != null && cDataJSON.length() > 0)
cData = GetHashMapFromJSON(cDataJSON);
}

Analytics.trackBeacon(uuid, major, minor, prox, cData);
callbackContext.success();
}
catch (JSONException e) {
e.printStackTrace();
callbackContext.error(e.getMessage());
}
catch (NumberFormatException e) {
e.printStackTrace();
callbackContext.error(e.getMessage());
}


}
}));
}

private void trackingClearCurrentBeacon(final CallbackContext callbackContext) {
cordova.getThreadPool().execute((new Runnable() {
@Override
public void run() {
Analytics.clearBeacon();
callbackContext.success();
}
}));
}

private void trackLifetimeValueIncrease(final JSONArray args, final CallbackContext callbackContext) {
cordova.getThreadPool().execute((new Runnable() {
@Override
Expand Down Expand Up @@ -587,4 +641,25 @@ private HashMap<String, Object> GetHashMapFromJSON(JSONObject data) {
table.putAll(map);
return table;
}
}

// =====================
// Plugin life cycle events
// =====================
@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
com.adobe.mobile.Config.setContext(this.cordova.getActivity().getApplicationContext());
}

@Override
public void onPause(boolean multitasking) {
super.onPause(multitasking);
com.adobe.mobile.Config.pauseCollectingLifecycleData();
}

@Override
public void onResume(boolean multitasking) {
super.onResume(multitasking);
com.adobe.mobile.Config.collectLifecycleData(this.cordova.getActivity());
}
}
Original file line number Diff line number Diff line change
@@ -1,58 +1,62 @@
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2013 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
*
**************************************************************************/

*
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2014 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
*
**************************************************************************/
var ADB = (function () {
var ADB = (typeof exports !== 'undefined') && exports || {};

var ADB = {
};

ADB.doNothing = function () {};

var PLUGIN_NAME = "ADBMobile_PhoneGap";
var fTRACK_APP_STATE_WITH_CDATA = "myMethod";


ADB.optedIn = 1;
ADB.optedOut = 2;
ADB.optUnknown = 3;

ADB.beaconUnknown = 0;
ADB.beaconImmediate = 1;
ADB.beaconNear = 2;
ADB.beaconFar = 3;

ADB.trackAppState = function (stateName) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "myMethod", [stateName]);
};

ADB.getVersion = function(success, fail) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "getVersion", [null]);
}

ADB.getPrivacyStatus = function(success, fail) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "getPrivacyStatus", [null]);
}

ADB.setPrivacyStatus = function (privacyStatus) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "setPrivacyStatus", [privacyStatus]);
};
ADB.getLifetimeValue = function(success, fail) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "getLifetimeValue", [null]);

ADB.getLifetimeValue = function(success, fail) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "getLifetimeValue", [null]);
}

ADB.getUserIdentifier = function(success, fail) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "getUserIdentifier", [null]);
}

ADB.setUserIdentifier = function (userIdentifier) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "setUserIdentifier", [userIdentifier]);
};
Expand All @@ -72,25 +76,33 @@ var ADB = (function () {
ADB.collectLifecycleData = function(success, fail) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "collectLifecycleData", [null]);
}

ADB.trackState = function(stateName, cData) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "trackState", [stateName, cData]);
}

ADB.trackAction = function(action, cData) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "trackAction", [action, cData]);
}

ADB.trackActionFromBackground = function(action, cData) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "trackActionFromBackground", [action, cData]);
}

ADB.trackLocation = function(lat, long, cData) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "trackLocation", [lat, long, cData]);
}

ADB.trackLifetimeValueIncrease = function(amount, cData) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "trackLifetimeValueIncrease", [amount, cData]);

ADB.trackBeacon = function(uuid, major, minor, proximity, cData) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "trackBeacon", [uuid, major, minor, proximity, cData]);
}

ADB.clearCurrentBeacon = function(success, fail) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "trackingClearCurrentBeacon", []);
}

ADB.trackLifetimeValueIncrease = function(amount, cData) {
return cordova.exec(ADB.doNothing, ADB.doNothing, "ADBMobile_PhoneGap", "trackLifetimeValueIncrease", [amount, cData]);
}

ADB.trackTimedActionStart = function(action, cData) {
Expand Down Expand Up @@ -120,14 +132,14 @@ var ADB = (function () {
ADB.trackingGetQueueSize = function(success, fail) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "trackingGetQueueSize", []);
}

ADB.targetLoadRequest = function(success, fail, name, defaultContent, parameters) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "targetLoadRequest", [name, defaultContent, parameters]);
}

ADB.targetLoadOrderConfirmRequest = function(success, fail, name, orderId, orderTotal, productPurchaseId, parameters) {
ADB.targetLoadOrderConfirmRequest = function(success, fail, name, defaultContent, parameters) {
return cordova.exec(success, fail, "ADBMobile_PhoneGap", "targetLoadOrderConfirmRequest", [name, orderId, orderTotal, productPurchaseId, parameters]);
}

return ADB;
}());
}());
5 changes: 3 additions & 2 deletions sdks/Cordova/ADBMobile/iOS/ADBMobile_PhoneGap.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
- (void)trackAction:(CDVInvokedUrlCommand*)command;
- (void)trackActionFromBackground:(CDVInvokedUrlCommand*)command;
- (void)trackLocation:(CDVInvokedUrlCommand*)command;
- (void)trackBeacon:(CDVInvokedUrlCommand*)command;
- (void)trackingClearCurrentBeacon:(CDVInvokedUrlCommand*)command;
- (void)trackLifetimeValueIncrease:(CDVInvokedUrlCommand*)command;
- (void)trackTimedActionStart:(CDVInvokedUrlCommand*)command;
- (void)trackTimedActionUpdate:(CDVInvokedUrlCommand*)command;
Expand All @@ -43,7 +45,6 @@
- (void)trackingIdentifier:(CDVInvokedUrlCommand*)command;
- (void)trackingClearQueue:(CDVInvokedUrlCommand*)command;
- (void)trackingGetQueueSize:(CDVInvokedUrlCommand*)command;

- (void)targetLoadRequest:(CDVInvokedUrlCommand*)command;
- (void)targetLoadOrderConfirmRequest:(CDVInvokedUrlCommand*)command;
@end
@end
70 changes: 70 additions & 0 deletions sdks/Cordova/ADBMobile/iOS/ADBMobile_PhoneGap.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
#import "ADBMobile_PhoneGap.h"
#import "ADBMobile.h"

@interface ADBBeacon : NSObject
@property (nonatomic, strong) NSUUID *proximityUUID;
@property (nonatomic, strong) NSNumber *major;
@property (nonatomic, strong) NSNumber *minor;
@property (nonatomic) CLProximity proximity;
@end

@implementation ADBBeacon : NSObject
@end

@implementation ADBMobile_PhoneGap

- (void)getVersion:(CDVInvokedUrlCommand*)command {
Expand Down Expand Up @@ -298,6 +308,66 @@ - (void)trackLocation:(CDVInvokedUrlCommand *)command {
}];
}

- (void)trackBeacon:(CDVInvokedUrlCommand *)command {
[self.commandDelegate runInBackground:^{
CDVPluginResult* pluginResult = nil;
if(!NSClassFromString(@"CLLocation")) {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"CLLocation could not be found"];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
return;
}

ADBBeacon *beacon = [[ADBBeacon alloc] init];
NSDictionary *cData = [NSDictionary dictionary];

if ([[command.arguments objectAtIndex: 0] isKindOfClass:[NSString class]] && [[command.arguments objectAtIndex: 3] isKindOfClass:[NSNumber class]]) {
[beacon setProximityUUID:[[NSUUID alloc] initWithUUIDString:[command.arguments objectAtIndex: 0]]];
beacon setProximity:(CLProximity)((NSNumber*)[command.arguments objectAtIndex: 3]).intValue];
} else {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"unable to parse arguments, arguments should be [String, Number, Number, Number, Dictionary]"];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
return;
}

if ([[command.arguments objectAtIndex: 1] isKindOfClass:[NSNumber class]]
&& [[command.arguments objectAtIndex: 2] isKindOfClass:[NSNumber class]]) {
[beacon setMajor:[command.arguments objectAtIndex: 1]];
[beacon setMinor:[command.arguments objectAtIndex: 2]];
} else if ([[command.arguments objectAtIndex: 1] isKindOfClass:[NSString class]]
&& [[command.arguments objectAtIndex: 2] isKindOfClass:[NSString class]]) {
NSNumberFormatter * formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterNoStyle];

[beacon setMajor:[formatter numberFromString:[command.arguments objectAtIndex: 1]]];
[beacon setMinor:[formatter numberFromString:[command.arguments objectAtIndex: 2]]];
}
else {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"unable to parse arguments, arguments should be [String, Number, Number, Number, Dictionary]"];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
return;
}

if ([[command.arguments objectAtIndex:4] isKindOfClass:[NSDictionary class]]) {
cData = [command.arguments objectAtIndex:4];
}

[ADBMobile trackBeacon:(CLBeacon *)beacon data:cData];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];

}];
}

- (void)trackingClearCurrentBeacon:(CDVInvokedUrlCommand*)command {
[self.commandDelegate runInBackground:^{
CDVPluginResult* pluginResult = nil;

[ADBMobile trackingClearCurrentBeacon];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"Current beacon cleared."];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}];
}

- (void)trackLifetimeValueIncrease:(CDVInvokedUrlCommand*)command {
[self.commandDelegate runInBackground:^{
CDVPluginResult* pluginResult = nil;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 4 additions & 5 deletions sdks/Windows8/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
Release Notes for Windows 8 App Measurement Library version 4.x:
Release Notes for Windows Store App Measurement Library version 4.x:

Included are notes from the latest major revision to current.

For full 4.x SDK documentation please visit:
http://microsite.omniture.com/t2/help/en_US/mobile/win8/
https://marketing.adobe.com/resources/help/en_US/mobile/winu/

4.0.0 (29 May, 2014)

- Release of 4.0.0
4.0.0 (15 Jan, 2015)
- Initial Release of 4.x SDK for Windows Store Universal Apps
Loading

0 comments on commit eb8586d

Please sign in to comment.