Skip to content

Commit 70a2b4a

Browse files
authored
Merge pull request #49 from adjust/v4170
Version 4.17.0
2 parents 08c5975 + 36f6183 commit 70a2b4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+705
-453
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
### Version 4.17.0 (12th December 2018)
2+
#### Added
3+
- Added `getSdkVersion()` method to `Adjust` interface to obtain current SDK version string.
4+
5+
#### Changed
6+
- Changed usage of `compile` keyword in plugin's `build.gradle` file into `implementation` (https://github.com/adjust/react_native_sdk/issues/47).
7+
8+
#### Native SDKs
9+
- [[email protected]][ios_sdk_v4.17.1]
10+
- [[email protected]][android_sdk_v4.17.0]
11+
12+
---
13+
114
### Version 4.15.0 (10th October 2018)
215
#### Added
316
- Added `setCallbackId` method on `AdjustEvent` object for users to set custom ID on event object which will later be reported in event success/failure callbacks.
@@ -247,6 +260,7 @@
247260
[ios_sdk_v4.13.0]: https://github.com/adjust/ios_sdk/tree/v4.13.0
248261
[ios_sdk_v4.14.1]: https://github.com/adjust/ios_sdk/tree/v4.14.1
249262
[ios_sdk_v4.15.0]: https://github.com/adjust/ios_sdk/tree/v4.15.0
263+
[ios_sdk_v4.17.1]: https://github.com/adjust/ios_sdk/tree/v4.17.1
250264

251265
[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
252266
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
@@ -261,3 +275,4 @@
261275
[android_sdk_v4.13.0]: https://github.com/adjust/android_sdk/tree/v4.13.0
262276
[android_sdk_v4.14.0]: https://github.com/adjust/android_sdk/tree/v4.14.0
263277
[android_sdk_v4.15.0]: https://github.com/adjust/android_sdk/tree/v4.15.0
278+
[android_sdk_v4.17.0]: https://github.com/adjust/android_sdk/tree/v4.17.0

README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ compile 'com.google.android.gms:play-services-analytics:10.0.1'
197197

198198
To check whether the analytics part of the Google Play Services library has been successfully added to your app so that the Adjust SDK can read it properly, you should start your app by configuring the SDK to run in `sandbox` mode and set the log level to `verbose`. After that, track a session or some events in your app and observe the list of parameters in the verbose logs which are being read once the session or event has been tracked. If you see a parameter called `gps_adid` in there, you have successfully added the analytics part of the Google Play Services library to your app and our SDK is reading the necessary information from it.
199199

200+
In case you encounter any issue with attempts to read Google Advertising Identifier, feel free to open an issue in our Github repository or write an email to [email protected].
201+
200202
### <a id="android-proguard"></a>Proguard settings
201203

202204
If you are using Proguard, add these lines to your Proguard file:
@@ -213,20 +215,6 @@ If you are using Proguard, add these lines to your Proguard file:
213215
java.lang.String getId();
214216
boolean isLimitAdTrackingEnabled();
215217
}
216-
-keep class dalvik.system.VMRuntime {
217-
java.lang.String getRuntime();
218-
}
219-
-keep class android.os.Build {
220-
java.lang.String[] SUPPORTED_ABIS;
221-
java.lang.String CPU_ABI;
222-
}
223-
-keep class android.content.res.Configuration {
224-
android.os.LocaleList getLocales();
225-
java.util.Locale locale;
226-
}
227-
-keep class android.os.LocaledList {
228-
java.util.Locale get(int);
229-
}
230218
-keep public class com.android.installreferrer.** { *; }
231219
```
232220

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.15.0
1+
4.17.0

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ android {
2626
}
2727

2828
dependencies {
29-
compile fileTree(dir: 'libs', include: ['*.jar'])
30-
compile 'com.facebook.react:react-native:+'
29+
implementation fileTree(dir: 'libs', include: ['*.jar'])
30+
implementation 'com.facebook.react:react-native:+'
3131
}

android/libs/adjust-android.jar

4.26 KB
Binary file not shown.

android/src/main/java/com/adjust/sdk/Adjust.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,16 @@ public void getAttribution(Callback callback) {
447447
callback.invoke(AdjustUtil.attributionToMap(com.adjust.sdk.Adjust.getAttribution()));
448448
}
449449

450+
@ReactMethod
451+
public void getSdkVersion(String sdkPrefix, Callback callback) {
452+
String sdkVersion = com.adjust.sdk.Adjust.getSdkVersion();
453+
if (sdkVersion == null) {
454+
callback.invoke("");
455+
} else {
456+
callback.invoke(sdkPrefix + "@" + sdkVersion);
457+
}
458+
}
459+
450460
@ReactMethod
451461
public void setAttributionCallbackListener() {
452462
this.attributionCallback = true;

example/App.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
this._onPress_getIds = this._onPress_getIds.bind(this);
2626
this._onPress_isSdkEnabled = this._onPress_isSdkEnabled.bind(this);
2727

28+
Adjust.getSdkVersion(function(sdkVersion) {
29+
console.log("Adjust SDK version: " + sdkVersion);
30+
});
31+
2832
var adjustConfig = new AdjustConfig("2fm9gkqubvpc", AdjustConfig.EnvironmentSandbox);
2933
adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose);
3034
adjustConfig.setShouldLaunchDeeplink(true);

example/android/app/build.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
9494
def enableProguardInReleaseBuilds = false
9595

9696
android {
97-
compileSdkVersion 26
98-
buildToolsVersion "26.0.3"
97+
compileSdkVersion rootProject.ext.compileSdkVersion
98+
buildToolsVersion rootProject.ext.buildToolsVersion
9999

100100
defaultConfig {
101101
applicationId "com.adjust.examples"
102-
minSdkVersion 16
103-
targetSdkVersion 26
102+
minSdkVersion rootProject.ext.minSdkVersion
103+
targetSdkVersion rootProject.ext.targetSdkVersion
104104
versionCode 1
105105
versionName "1.0"
106106
ndk {
@@ -138,11 +138,13 @@ android {
138138

139139
dependencies {
140140
compile project(':react-native-adjust')
141-
compile fileTree(dir: "libs", include: ["*.jar"])
142-
compile "com.android.support:appcompat-v7:26.+"
143-
compile "com.facebook.react:react-native:+" // From node_modules
144-
compile 'com.android.installreferrer:installreferrer:1.0'
145-
compile 'com.google.android.gms:play-services-analytics:16.0.4'
141+
implementation fileTree(dir: "libs", include: ["*.jar"])
142+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
143+
implementation "com.facebook.react:react-native:+" // From node_modules
144+
145+
implementation project(':react-native-adjust')
146+
implementation 'com.android.installreferrer:installreferrer:1.0'
147+
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
146148
}
147149

148150
// Run this once to be able to run the application with BUCK

example/android/build.gradle

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4+
ext {
5+
buildToolsVersion = "27.0.3"
6+
minSdkVersion = 17
7+
compileSdkVersion = 27
8+
targetSdkVersion = 27
9+
supportLibVersion = "27.1.1"
10+
}
411
repositories {
12+
google()
513
jcenter()
614
}
715
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.3'
16+
classpath 'com.android.tools.build:gradle:3.1.4'
917

1018
// NOTE: Do not place your application dependencies here; they belong
1119
// in the individual module build.gradle files
@@ -15,13 +23,17 @@ buildscript {
1523
allprojects {
1624
repositories {
1725
mavenLocal()
26+
google()
1827
jcenter()
1928
maven {
2029
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2130
url "$rootDir/../node_modules/react-native/android"
2231
}
23-
maven {
24-
url "https://maven.google.com"
25-
}
2632
}
2733
}
34+
35+
36+
task wrapper(type: Wrapper) {
37+
gradleVersion = '4.4'
38+
distributionUrl = distributionUrl.replace("bin", "all")
39+
}

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

example/android/settings.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
rootProject.name = 'example'
22
include ':react-native-adjust'
33
project(':react-native-adjust').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-adjust/android')
4+
include ':react-native-adjust'
5+
project(':react-native-adjust').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-adjust/android')
6+
include ':react-native-adjust'
7+
project(':react-native-adjust').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-adjust/android')
48

59
include ':app'

example/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4123,7 +4123,7 @@ react-is@^16.3.1:
41234123
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.3.2.tgz#f4d3d0e2f5fbb6ac46450641eb2e25bf05d36b22"
41244124

41254125
react-native-adjust@../temp:
4126-
version "4.14.0"
4126+
version "4.17.0"
41274127

41284128
41294129
version "0.55.4"

ext/android/sdk

Submodule sdk updated 355 files

ext/ios/sdk

Submodule sdk updated 72 files

index.js

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ if (Platform.OS === "android") {
1515
module_adjust_emitter = new NativeEventEmitter(NativeModules.AdjustEventEmitter);
1616
}
1717

18-
// Adjust //
18+
// Adjust
1919

2020
var Adjust = {};
2121

2222
Adjust.create = function(adjustConfig) {
2323
module_adjust.create(adjustConfig);
2424
};
2525

26-
Adjust.trackEvent = function (adjustEvent) {
26+
Adjust.trackEvent = function(adjustEvent) {
2727
module_adjust.trackEvent(adjustEvent);
2828
};
2929

@@ -105,6 +105,10 @@ Adjust.getAmazonAdId = function(callback) {
105105
module_adjust.getAmazonAdId(callback);
106106
};
107107

108+
Adjust.getSdkVersion = function(callback) {
109+
module_adjust.getSdkVersion("react-native4.17.0", callback);
110+
}
111+
108112
Adjust.setReferrer = function(referrer) {
109113
module_adjust.setReferrer(referrer);
110114
};
@@ -172,10 +176,10 @@ Adjust.onPause = function(testParam) {
172176
module_adjust.onPause();
173177
};
174178

175-
// AdjustConfig //
179+
// AdjustConfig
176180

177181
var AdjustConfig = function(appToken, environment) {
178-
this.sdkPrefix = "react_native4.15.0";
182+
this.sdkPrefix = "react-native4.17.0";
179183
this.appToken = appToken;
180184
this.environment = environment;
181185
this.logLevel = null;
@@ -262,6 +266,10 @@ AdjustConfig.prototype.setDeviceKnown = function(isDeviceKnown) {
262266
this.isDeviceKnown = isDeviceKnown;
263267
};
264268

269+
AdjustConfig.prototype.setSdkPrefix = function(sdkPrefix) {
270+
this.sdkPrefix = sdkPrefix;
271+
};
272+
265273
AdjustConfig.prototype.setReadMobileEquipmentIdentity = function(readMobileEquipmentIdentity) {
266274
// this.readMobileEquipmentIdentity = readMobileEquipmentIdentity;
267275
};
@@ -324,45 +332,45 @@ AdjustConfig.prototype.setDeferredDeeplinkCallbackListener = function(deferredDe
324332
}
325333
};
326334

327-
// AdjustEvent //
335+
// AdjustEvent
328336

329-
var AdjustEvent = function (eventToken) {
337+
var AdjustEvent = function(eventToken) {
330338
this.eventToken = eventToken;
331339
this.revenue = null;
332340
this.currency = null;
333341
this.transactionId = null;
334342
this.callbackId = null;
335343
this.callbackParameters = {};
336344
this.partnerParameters = {};
345+
};
346+
347+
AdjustEvent.prototype.setRevenue = function(revenue, currency) {
348+
if (revenue != null) {
349+
this.revenue = revenue.toString();
350+
this.currency = currency;
351+
}
352+
};
353+
354+
AdjustEvent.prototype.addCallbackParameter = function(key, value) {
355+
if (typeof key !== 'string' || typeof value !== 'string') {
356+
return;
357+
}
358+
this.callbackParameters[key] = value;
359+
};
360+
361+
AdjustEvent.prototype.addPartnerParameter = function(key, value) {
362+
if (typeof key !== 'string' || typeof value !== 'string') {
363+
return;
364+
}
365+
this.partnerParameters[key] = value;
366+
};
367+
368+
AdjustEvent.prototype.setTransactionId = function(transactionId) {
369+
this.transactionId = transactionId;
370+
};
337371

338-
this.setRevenue = function(revenue, currency) {
339-
if (revenue != null) {
340-
this.revenue = revenue.toString();
341-
this.currency = currency;
342-
}
343-
};
344-
345-
this.addCallbackParameter = function(key, value) {
346-
if (typeof key !== 'string' || typeof value !== 'string') {
347-
return;
348-
}
349-
this.callbackParameters[key] = value;
350-
};
351-
352-
this.addPartnerParameter = function(key, value) {
353-
if (typeof key !== 'string' || typeof value !== 'string') {
354-
return;
355-
}
356-
this.partnerParameters[key] = value;
357-
};
358-
359-
this.setTransactionId = function(transactionId) {
360-
this.transactionId = transactionId;
361-
};
362-
363-
this.setCallbackId = function(callbackId) {
364-
this.callbackId = callbackId;
365-
};
372+
AdjustEvent.prototype.setCallbackId = function(callbackId) {
373+
this.callbackId = callbackId;
366374
};
367375

368376
module.exports = { Adjust, AdjustEvent, AdjustConfig }

ios/Adjust/ADJActivityHandler.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
#import "Adjust.h"
1010
#import "ADJResponseData.h"
11+
#import "ADJActivityState.h"
12+
#import "ADJDeviceInfo.h"
13+
#import "ADJSessionParameters.h"
1114

1215
@interface ADJInternalState : NSObject
1316

@@ -83,7 +86,6 @@
8386
retriesLeft:(int)retriesLeft;
8487

8588
- (void)setOfflineMode:(BOOL)offline;
86-
- (ADJInternalState*) internalState;
8789
- (void)sendFirstPackages;
8890

8991
- (void)addSessionCallbackParameter:(NSString *)key
@@ -97,6 +99,11 @@
9799
- (NSString *)getBasePath;
98100
- (NSString *)getGdprPath;
99101

102+
- (ADJDeviceInfo *)deviceInfo;
103+
- (ADJActivityState *)activityState;
104+
- (ADJConfig *)adjustConfig;
105+
- (ADJSessionParameters *)sessionParameters;
106+
100107
- (void)teardown;
101108
+ (void)deleteState;
102109
@end

0 commit comments

Comments
 (0)