Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4.30.0 #84

Merged
merged 17 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
### Version 4.30.0 (9th June 2022)
#### Added
- Added ability to mark your app as COPPA compliant. You can enable this setting by setting `coppaCompliantEnabled` member of `AdjustConfig` instance to `true`.
- Added ability to mark your Android app as app for the kids in accordance to Google Play Families policies. You can enable this setting by setting `playStoreKidsAppEnabled` member of `AdjustConfig` instance to `true`.
- Added `checkForNewAttStatus` method to `Adjust` API to allow iOS apps to instruct to SDK to check if `att_status` might have changed in the meantime.
- Added support for Generic ad revenue tracking.

#### Changed
- Reverted `compileSdkVersion` from `32` to `31` (https://github.com/adjust/flutter_sdk/pull/77).
- Changed responses which is being returned when iOS specific API is being called on Android platform (https://github.com/adjust/flutter_sdk/issues/79 and https://github.com/adjust/flutter_sdk/issues/80).

#### Native SDKs
- [[email protected]][ios_sdk_v4.30.0]
- [[email protected]][android_sdk_v4.30.1]

---

### Version 4.29.2 (18th February 2022)
#### Added
- Added support for `Unity` ad revenue tracking.
Expand Down Expand Up @@ -256,6 +273,7 @@
[ios_sdk_v4.29.2]: https://github.com/adjust/ios_sdk/tree/v4.29.2
[ios_sdk_v4.29.6]: https://github.com/adjust/ios_sdk/tree/v4.29.6
[ios_sdk_v4.29.7]: https://github.com/adjust/ios_sdk/tree/v4.29.7
[ios_sdk_v4.30.0]: https://github.com/adjust/ios_sdk/tree/v4.30.0

[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 @@ -267,4 +285,4 @@
[android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0
[android_sdk_v4.28.1]: https://github.com/adjust/android_sdk/tree/v4.28.1
[android_sdk_v4.28.5]: https://github.com/adjust/android_sdk/tree/v4.28.5
[android_sdk_v4.29.1]: https://github.com/adjust/android_sdk/tree/v4.29.1
[android_sdk_v4.30.1]: https://github.com/adjust/android_sdk/tree/v4.30.1
46 changes: 36 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ This is the Flutter SDK of Adjust™. You can read more about Adjust™ at [adju
* [AppTrackingTransparency framework](#af-att-framework)
* [App-tracking authorisation wrapper](#af-ata-wrapper)
* [Get current authorisation status](#af-ata-getter)
* [Check for ATT status change](#af-att-status-change)
* [SKAdNetwork framework](#af-skadn-framework)
* [Update SKAdNetwork conversion value](#af-skadn-update-conversion-value)
* [Conversion value updated callback](#af-skadn-cv-updated-callback)
Expand All @@ -81,6 +82,8 @@ This is the Flutter SDK of Adjust™. You can read more about Adjust™ at [adju
* [Enable third-party sharing](#af-enable-third-party-sharing)
* [Measurement consent](#af-measurement-consent)
* [Data residency](#af-data-residency)
* [COPPA compliance](#af-coppa-compliance)
* [Play Store Kids Apps](#af-play-store-kids-apps)

### License

Expand All @@ -101,7 +104,7 @@ You can add Adjust SDK to your Flutter app by adding following to your `pubspec.

```yaml
dependencies:
adjust_sdk: ^4.29.2
adjust_sdk: ^4.30.0
```

Then navigate to your project in the terminal and run:
Expand Down Expand Up @@ -131,12 +134,6 @@ Please add the following permissions, which the Adjust SDK needs, if they are no
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
```

If you are **not targeting the Google Play Store**, please also add the following permission:

```xml
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
```

#### <a id="gps-adid-permission"></a>Add permission to gather Google advertising ID

If you are targeting Android 12 and above (API level 31), you need to add the `com.google.android.gms.AD_ID` permission to read the device's advertising ID. Add the following line to your `AndroidManifest.xml` to enable the permission.
Expand Down Expand Up @@ -183,7 +180,7 @@ In order to correctly attribute an install of your app to its source, Adjust nee
In order to support this in your app, please make sure to add following dependency to your app's `build.gradle` file for Android platform:

```
implementation 'com.android.installreferrer:installreferrer:1.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
```

Also, make sure that you have paid attention to the [Proguard settings](#qs-proguard) chapter and that you have added all the rules mentioned in it, especially the one needed for this feature:
Expand Down Expand Up @@ -222,7 +219,6 @@ Make sure that following iOS frameworks are linked with your iOS app:
* `iAd.framework` - in case you are running iAd campaigns
* `AdServices.framework` - in case you are running iAd campaigns
* `AdSupport.framework` - for reading iOS Advertising Id (IDFA)
* `CoreTelephony.framework` - for reading MCC and MNC information
* `StoreKit.framework` - for communication with SKAdNetwork framework
* `AppTrackingTransparency.framework` - to ask for user's consent to be tracked and obtain status of that consent

Expand Down Expand Up @@ -703,6 +699,16 @@ To get the current app tracking authorization status you can call `getAppTrackin
* `3`: The user authorized access to IDFA
* `-1`: The status is not available

### <a id="att-status-change"></a>Check for ATT status change

**Note**: This feature exists only in iOS platform.

In cases where you are not using [Adjust app-tracking authorization wrapper](#af-ata-wrapper), Adjust SDK will not be able to know immediately upon answering the dialog what is the new value of app-tracking status. In situations like this, if you would want Adjust SDK to read the new app-tracking status value and communicate it to our backend, make sure to make a call to this method:

```dart
Adjust.checkForNewAttStatus();
```

### <a id="af-skadn-framework"></a>SKAdNetwork framework

**Note**: This feature exists only in iOS platform.
Expand Down Expand Up @@ -1233,6 +1239,26 @@ adjustConfig.urlStrategy = AdjustConfig.DataResidencyTR; // for Turkey data resi
adjustConfig.urlStrategy = AdjustConfig.DataResidencyUS; // for US data residency region
```

### <a id="af-coppa-compliance"></a>COPPA compliance

By default Adjust SDK doesn't mark app as COPPA compliant. In order to mark your app as COPPA compliant, make sure to set `coppaCompliantEnabled` member of `AdjustConfig` instance to `true`:

```dart
adjustConfig.coppaCompliantEnabled = true;
```

**Note:** By enabling this feature, third-party sharing will be automatically disabled for the users. If later during the app lifetime you decide not to mark app as COPPA compliant anymore, third-party sharing **will not be automatically re-enabled**. Instead, next to not marking your app as COPPA compliant anymore, you will need to explicitly re-enable third-party sharing in case you want to do that.

### <a id="af-play-store-kids-apps"></a>Play Store Kids Apps

**Note**: This feature exists only in Android platform.

By default Adjust SDK doesn't mark Android app as Play Store Kids App. In order to mark your app as the app which is targetting kids in Play Store, make sure to set `playStoreKidsAppEnabled` member of `AdjustConfig` instance to `true`:

```dart
adjustConfig.playStoreKidsAppEnabled = true;
```

[dashboard]: https://adjust.com
[adjust.com]: https://adjust.com

Expand All @@ -1256,7 +1282,7 @@ adjustConfig.urlStrategy = AdjustConfig.DataResidencyUS; // for US data residenc

The Adjust SDK is licensed under the MIT License.

Copyright (c) 2018-2021 Adjust GmbH, https://www.adjust.com
Copyright (c) 2018-Present Adjust GmbH, https://www.adjust.com

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.29.2
4.30.0
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rootProject.allprojects {
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 32
compileSdkVersion 31

defaultConfig {
minSdkVersion 16
Expand All @@ -36,5 +36,5 @@ android {
}

dependencies {
api 'com.adjust.sdk:adjust-android:4.29.1'
api 'com.adjust.sdk:adjust-android:4.30.1'
}
37 changes: 27 additions & 10 deletions android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ public void onMethodCall(MethodCall call, final Result result) {
case "trackMeasurementConsent":
trackMeasurementConsent(call, result);
break;
case "checkForNewAttStatus":
checkForNewAttStatus(call, result);
break;
case "setTestOptions":
setTestOptions(call, result);
break;
Expand Down Expand Up @@ -276,11 +279,25 @@ private void start(final MethodCall call, final Result result) {

// Event buffering.
if (configMap.containsKey("eventBufferingEnabled")) {
String eventBufferingEnabledString = (String) configMap.get("eventBufferingEnabled");
boolean eventBufferingEnabled = Boolean.parseBoolean(eventBufferingEnabledString);
String strEventBufferingEnabled = (String) configMap.get("eventBufferingEnabled");
boolean eventBufferingEnabled = Boolean.parseBoolean(strEventBufferingEnabled);
adjustConfig.setEventBufferingEnabled(eventBufferingEnabled);
}

// COPPA compliance.
if (configMap.containsKey("coppaCompliantEnabled")) {
String strCoppaCompliantEnabled = (String) configMap.get("coppaCompliantEnabled");
boolean coppaCompliantEnabled = Boolean.parseBoolean(strCoppaCompliantEnabled);
adjustConfig.setCoppaCompliantEnabled(coppaCompliantEnabled);
}

// Google Play Store kids apps.
if (configMap.containsKey("playStoreKidsAppEnabled")) {
String strPlayStoreKidsAppEnabled = (String) configMap.get("playStoreKidsAppEnabled");
boolean playStoreKidsAppEnabled = Boolean.parseBoolean(strPlayStoreKidsAppEnabled);
adjustConfig.setPlayStoreKidsAppEnabled(playStoreKidsAppEnabled);
}

// Main process name.
if (configMap.containsKey("processName")) {
String processName = (String) configMap.get("processName");
Expand Down Expand Up @@ -682,8 +699,7 @@ private void getAdid(final Result result) {
}

private void getIdfa(final Result result) {
result.notImplemented();
// result.error("0", "Error. No IDFA for Android platform!", null);
result.success("Error. No IDFA on Android platform!");
}

private void getGoogleAdId(final Result result) {
Expand Down Expand Up @@ -902,8 +918,7 @@ private void trackAdRevenueNew(final MethodCall call, final Result result) {
}

private void trackAppStoreSubscription(final Result result) {
result.notImplemented();
// result.error("0", "Error. No App Store subscription tracking for Android platform!", null);
result.success("Error. No App Store subscription tracking on Android platform!");
}

private void trackPlayStoreSubscription(final MethodCall call, final Result result) {
Expand Down Expand Up @@ -1005,13 +1020,11 @@ private void trackPlayStoreSubscription(final MethodCall call, final Result resu
}

private void requestTrackingAuthorizationWithCompletionHandler(final Result result) {
result.notImplemented();
// result.error("0", "Error. No requestTrackingAuthorizationWithCompletionHandler for Android platform!", null);
result.success("Error. No requestTrackingAuthorizationWithCompletionHandler on Android platform!");
}

private void updateConversionValue(final Result result) {
result.notImplemented();
// result.error("0", "Error. No updateConversionValue for Android platform!", null);
result.success("Error. No updateConversionValue on Android platform!");
}

private void trackThirdPartySharing(final MethodCall call, final Result result) {
Expand Down Expand Up @@ -1057,6 +1070,10 @@ private void trackMeasurementConsent(final MethodCall call, final Result result)
result.success(null);
}

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

private void setTestOptions(final MethodCall call, final Result result) {
AdjustTestOptions testOptions = new AdjustTestOptions();
Map testOptionsMap = (Map) call.arguments;
Expand Down
6 changes: 6 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
}
});

// COPPA compliance.
// config.coppaCompliantEnabled = true;

// Google Play Store kids apps.
// config.playStoreKidsAppEnabled = true;

// Start SDK.
Adjust.start(config);
}
Expand Down
10 changes: 9 additions & 1 deletion ios/Classes/AdjustSdk.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
result(@(isEnabled));
} else if ([@"getAdid" isEqualToString:call.method]) {
result([Adjust adid]);
} else {
} else if ([@"checkForNewAttStatus" isEqualToString:call.method]) {
[Adjust checkForNewAttStatus];
} else {
result(FlutterMethodNotImplemented);
}
}
Expand All @@ -143,6 +145,7 @@ - (void)start:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSString *eventBufferingEnabled = call.arguments[@"eventBufferingEnabled"];
NSString *sendInBackground = call.arguments[@"sendInBackground"];
NSString *needsCost = call.arguments[@"needsCost"];
NSString *coppaCompliantEnabled = call.arguments[@"coppaCompliantEnabled"];
NSString *allowiAdInfoReading = call.arguments[@"allowiAdInfoReading"];
NSString *allowAdServicesInfoReading = call.arguments[@"allowAdServicesInfoReading"];
NSString *allowIdfaReading = call.arguments[@"allowIdfaReading"];
Expand Down Expand Up @@ -183,6 +186,11 @@ - (void)start:(FlutterMethodCall *)call withResult:(FlutterResult)result {
if ([self isFieldValid:eventBufferingEnabled]) {
[adjustConfig setEventBufferingEnabled:[eventBufferingEnabled boolValue]];
}

// COPPA compliance.
if ([self isFieldValid:coppaCompliantEnabled]) {
[adjustConfig setCoppaCompliantEnabled:[coppaCompliantEnabled boolValue]];
}

// Default tracker.
if ([self isFieldValid:defaultTracker]) {
Expand Down
6 changes: 3 additions & 3 deletions ios/adjust_sdk.podspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Pod::Spec.new do |s|
s.name = 'adjust_sdk'
s.version = '4.29.2'
s.version = '4.30.0'
s.summary = 'Adjust Flutter SDK for iOS platform'
s.description = <<-DESC
Adjust Flutter SDK for iOS platform.
DESC
s.homepage = 'http://www.adjust.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Adjust GmbH' => '[email protected]' }
s.author = { 'Adjust' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.ios.deployment_target = '8.0'

s.dependency 'Flutter'
s.dependency 'Adjust', '4.29.7'
s.dependency 'Adjust', '4.30.0'
end
6 changes: 5 additions & 1 deletion lib/adjust.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import 'package:flutter/services.dart';
import 'package:meta/meta.dart';

class Adjust {
static const String _sdkPrefix = 'flutter4.29.2';
static const String _sdkPrefix = 'flutter4.30.0';
static const MethodChannel _channel =
const MethodChannel('com.adjust.sdk/api');

Expand Down Expand Up @@ -180,6 +180,10 @@ class Adjust {
'updateConversionValue', {'conversionValue': conversionValue});
}

static void checkForNewAttStatus() {
_channel.invokeMethod('checkForNewAttStatus');
}

// For testing purposes only. Do not use in production.
@visibleForTesting
static void setTestOptions(final dynamic testOptions) {
Expand Down
10 changes: 10 additions & 0 deletions lib/adjust_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:adjust_sdk/adjust_session_success.dart';
import 'package:flutter/services.dart';

enum AdjustLogLevel { verbose, debug, info, warn, error, suppress }

enum AdjustEnvironment { production, sandbox }

typedef void AttributionCallback(AdjustAttribution attributionData);
Expand Down Expand Up @@ -50,6 +51,7 @@ class AdjustConfig {
static const String AdRevenueSourceAdMostSource = 'admost_sdk';
static const String AdRevenueSourceUnity = 'unity_sdk';
static const String AdRevenueSourceHeliumChartboost = 'helium_chartboost_sdk';
static const String AdRevenueSourcePublisher = 'publisher_sdk';

String _appToken;
AdjustEnvironment _environment;
Expand All @@ -71,6 +73,8 @@ class AdjustConfig {
bool? launchDeferredDeeplink;
bool? needsCost;
bool? preinstallTrackingEnabled;
bool? playStoreKidsAppEnabled;
bool? coppaCompliantEnabled;
String? sdkPrefix;
String? userAgent;
String? defaultTracker;
Expand Down Expand Up @@ -213,6 +217,12 @@ class AdjustConfig {
configMap['preinstallTrackingEnabled'] =
preinstallTrackingEnabled.toString();
}
if (playStoreKidsAppEnabled != null) {
configMap['playStoreKidsAppEnabled'] = playStoreKidsAppEnabled.toString();
}
if (coppaCompliantEnabled != null) {
configMap['coppaCompliantEnabled'] = coppaCompliantEnabled.toString();
}
if (allowiAdInfoReading != null) {
configMap['allowiAdInfoReading'] = allowiAdInfoReading.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: adjust_sdk
description: This is the Flutter SDK of Adjust™. You can read more about Adjust™ at adjust.com.
homepage: https://github.com/adjust/flutter_sdk
version: 4.29.2
version: 4.30.0

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion test/app/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 = 1240;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
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 = "1240"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading