Skip to content
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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### Version 4.17.0 (12th December 2018)
#### Added
- Added `getSdkVersion()` method to `Adjust` interface to obtain current SDK version string.

#### Changed
- Changed usage of `compile` keyword in plugin's `build.gradle` file into `implementation` (https://github.com/adjust/react_native_sdk/issues/47).

#### Native SDKs
- [[email protected]][ios_sdk_v4.17.1]
- [[email protected]][android_sdk_v4.17.0]

---

### Version 4.15.0 (10th October 2018)
#### Added
- 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.
Expand Down Expand Up @@ -247,6 +260,7 @@
[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
[ios_sdk_v4.15.0]: https://github.com/adjust/ios_sdk/tree/v4.15.0
[ios_sdk_v4.17.1]: https://github.com/adjust/ios_sdk/tree/v4.17.1

[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
Expand All @@ -261,3 +275,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
[android_sdk_v4.15.0]: https://github.com/adjust/android_sdk/tree/v4.15.0
[android_sdk_v4.17.0]: https://github.com/adjust/android_sdk/tree/v4.17.0
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ compile 'com.google.android.gms:play-services-analytics:10.0.1'

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.

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].

### <a id="android-proguard"></a>Proguard settings

If you are using Proguard, add these lines to your Proguard file:
Expand All @@ -213,20 +215,6 @@ If you are using Proguard, add these lines to your Proguard file:
java.lang.String getId();
boolean isLimitAdTrackingEnabled();
}
-keep class dalvik.system.VMRuntime {
java.lang.String getRuntime();
}
-keep class android.os.Build {
java.lang.String[] SUPPORTED_ABIS;
java.lang.String CPU_ABI;
}
-keep class android.content.res.Configuration {
android.os.LocaleList getLocales();
java.util.Locale locale;
}
-keep class android.os.LocaledList {
java.util.Locale get(int);
}
-keep public class com.android.installreferrer.** { *; }
```

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.15.0
4.17.0
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.facebook.react:react-native:+'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.facebook.react:react-native:+'
}
Binary file modified android/libs/adjust-android.jar
Binary file not shown.
10 changes: 10 additions & 0 deletions android/src/main/java/com/adjust/sdk/Adjust.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,16 @@ public void getAttribution(Callback callback) {
callback.invoke(AdjustUtil.attributionToMap(com.adjust.sdk.Adjust.getAttribution()));
}

@ReactMethod
public void getSdkVersion(String sdkPrefix, Callback callback) {
String sdkVersion = com.adjust.sdk.Adjust.getSdkVersion();
if (sdkVersion == null) {
callback.invoke("");
} else {
callback.invoke(sdkPrefix + "@" + sdkVersion);
}
}

@ReactMethod
public void setAttributionCallbackListener() {
this.attributionCallback = true;
Expand Down
4 changes: 4 additions & 0 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
this._onPress_getIds = this._onPress_getIds.bind(this);
this._onPress_isSdkEnabled = this._onPress_isSdkEnabled.bind(this);

Adjust.getSdkVersion(function(sdkVersion) {
console.log("Adjust SDK version: " + sdkVersion);
});

var adjustConfig = new AdjustConfig("2fm9gkqubvpc", AdjustConfig.EnvironmentSandbox);
adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose);
adjustConfig.setShouldLaunchDeeplink(true);
Expand Down
20 changes: 11 additions & 9 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 26
buildToolsVersion "26.0.3"
compileSdkVersion rootProject.ext.compileSdkVersion

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's cool!

buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "com.adjust.examples"
minSdkVersion 16
targetSdkVersion 26
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
Expand Down Expand Up @@ -138,11 +138,13 @@ android {

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

implementation project(':react-native-adjust')
implementation 'com.android.installreferrer:installreferrer:1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
}

// Run this once to be able to run the application with BUCK
Expand Down
20 changes: 16 additions & 4 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 17
compileSdkVersion = 27
targetSdkVersion = 27
supportLibVersion = "27.1.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.1.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,13 +23,17 @@ buildscript {
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url "https://maven.google.com"
}
}
}


task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
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 @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
4 changes: 4 additions & 0 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
rootProject.name = 'example'
include ':react-native-adjust'
project(':react-native-adjust').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-adjust/android')
include ':react-native-adjust'
project(':react-native-adjust').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-adjust/android')
include ':react-native-adjust'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated instruction

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, build scripts which are building and running our example app are making sure this happens each time we run them, but having in mind that it's an example app that we mostly use just to demonstrate how SDK API can be used, we're living with it. Will be addressed in future, but for now, it's like this. But fair point. 👍

project(':react-native-adjust').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-adjust/android')

include ':app'
2 changes: 1 addition & 1 deletion example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4123,7 +4123,7 @@ react-is@^16.3.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.3.2.tgz#f4d3d0e2f5fbb6ac46450641eb2e25bf05d36b22"

react-native-adjust@../temp:
version "4.14.0"
version "4.17.0"

[email protected]:
version "0.55.4"
Expand Down
2 changes: 1 addition & 1 deletion ext/android/sdk
Submodule sdk updated 355 files
2 changes: 1 addition & 1 deletion ext/ios/sdk
Submodule sdk updated 72 files
+2 −2 Adjust.podspec
+32 −6 Adjust.xcodeproj/project.pbxproj
+1 −1 Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme
+1 −1 Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdkIm.xcscheme
+1 −1 Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdkTv.xcscheme
+1 −1 Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdkWebBridge.xcscheme
+8 −1 Adjust/ADJActivityHandler.h
+11 −27 Adjust/ADJActivityHandler.m
+0 −1 Adjust/ADJAdjustFactory.h
+0 −3 Adjust/ADJAdjustFactory.m
+0 −2 Adjust/ADJAttributionHandler.h
+29 −20 Adjust/ADJAttributionHandler.m
+1 −0 Adjust/ADJConfig.h
+18 −13 Adjust/ADJPackageBuilder.h
+328 −205 Adjust/ADJPackageBuilder.m
+0 −6 Adjust/ADJReachability.h
+1 −18 Adjust/ADJReachability.m
+4 −0 Adjust/ADJUtil.h
+44 −1 Adjust/ADJUtil.m
+10 −1 Adjust/Adjust.h
+8 −0 Adjust/Adjust.m
+157 −43 AdjustBridge/AdjustBridge.m
+2 −26 AdjustBridge/AdjustBridgeRegister.h
+158 −152 AdjustBridge/AdjustBridgeRegister.m
+1 −1 AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m
+0 −1 AdjustSdkWebBridge/AdjustSdkWebBridge.h
+20 −0 AdjustTests/AdjustTestApp/AdjustTestApp.xcodeproj/project.pbxproj
+22 −0 AdjustTests/AdjustTestApp/AdjustTestApp/Assets.xcassets/LaunchImage.launchimage/Contents.json
+ AdjustTests/AdjustTestApp/AdjustTestApp/Assets.xcassets/LaunchImage.launchimage/[email protected]
+1 −1 AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.m
+1 −1 AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj
+1 −1 AdjustTests/AdjustUnitTests/ADJPackageFields.m
+5 −0 AdjustTests/AdjustUnitTests/AdjustExampleTests/Assets.xcassets/AppIcon.appiconset/Contents.json
+709 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp.xcodeproj/project.pbxproj
+91 −0 ...ustWebBridgeTestApp/AdjustWebBridgeTestApp.xcodeproj/xcshareddata/xcschemes/AdjustWebBridgeTestApp.xcscheme
+55 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AdjustTestApp-WebView.html
+15 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AppDelegate.h
+60 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AppDelegate.m
+98 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/Assets.xcassets/AppIcon.appiconset/Contents.json
+6 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/Assets.xcassets/Contents.json
+25 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/Base.lproj/LaunchScreen.storyboard
+24 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/Base.lproj/Main.storyboard
+45 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/Info.plist
+20 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.h
+534 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.js
+69 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.m
+18 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/UIWebViewController.h
+50 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/UIWebViewController.m
+19 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/WKWebViewController.h
+82 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/WKWebViewController.m
+16 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/main.m
+21 −0 CHANGELOG.md
+2 −2 README.md
+1 −1 VERSION
+1 −1 doc/english/migrate.md
+1 −1 doc/english/web_view_migration.md
+1 −1 doc/english/web_views.md
+1 −1 doc/japanese/migrate_ja.md
+1 −1 doc/migrate.md
+278 −276 examples/AdjustExample-FbPixel/AdjustExample-FbPixel.xcodeproj/project.pbxproj
+2 −2 examples/AdjustExample-FbPixel/AdjustExample-FbPixel/AppDelegate.m
+5 −3 examples/AdjustExample-Swift/AdjustExample-Swift.xcodeproj/project.pbxproj
+11 −11 examples/AdjustExample-Swift/AdjustExample-Swift/AppDelegate.swift
+1 −1 examples/AdjustExample-WebView/AdjustExample-WebView/AppDelegate.m
+108 −0 ...e/AdjustExample-iMessage.xcodeproj/xcshareddata/xcschemes/AdjustExample-iMessage MessagesExtension.xcscheme
+91 −0 ...ustExample-iMessage/AdjustExample-iMessage.xcodeproj/xcshareddata/xcschemes/AdjustExample-iMessage.xcscheme
+4 −0 examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj
+1 −3 examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m
+5 −0 examples/AdjustExample-iOS/AdjustExample-iOS/Assets.xcassets/AppIcon.appiconset/Contents.json
+4 −0 examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit Extension/InterfaceController.m
+2 −8 examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj
+2 −5 examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.m
76 changes: 42 additions & 34 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ if (Platform.OS === "android") {
module_adjust_emitter = new NativeEventEmitter(NativeModules.AdjustEventEmitter);
}

// Adjust //
// Adjust

var Adjust = {};

Adjust.create = function(adjustConfig) {
module_adjust.create(adjustConfig);
};

Adjust.trackEvent = function (adjustEvent) {
Adjust.trackEvent = function(adjustEvent) {
module_adjust.trackEvent(adjustEvent);
};

Expand Down Expand Up @@ -105,6 +105,10 @@ Adjust.getAmazonAdId = function(callback) {
module_adjust.getAmazonAdId(callback);
};

Adjust.getSdkVersion = function(callback) {
module_adjust.getSdkVersion("react-native4.17.0", callback);
}

Adjust.setReferrer = function(referrer) {
module_adjust.setReferrer(referrer);
};
Expand Down Expand Up @@ -172,10 +176,10 @@ Adjust.onPause = function(testParam) {
module_adjust.onPause();
};

// AdjustConfig //
// AdjustConfig

var AdjustConfig = function(appToken, environment) {
this.sdkPrefix = "react_native4.15.0";
this.sdkPrefix = "react-native4.17.0";
this.appToken = appToken;
this.environment = environment;
this.logLevel = null;
Expand Down Expand Up @@ -262,6 +266,10 @@ AdjustConfig.prototype.setDeviceKnown = function(isDeviceKnown) {
this.isDeviceKnown = isDeviceKnown;
};

AdjustConfig.prototype.setSdkPrefix = function(sdkPrefix) {
this.sdkPrefix = sdkPrefix;
};

AdjustConfig.prototype.setReadMobileEquipmentIdentity = function(readMobileEquipmentIdentity) {
// this.readMobileEquipmentIdentity = readMobileEquipmentIdentity;
};
Expand Down Expand Up @@ -324,45 +332,45 @@ AdjustConfig.prototype.setDeferredDeeplinkCallbackListener = function(deferredDe
}
};

// AdjustEvent //
// AdjustEvent

var AdjustEvent = function (eventToken) {
var AdjustEvent = function(eventToken) {
this.eventToken = eventToken;
this.revenue = null;
this.currency = null;
this.transactionId = null;
this.callbackId = null;
this.callbackParameters = {};
this.partnerParameters = {};
};

AdjustEvent.prototype.setRevenue = function(revenue, currency) {
if (revenue != null) {
this.revenue = revenue.toString();
this.currency = currency;
}
};

AdjustEvent.prototype.addCallbackParameter = function(key, value) {
if (typeof key !== 'string' || typeof value !== 'string') {
return;
}
this.callbackParameters[key] = value;
};

AdjustEvent.prototype.addPartnerParameter = function(key, value) {
if (typeof key !== 'string' || typeof value !== 'string') {
return;
}
this.partnerParameters[key] = value;
};

AdjustEvent.prototype.setTransactionId = function(transactionId) {
this.transactionId = transactionId;
};

this.setRevenue = function(revenue, currency) {
if (revenue != null) {
this.revenue = revenue.toString();
this.currency = currency;
}
};

this.addCallbackParameter = function(key, value) {
if (typeof key !== 'string' || typeof value !== 'string') {
return;
}
this.callbackParameters[key] = value;
};

this.addPartnerParameter = function(key, value) {
if (typeof key !== 'string' || typeof value !== 'string') {
return;
}
this.partnerParameters[key] = value;
};

this.setTransactionId = function(transactionId) {
this.transactionId = transactionId;
};

this.setCallbackId = function(callbackId) {
this.callbackId = callbackId;
};
AdjustEvent.prototype.setCallbackId = function(callbackId) {
this.callbackId = callbackId;
};

module.exports = { Adjust, AdjustEvent, AdjustConfig }
9 changes: 8 additions & 1 deletion ios/Adjust/ADJActivityHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#import "Adjust.h"
#import "ADJResponseData.h"
#import "ADJActivityState.h"
#import "ADJDeviceInfo.h"
#import "ADJSessionParameters.h"

@interface ADJInternalState : NSObject

Expand Down Expand Up @@ -83,7 +86,6 @@
retriesLeft:(int)retriesLeft;

- (void)setOfflineMode:(BOOL)offline;
- (ADJInternalState*) internalState;
- (void)sendFirstPackages;

- (void)addSessionCallbackParameter:(NSString *)key
Expand All @@ -97,6 +99,11 @@
- (NSString *)getBasePath;
- (NSString *)getGdprPath;

- (ADJDeviceInfo *)deviceInfo;
- (ADJActivityState *)activityState;
- (ADJConfig *)adjustConfig;
- (ADJSessionParameters *)sessionParameters;

- (void)teardown;
+ (void)deleteState;
@end
Expand Down
Loading