Skip to content

Commit

Permalink
Merge pull request #42 from adjust/v4140
Browse files Browse the repository at this point in the history
Version 4.14.0
  • Loading branch information
uerceg authored Jun 18, 2018
2 parents b600bf7 + 94e6562 commit ec07344
Show file tree
Hide file tree
Showing 110 changed files with 5,276 additions and 264 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ gen
*.iml
bin/
Adjust-*.*.*.ane
AdjustTest-*.*.*.ane
!example/lib/Adjust-*.*.*.ane
!test/app/lib/AdjustTest-*.*.*.ane

### Xcode ###
build/
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### Version 4.14.0 (18th June 2018)
#### Added
- Added deep link caching in case `appWillOpenUrl` method is called natively before SDK is initialised.

#### Changed
- Updated the way how iOS native bridge handles push tokens from Unity interface - they are now being passed directly as strings to native iOS SDK.

#### Native SDKs
- [[email protected]][ios_sdk_v4.14.1]
- [[email protected]][android_sdk_v4.14.0]

---

### Version 4.13.0 (23rd May 2018)
#### Added
- Added `gdprForgetMe` method to `Adjsut` interface to enable possibility for user to be forgotten in accordance with GDPR law.
Expand Down Expand Up @@ -353,6 +366,7 @@
[ios_sdk_v4.12.1]: https://github.com/adjust/ios_sdk/tree/v4.12.1
[ios_sdk_v4.12.3]: https://github.com/adjust/ios_sdk/tree/v4.12.3
[ios_sdk_v4.13.0]: https://github.com/adjust/ios_sdk/tree/v4.13.0
[ios_sdk_v4.14.1]: https://github.com/adjust/ios_sdk/tree/v4.14.1

[android_sdk_v2.1.3]: https://github.com/adjust/android_sdk/tree/v2.1.3
[android_sdk_v2.1.4]: https://github.com/adjust/android_sdk/tree/v2.1.4
Expand All @@ -370,3 +384,4 @@
[android_sdk_v4.12.1]: https://github.com/adjust/android_sdk/tree/v4.12.1
[android_sdk_v4.12.4]: https://github.com/adjust/android_sdk/tree/v4.12.4
[android_sdk_v4.13.0]: https://github.com/adjust/android_sdk/tree/v4.13.0
[android_sdk_v4.14.0]: https://github.com/adjust/android_sdk/tree/v4.14.0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.13.0
4.14.0
8 changes: 8 additions & 0 deletions default/src/com/adjust/sdk/Adjust.as
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,13 @@ package com.adjust.sdk {
public static function gdprForgetMe():void {
trace("Adjust: gdprForgetMe called");
}

public static function setTestOptions(testOptions:AdjustTestOptions):void {
trace("Adjust: setTestOptions called");
}

public static function teardown():void {
trace("Adjust: teardown called");
}
}
}
18 changes: 18 additions & 0 deletions default/src/com/adjust/sdk/AdjustTestOptions.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.adjust.sdk {
public class AdjustTestOptions {
public var teardown:Boolean = false;
public var hasContext:Boolean = false;
public var noBackoffWait:Boolean = false;
public var tryInstallReferrer:Boolean = false;
public var useTestConnectionOptions:Boolean = false;

public var baseUrl:String = null;
public var gdprUrl:String = null;
public var basePath:String = null;
public var gdprPath:String = null;
public var timerStartInMilliseconds:String = null;
public var timerIntervalInMilliseconds:String = null;
public var sessionIntervalInMilliseconds:String = null;
public var subsessionIntervalInMilliseconds:String = null;
}
}
2 changes: 1 addition & 1 deletion doc/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your adjust SDK for Adobe AIR to 4.13.0 from 3.4.3
## Migrate your adjust SDK for Adobe AIR to 4.14.0 from 3.4.3

### SDK initialization

Expand Down
2 changes: 1 addition & 1 deletion example/Main-app.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/28.0">
<id>com.adjust.examples</id>
<versionNumber>4.13.0</versionNumber>
<versionNumber>4.14.0</versionNumber>
<filename>Adjust AIR SDK Demo</filename>

<initialWindow>
Expand Down
50 changes: 35 additions & 15 deletions ext/Android/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
#!/usr/bin/env bash

# - Build the JAR file
# - Copy the JAR file to the root dir
# ======================================== #

# End script if one of the lines fails
set -e
# Colors for output
NC='\033[0m'
RED='\033[0;31m'
CYAN='\033[1;36m'
GREEN='\033[0;32m'

# ======================================== #

# Script usage hint
if [ $# -ne 1 ]; then
echo $0: "usage: ./build.sh [debug || release]"
exit 1
fi

# ======================================== #

BUILD_TYPE=$1

# Get the current directory (ext/android/)
# Set directories of interest for the script
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Traverse up to get to the root directory
ROOT_DIR="$(dirname "$ROOT_DIR")"
ROOT_DIR="$(dirname "$ROOT_DIR")"
EXT_DIR=ext/android
Expand All @@ -25,30 +30,45 @@ JAR_IN_DIR=src/AdjustExtension/extension/build/outputs
EXTENSION_SOURCE_DIR=src/AdjustExtension/extension/src/main/java/com/adjust/sdk
SDK_SOURCE_DIR=sdk/Adjust/adjust/src/main/java/com/adjust/sdk

RED='\033[0;31m' # Red color
GREEN='\033[0;32m' # Green color
NC='\033[0m' # No Color
# ======================================== #

echo -e "${GREEN}>>> Remove all non-AdjustExtension related files${NC}"
echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Removing all files not related to Adjust extension ... ${NC}"
cd ${ROOT_DIR}/${EXT_DIR}/${EXTENSION_SOURCE_DIR}
mv -v AdjustActivity.java AdjustExtension.java AdjustFunction.java AdjustContext.java ..
rm -rv *
mv -v ../Adjust*.java .
echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Done! ${NC}"

echo -e "${GREEN}>>> Copy all files from ${SDK_SOURCE_DIR} to ${EXTENSION_SOURCE_DIR}${NC}"
# ======================================== #

echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Copying files from ${SDK_SOURCE_DIR} to ${EXTENSION_SOURCE_DIR} ... ${NC}"
cd ${ROOT_DIR}/${EXT_DIR}/${SDK_SOURCE_DIR}
cp -rv * ${ROOT_DIR}/${EXT_DIR}/${EXTENSION_SOURCE_DIR}
echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Done! ${NC}"

# ======================================== #

cd ${ROOT_DIR}/${EXT_DIR}/${BUILD_DIR}
if [ "$BUILD_TYPE" == "debug" ]; then
echo -e "${GREEN}>>> Running Gradle tasks: makeDebugJar${NC}"
echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Running Gradle task: makeDebugJar ... ${NC}"
./gradlew clean makeDebugJar
echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Done! ${NC}"

elif [ "$BUILD_TYPE" == "release" ]; then
echo -e "${GREEN}>>> Running Gradle tasks: makeReleaseJar${NC}"
echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Running Gradle task: makeReleaseJar ... ${NC}"
./gradlew clean makeReleaseJar
echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Done! ${NC}"
fi

echo -e "${GREEN}>>> Moving the jar from ${JAR_IN_DIR} to ${EXT_DIR} ${NC}"
# ======================================== #

echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Moving generated JAR from ${JAR_IN_DIR} to ${EXT_DIR} ... ${NC}"
cd ${ROOT_DIR}/${EXT_DIR}
cp -v ${JAR_IN_DIR}/adjust-android.jar ${ROOT_DIR}/${EXT_DIR}
echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Done! ${NC}"

# ======================================== #

echo -e "${CYAN}[ADJUST][BUILD-ANDROID]:${GREEN} Script completed! ${NC}"

# ======================================== #
2 changes: 1 addition & 1 deletion ext/Android/sdk
Submodule sdk updated 41 files
+1 −1 Adjust/adjust/build.gradle
+26 −0 Adjust/adjust/src/main/java/com/adjust/sdk/ActivityHandler.java
+15 −1 Adjust/adjust/src/main/java/com/adjust/sdk/Adjust.java
+21 −0 Adjust/adjust/src/main/java/com/adjust/sdk/AdjustInstance.java
+1 −0 Adjust/adjust/src/main/java/com/adjust/sdk/AdjustTestOptions.java
+1 −1 Adjust/adjust/src/main/java/com/adjust/sdk/Constants.java
+52 −0 Adjust/adjust/src/main/java/com/adjust/sdk/SharedPreferencesManager.java
+31 −0 Adjust/example-tv/build.gradle
+17 −0 Adjust/example-tv/proguard-rules.pro
+13 −0 Adjust/example-tv/src/androidTest/java/com/adjust/examples/ApplicationTest.java
+46 −0 Adjust/example-tv/src/main/AndroidManifest.xml
+176 −0 Adjust/example-tv/src/main/java/com/adjust/examples/GlobalApplication.java
+113 −0 Adjust/example-tv/src/main/java/com/adjust/examples/MainActivity.java
+117 −0 Adjust/example-tv/src/main/res/layout/activity_main.xml
+ Adjust/example-tv/src/main/res/mipmap-hdpi/ic_launcher.png
+ Adjust/example-tv/src/main/res/mipmap-mdpi/ic_launcher.png
+ Adjust/example-tv/src/main/res/mipmap-xhdpi/ic_launcher.png
+ Adjust/example-tv/src/main/res/mipmap-xxhdpi/ic_launcher.png
+6 −0 Adjust/example-tv/src/main/res/values-w820dp/dimens.xml
+5 −0 Adjust/example-tv/src/main/res/values/dimens.xml
+19 −0 Adjust/example-tv/src/main/res/values/strings.xml
+5 −0 Adjust/example-tv/src/main/res/values/styles.xml
+1 −1 Adjust/example/build.gradle
+1 −1 Adjust/example/src/main/java/com/adjust/examples/MainActivity.java
+1 −1 Adjust/example/src/main/java/com/adjust/examples/ServiceActivity.java
+1 −1 Adjust/pom.xml
+1 −1 Adjust/pom_criteo.xml
+1 −1 Adjust/pom_sociomantic.xml
+1 −1 Adjust/pom_trademob.xml
+1 −1 Adjust/settings.gradle
+1 −1 Adjust/test/src/androidTest/java/com/adjust/sdk/TestActivityPackage.java
+8 −1 Adjust/testapp/src/main/java/com/adjust/testapp/AdjustCommandExecutor.java
+2 −2 Adjust/testapp/src/main/java/com/adjust/testapp/MainActivity.java
+10 −1 CHANGELOG.md
+12 −9 README.md
+1 −1 VERSION
+0 −184 checkstyle/adjust_checks.xml
+1 −1 doc/english/criteo_plugin.md
+1 −1 doc/english/migrate.md
+1 −1 doc/english/sociomantic_plugin.md
+1 −1 doc/english/trademob_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,8 @@ private void startI() {
processSessionI();

checkAttributionStateI();

processCachedDeeplinkI();
}

private void startFirstSessionI() {
Expand Down Expand Up @@ -902,6 +904,9 @@ private void startFirstSessionI() {
sharedPreferencesManager.removePushToken();
sharedPreferencesManager.removeGdprForgetMe();

// check for cached deep links
processCachedDeeplinkI();

// don't check attribution right after first sdk start
}

Expand Down Expand Up @@ -977,6 +982,27 @@ private void checkAttributionStateI() {
attributionHandler.getAttribution();
}

private void processCachedDeeplinkI() {
if (!checkActivityStateI(activityState)) {
return;
}

SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(getContext());
String cachedDeeplinkUrl = sharedPreferencesManager.getDeeplinkUrl();
long cachedDeeplinkClickTime = sharedPreferencesManager.getDeeplinkClickTime();

if (cachedDeeplinkUrl == null) {
return;
}
if (cachedDeeplinkClickTime == -1) {
return;
}

readOpenUrl(Uri.parse(cachedDeeplinkUrl), cachedDeeplinkClickTime);

sharedPreferencesManager.removeDeeplink();
}

private void endI() {
// pause sending if it's not allowed to send
if (!toSendI()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private Adjust() {
*/
public static synchronized AdjustInstance getDefaultInstance() {
@SuppressWarnings("unused")
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.13.0";
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.14.0";

if (defaultInstance == null) {
defaultInstance = new AdjustInstance();
Expand Down Expand Up @@ -98,12 +98,26 @@ public static boolean isEnabled() {
* Called to process deep link.
*
* @param url Deep link URL to process
*
* @deprecated Use {@link #appWillOpenUrl(Uri, Context)}} instead.
*/
@Deprecated
public static void appWillOpenUrl(Uri url) {
AdjustInstance adjustInstance = Adjust.getDefaultInstance();
adjustInstance.appWillOpenUrl(url);
}

/**
* Called to process deep link.
*
* @param url Deep link URL to process
* @param context Application context
*/
public static void appWillOpenUrl(Uri url, Context context) {
AdjustInstance adjustInstance = Adjust.getDefaultInstance();
adjustInstance.appWillOpenUrl(url, context);
}

/**
* Called to process referrer information sent with INSTALL_REFERRER intent.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public class AdjustContext extends FREContext {
// iOS methods
public static String GetIdfa = "getIdfa";

// Test methods
public static String SetTestOptions = "setTestOptions";
public static String Teardown = "teardown";

@Override
public Map<String, FREFunction> getFunctions() {
Map<String, FREFunction> functions = new HashMap<String, FREFunction>();
Expand All @@ -53,7 +57,6 @@ public Map<String, FREFunction> getFunctions() {
functions.put(AdjustContext.SetReferrer, new AdjustFunction(AdjustContext.SetReferrer));
functions.put(AdjustContext.GetGoogleAdId, new AdjustFunction(AdjustContext.GetGoogleAdId));
functions.put(AdjustContext.GetAmazonAdId, new AdjustFunction(AdjustContext.GetAmazonAdId));
functions.put(AdjustContext.GetIdfa, new AdjustFunction(AdjustContext.GetIdfa));
functions.put(AdjustContext.AddSessionCallbackParameter, new AdjustFunction(AdjustContext.AddSessionCallbackParameter));
functions.put(AdjustContext.RemoveSessionCallbackParameter, new AdjustFunction(AdjustContext.RemoveSessionCallbackParameter));
functions.put(AdjustContext.ResetSessionCallbackParameters, new AdjustFunction(AdjustContext.ResetSessionCallbackParameters));
Expand All @@ -66,6 +69,11 @@ public Map<String, FREFunction> getFunctions() {
functions.put(AdjustContext.GetAttribution, new AdjustFunction(AdjustContext.GetAttribution));
functions.put(AdjustContext.GdprForgetMe, new AdjustFunction(AdjustContext.GdprForgetMe));

functions.put(AdjustContext.GetIdfa, new AdjustFunction(AdjustContext.GetIdfa));

functions.put(AdjustContext.SetTestOptions, new AdjustFunction(AdjustContext.SetTestOptions));
functions.put(AdjustContext.Teardown, new AdjustFunction(AdjustContext.Teardown));

return functions;
}

Expand Down
Loading

0 comments on commit ec07344

Please sign in to comment.