Skip to content

Commit

Permalink
Merge pull request #115 from adjust/v4340
Browse files Browse the repository at this point in the history
Version 4.34.0
  • Loading branch information
uerceg authored Sep 6, 2023
2 parents bede319 + ad38c52 commit 0dd8999
Show file tree
Hide file tree
Showing 32 changed files with 400 additions and 41 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### Version 4.34.0 (6th September 2023)
#### Added
- Added support for Android apps using Gradle 8.0 or later.
- Added ability to delay SDK start on iOS platform in order to wait for an answer to the ATT dialog. You can set the number of seconds to wait (capped internally to 120) by setting the `attConsentWaitingInterval` method of the `AdjustConfig` instance.
- Added support for purchase verification. In case you are using this feature, you can now use it by calling `verifyAppStorePurchase` (for iOS) and `verifyPlayStorePurchase` (for Android) methods of the `Adjust` instance.

#### Native SDKs
- [[email protected]][ios_sdk_v4.34.2]
- [[email protected]][android_sdk_v4.34.0]

---

### Version 4.33.1 (16th February 2023)
#### Fixed
- Skipped invocation of SKAN 4.0 style callback in case SKAN 4.0 API was not invoked (https://github.com/adjust/flutter_sdk/issues/104).
Expand Down Expand Up @@ -324,6 +336,7 @@
[ios_sdk_v4.32.1]: https://github.com/adjust/ios_sdk/tree/v4.32.1
[ios_sdk_v4.33.2]: https://github.com/adjust/ios_sdk/tree/v4.33.2
[ios_sdk_v4.33.4]: https://github.com/adjust/ios_sdk/tree/v4.33.4
[ios_sdk_v4.34.2]: https://github.com/adjust/ios_sdk/tree/v4.34.2

[android_sdk_v4.17.0]: https://github.com/adjust/android_sdk/tree/v4.17.0
[android_sdk_v4.18.0]: https://github.com/adjust/android_sdk/tree/v4.18.0
Expand All @@ -339,4 +352,5 @@
[android_sdk_v4.31.0]: https://github.com/adjust/android_sdk/tree/v4.31.0
[android_sdk_v4.32.0]: https://github.com/adjust/android_sdk/tree/v4.32.0
[android_sdk_v4.33.2]: https://github.com/adjust/android_sdk/tree/v4.33.2
[android_sdk_v4.33.3]: https://github.com/adjust/android_sdk/tree/v4.33.3
[android_sdk_v4.33.3]: https://github.com/adjust/android_sdk/tree/v4.33.3
[android_sdk_v4.34.0]: https://github.com/adjust/android_sdk/tree/v4.34.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ You can add Adjust SDK to your Flutter app by adding following to your `pubspec.

```yaml
dependencies:
adjust_sdk: ^4.33.1
adjust_sdk: ^4.34.0
```
Then navigate to your project in the terminal and run:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.33.1
4.34.0
7 changes: 4 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}

dependencies {
classpath('com.android.tools.build:gradle:7.1.1')
classpath('com.android.tools.build:gradle:7.1.3')
}
}
rootProject.allprojects {
Expand All @@ -24,7 +24,7 @@ rootProject.allprojects {
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 16
Expand All @@ -33,8 +33,9 @@ android {
lintOptions {
disable 'InvalidPackage'
}
namespace 'com.adjust.sdk.flutter'
}

dependencies {
api 'com.adjust.sdk:adjust-android:4.33.3'
api 'com.adjust.sdk:adjust-android:4.34.0'
}
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adjust.sdk.flutter">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
65 changes: 65 additions & 0 deletions android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import com.adjust.sdk.AdjustSessionFailure;
import com.adjust.sdk.AdjustSessionSuccess;
import com.adjust.sdk.AdjustPlayStoreSubscription;
import com.adjust.sdk.AdjustPurchase;
import com.adjust.sdk.AdjustPurchaseVerificationResult;
import com.adjust.sdk.AdjustThirdPartySharing;
import com.adjust.sdk.AdjustTestOptions;
import com.adjust.sdk.LogLevel;
Expand All @@ -32,6 +34,7 @@
import com.adjust.sdk.OnEventTrackingSucceededListener;
import com.adjust.sdk.OnSessionTrackingFailedListener;
import com.adjust.sdk.OnSessionTrackingSucceededListener;
import com.adjust.sdk.OnPurchaseVerificationFinishedListener;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down Expand Up @@ -204,6 +207,12 @@ public void onMethodCall(MethodCall call, final Result result) {
case "getLastDeeplink":
getLastDeeplink(call, result);
break;
case "verifyPlayStorePurchase":
verifyPlayStorePurchase(call, result);
break;
case "verifyAppStorePurchase":
verifyAppStorePurchase(call, result);
break;
case "setTestOptions":
setTestOptions(call, result);
break;
Expand Down Expand Up @@ -597,6 +606,18 @@ private void trackEvent(final MethodCall call, final Result result) {
event.setOrderId(orderId);
}

// Product ID.
if (eventMap.containsKey("productId")) {
String productId = (String) eventMap.get("productId");
event.setProductId(productId);
}

// Purchase token.
if (eventMap.containsKey("purchaseToken")) {
String purchaseToken = (String) eventMap.get("purchaseToken");
event.setPurchaseToken(purchaseToken);
}

// Callback ID.
if (eventMap.containsKey("callbackId")) {
String callbackId = (String) eventMap.get("callbackId");
Expand Down Expand Up @@ -1104,6 +1125,44 @@ private void getLastDeeplink(final MethodCall call, final Result result) {
result.success("Error. No getLastDeeplink for Android platform!");
}

private void verifyPlayStorePurchase(final MethodCall call, final Result result) {
Map purchaseMap = (Map) call.arguments;
if (purchaseMap == null) {
return;
}

// Product ID.
String productId = null;
if (purchaseMap.containsKey("productId")) {
productId = (String) purchaseMap.get("productId");
}

// Purchase token.
String purchaseToken = null;
if (purchaseMap.containsKey("purchaseToken")) {
purchaseToken = (String) purchaseMap.get("purchaseToken");
}

// Create purchase instance.
AdjustPurchase purchase = new AdjustPurchase(productId, purchaseToken);

// Verify purchase.
Adjust.verifyPurchase(purchase, new OnPurchaseVerificationFinishedListener() {
@Override
public void onVerificationFinished(AdjustPurchaseVerificationResult verificationResult) {
HashMap<String, String> adjustPurchaseMap = new HashMap<String, String>();
adjustPurchaseMap.put("code", String.valueOf(verificationResult.getCode()));
adjustPurchaseMap.put("verificationStatus", verificationResult.getVerificationStatus());
adjustPurchaseMap.put("message", verificationResult.getMessage());
result.success(adjustPurchaseMap);
}
});
}

private void verifyAppStorePurchase(final MethodCall call, final Result result) {
result.success("Error. No verifyAppStorePurchase for Android platform!");
}

private void setTestOptions(final MethodCall call, final Result result) {
AdjustTestOptions testOptions = new AdjustTestOptions();
Map testOptionsMap = (Map) call.arguments;
Expand All @@ -1117,6 +1176,9 @@ private void setTestOptions(final MethodCall call, final Result result) {
if (testOptionsMap.containsKey("subscriptionUrl")) {
testOptions.subscriptionUrl = (String) testOptionsMap.get("subscriptionUrl");
}
if (testOptionsMap.containsKey("purchaseVerificationUrl")) {
testOptions.purchaseVerificationUrl = (String) testOptionsMap.get("purchaseVerificationUrl");
}
if (testOptionsMap.containsKey("basePath")) {
testOptions.basePath = (String) testOptionsMap.get("basePath");
}
Expand All @@ -1126,6 +1188,9 @@ private void setTestOptions(final MethodCall call, final Result result) {
if (testOptionsMap.containsKey("subscriptionPath")) {
testOptions.subscriptionPath = (String) testOptionsMap.get("subscriptionPath");
}
if (testOptionsMap.containsKey("purchaseVerificationPath")) {
testOptions.purchaseVerificationPath = (String) testOptionsMap.get("purchaseVerificationPath");
}
// Kept for the record. Not needed anymore with test options extraction.
// if (testOptionsMap.containsKey("useTestConnectionOptions")) {
// testOptions.useTestConnectionOptions = testOptionsMap.get("useTestConnectionOptions").toString().equals("true");
Expand Down
5 changes: 3 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 32
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -36,7 +36,7 @@ android {
defaultConfig {
applicationId "com.adjust.examples"
minSdkVersion 16
targetSdkVersion 32
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -52,6 +52,7 @@ android {
checkReleaseBuilds false
disable 'InvalidPackage'
}
namespace 'com.adjust.examples'
}

flutter {
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adjust.examples">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adjust.examples">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adjust.examples">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
6 changes: 3 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:8.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
1 change: 1 addition & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
6 changes: 3 additions & 3 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Aug 28 12:41:30 CEST 2020
#Mon Sep 04 10:30:21 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
6 changes: 5 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -224,6 +224,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down Expand Up @@ -385,6 +386,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -524,6 +526,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -555,6 +558,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
cupertino_icons: ^1.0.0

dev_dependencies:
flutter_test:
Expand Down
Loading

0 comments on commit 0dd8999

Please sign in to comment.