Skip to content

Commit

Permalink
Merge pull request #9 from adjust/v4180
Browse files Browse the repository at this point in the history
Version 4.18.0
  • Loading branch information
uerceg authored Jul 4, 2019
2 parents 4f2cd66 + 133c278 commit ef4e9ed
Show file tree
Hide file tree
Showing 105 changed files with 868 additions and 210 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### Version 4.18.0 (4th July 2019)
#### Added
- Added `trackAdRevenue` method to `Adjust` interface to allow tracking of ad revenue. With this release added support for `MoPub` ad revenue tracking.
- Added reading of Facebook anonymous ID if available on iOS platform.

#### Native SDKs
- [[email protected]][ios_sdk_v4.18.0]
- [[email protected]][android_sdk_v4.18.0]

---

### Version 4.17.1 (5th June 2019)
#### Fixed
- Fixed issue when trying to register Android plugin more than once (https://github.com/adjust/flutter_sdk/issues/7).
Expand Down Expand Up @@ -60,5 +71,7 @@

[ios_sdk_v4.17.0]: https://github.com/adjust/ios_sdk/tree/v4.17.0
[ios_sdk_v4.17.3]: https://github.com/adjust/ios_sdk/tree/v4.17.3
[ios_sdk_v4.18.0]: https://github.com/adjust/ios_sdk/tree/v4.18.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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You can add Adjust SDK to your Flutter app by adding following to your `pubspec.

```yaml
dependencies:
adjust_sdk: ^4.17.1
adjust_sdk: ^4.18.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.17.1
4.18.0
6 changes: 3 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:3.2.1'
classpath 'com.android.tools.build:gradle:3.4.1'
}
}
rootProject.allprojects {
Expand Down Expand Up @@ -36,5 +36,5 @@ android {
}

dependencies {
implementation 'com.adjust.sdk:adjust-android:4.17.0'
}
implementation 'com.adjust.sdk:adjust-android:4.18.0'
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
19 changes: 19 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 @@ -137,6 +137,9 @@ public void onMethodCall(MethodCall call, final Result result) {
case "resetSessionPartnerParameters":
resetSessionPartnerParameters(result);
break;
case "trackAdRevenue":
trackAdRevenue(call, result);
break;
case "setTestOptions":
setTestOptions(call, result);
break;
Expand Down Expand Up @@ -647,6 +650,22 @@ private void resetSessionPartnerParameters(final Result result) {
result.success(null);
}

private void trackAdRevenue(final MethodCall call, final Result result) {
String source = null;
String payload = null;
if (call.hasArgument("source") && call.hasArgument("payload")) {
source = (String) call.argument("source");
payload = (String) call.argument("payload");
}
try {
JSONObject jsonPayload = new JSONObject(payload);
Adjust.trackAdRevenue(source, jsonPayload);
} catch (JSONException err) {
Log.e(TAG, "Give ad revenue payload is not a valid JSON string");
}
result.success(null);
}

private void setTestOptions(final MethodCall call, final Result result) {
AdjustTestOptions testOptions = new AdjustTestOptions();
Map testOptionsMap = (Map) call.arguments;
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.4.1'
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
12 changes: 12 additions & 0 deletions ios/Classes/AdjustSdk.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
[self setPushToken:call withResult:result];
} else if ([@"appWillOpenUrl" isEqualToString:call.method]) {
[self appWillOpenUrl:call withResult:result];
} else if ([@"trackAdRevenue" isEqualToString:call.method]) {
[self trackAdRevenue:call withResult:result];
} else if ([@"setTestOptions" isEqualToString:call.method]) {
[self setTestOptions:call withResult:result];
} else if ([@"addSessionCallbackParameter" isEqualToString:call.method]) {
Expand Down Expand Up @@ -325,6 +327,16 @@ - (void)appWillOpenUrl:(FlutterMethodCall *)call withResult:(FlutterResult)resul
[Adjust appWillOpenUrl:url];
}

- (void)trackAdRevenue:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSString *source = call.arguments[@"source"];
NSString *payload = call.arguments[@"payload"];
if (!([self isFieldValid:source]) || !([self isFieldValid:payload])) {
return;
}
NSData *dataPayload = [payload dataUsingEncoding:NSUTF8StringEncoding];
[Adjust trackAdRevenue:source payload:dataPayload];
}

- (void)getAttribution:(FlutterMethodCall *)call withResult:(FlutterResult)result {
ADJAttribution *attribution = [Adjust attribution];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
Expand Down
4 changes: 2 additions & 2 deletions ios/adjust_sdk.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'adjust_sdk'
s.version = '4.17.1'
s.version = '4.18.0'
s.summary = 'Adjust Flutter SDK for iOS platform'
s.description = <<-DESC
Adjust Flutter SDK for iOS platform.
Expand All @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '8.0'

s.dependency 'Flutter'
s.dependency 'Adjust', '~> 4.17.3'
s.dependency 'Adjust', '~> 4.18.0'
end
6 changes: 5 additions & 1 deletion lib/adjust.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'package:adjust_sdk/adjust_event.dart';
import 'package:adjust_sdk/adjust_attribution.dart';

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

static void start(AdjustConfig config) {
Expand Down Expand Up @@ -134,6 +134,10 @@ class Adjust {
_channel.invokeMethod('resetSessionPartnerParameters');
}

static void trackAdRevenue(String source, String payload) {
_channel.invokeMethod('trackAdRevenue', {'source': source, 'payload': payload});
}

// For testing purposes only. Do not use in production.
@visibleForTesting
static void setTestOptions(final dynamic testOptions) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: adjust_sdk
description: This is the Flutter SDK of Adjust™. You can read more about Adjust™ at adjust.com.
author: Adjust GmbH <[email protected]>
homepage: https://github.com/adjust/flutter_sdk
version: 4.17.1
version: 4.18.0

environment:
sdk: ">=2.0.0 <3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# testlib
# test_lib

Flutter Plugin for Adjust Testing Library.

Expand Down
5 changes: 3 additions & 2 deletions test/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group 'com.adjust.test.testlib'
group 'com.adjust.test.lib'
version '1.0-SNAPSHOT'

buildscript {
Expand Down Expand Up @@ -34,6 +34,7 @@ android {
}

dependencies {
implementation files('libs/adjust-testing.jar')
implementation files('libs/adjust-test.jar')
implementation files('libs/Java-WebSocket-1.3.9.jar')
implementation files('libs/gson-2.8.1.jar')
}
Binary file added test/android/libs/Java-WebSocket-1.3.9.jar
Binary file not shown.
Binary file added test/android/libs/adjust-test.jar
Binary file not shown.
Binary file removed test/android/libs/adjust-testing.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion test/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'testlib'
rootProject.name = 'test_lib'
2 changes: 1 addition & 1 deletion test/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adjust.test.testlib">
package="com.adjust.test.lib">
</manifest>
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
//
// TestlibPlugin.java
// TestLibPlugin.java
// Adjust SDK
//
// Created by Srdjan Tubin (@2beens) on 1st October 2018.
// Copyright (c) 2018 Adjust GmbH. All rights reserved.
//

package com.adjust.test.testlib;
package com.adjust.test.lib;

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;

import com.adjust.testlibrary.ICommandJsonListener;
import com.adjust.testlibrary.TestLibrary;
import com.adjust.test.ICommandJsonListener;
import com.adjust.test.TestLibrary;

import java.util.HashMap;
import java.util.Map;

/** TestlibPlugin */
public class TestlibPlugin implements MethodCallHandler {
/** TestLibPlugin */
public class TestLibPlugin implements MethodCallHandler {
private static String TAG = "ADJUST-TESTLIB-PLUGIN-BRIDGE";
private TestLibrary testLibrary = null;
private MethodChannel channel;

TestlibPlugin(MethodChannel channel) {
TestLibPlugin(MethodChannel channel) {
this.channel = channel;
}

/** Plugin registration. */
public static void registerWith(Registrar registrar) {
final MethodChannel channel = new MethodChannel(registrar.messenger(), "testlib");
channel.setMethodCallHandler(new TestlibPlugin(channel));
final MethodChannel channel = new MethodChannel(registrar.messenger(), "test_lib");
channel.setMethodCallHandler(new TestLibPlugin(channel));
}

@Override
Expand Down Expand Up @@ -63,14 +63,15 @@ private void getPlatformVersion(final Result result) {

private void init(final MethodCall call, final Result result) {
Map paramsMap = (Map)call.arguments;
if(!paramsMap.containsKey("baseUrl")) {
result.error("0", "Arguments null or wrong (missing argument >baseUrl<", null);
if(!paramsMap.containsKey("baseUrl") || !paramsMap.containsKey("controlUrl")) {
result.error("0", "Arguments null or wrong (missing >baseUrl< or >controlUrl<)", null);
return;
}

String baseUrl = (String) paramsMap.get("baseUrl");
String controlUrl = (String) paramsMap.get("controlUrl");

testLibrary = new TestLibrary(baseUrl, new ICommandJsonListener() {
testLibrary = new TestLibrary(baseUrl, controlUrl, new ICommandJsonListener() {
@Override
public void executeCommand(String className, String methodName, String jsonParameters) {
HashMap methodParams = new HashMap();
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/testapp/README.md → test/app/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# testapp
# test_app

Adjust Test (CI) App for Flutter SDK.

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.adjust.test.testlibexample"
applicationId "com.adjust.test.app"
minSdkVersion 16
targetSdkVersion 27
versionCode flutterVersionCode.toInteger()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adjust.test.testlibexample">
package="com.adjust.test.app">

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
Expand All @@ -16,7 +16,7 @@
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="testapp"
android:label="test_app"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.adjust.test.testlibexample;
package com.adjust.test.app;

import android.content.Intent;
import android.net.Uri;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B47CCA172CA8B085CD00A4AE /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
AF384EA54ECCB853A745FDAF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
EE956E1BDE2A7284B6E1F58D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
FA6D2ADCA3E99F20698382B6 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand All @@ -76,8 +77,8 @@
6EB48117BB5A78EBE9A12858 /* Pods */ = {
isa = PBXGroup;
children = (
4B14F3CEA404A0CB4ACCF554 /* Pods-Runner.debug.xcconfig */,
B47CCA172CA8B085CD00A4AE /* Pods-Runner.release.xcconfig */,
EE956E1BDE2A7284B6E1F58D /* Pods-Runner.debug.xcconfig */,
AF384EA54ECCB853A745FDAF /* Pods-Runner.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -440,7 +441,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.adjust.test.testlibExample;
PRODUCT_BUNDLE_IDENTIFIER = com.adjust.test.app;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
Expand All @@ -465,7 +466,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.adjust.test.testlibExample;
PRODUCT_BUNDLE_IDENTIFIER = com.adjust.test.app;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>testapp</string>
<string>test_app</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ef4e9ed

Please sign in to comment.