Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
57349e7
Submodule updates
Dec 13, 2017
a81082b
Add setAppSecret to index.js
Dec 14, 2017
e59b0d2
Resync submodules with master branch in *_dev repo
Dec 14, 2017
cbdc3ea
Add setAppSecret() and update setReferrer()
Dec 14, 2017
8f6a05c
Update native linking methods
Dec 14, 2017
651d8ba
Updates after include react-native-adjust plugin to example app
Dec 14, 2017
6200bec
Update Android build script
Dec 14, 2017
3bd2a06
send appsecret info as string
Dec 14, 2017
66535d2
Update test script
Dec 14, 2017
d1297a5
Update adjust JAR
Dec 14, 2017
6dfa655
Add getAmazonAdId() and setUserKnown() to Android bridge and JS
Dec 18, 2017
a798ce5
Automatic build adjustments
Dec 18, 2017
4bc4278
Updating Adjust iOS directory with latest ios_sdk changes
Dec 18, 2017
a079c6c
Update iOS build script
Dec 18, 2017
3ae86c2
Update iOS test script
Dec 18, 2017
34c635f
Remove if statement for including RCTBridgeModule.h
Dec 18, 2017
2d21da3
Add setAppSecret(), getAmazonAdId(), and modify log level settings
Dec 18, 2017
bfff887
Add ADJReachability and ADJUserDefaults
Dec 18, 2017
0f0fde9
Add example app build files
Dec 18, 2017
cee98d6
Exclude ios/Build and ios/Index directories from git
Dec 18, 2017
ac2d6cb
Remove ios/Index and ios/Build from Git
Dec 18, 2017
a6529ee
Rename setUserKnown to setDeviceKnown and add setReadMobileEquipmentI…
Dec 19, 2017
c940b70
New version 4.12.0
uerceg Dec 22, 2017
1f479a7
Update SDK from Podspec to 4.12.0
uerceg Dec 22, 2017
d38770f
Moving isDeviceKnown to common fields
uerceg Dec 22, 2017
24370f8
Native submodules update
uerceg Dec 22, 2017
8449e0e
Fix typo from setUserKnown() to setDeviceKnown()
Dec 27, 2017
aa643d6
Tabularize assignments and add isDeviceKnown
Dec 27, 2017
d9c2409
Add setIsDeviceKnown()
Dec 27, 2017
2609e92
Change isDeviceKnown type from NSString to a proper NSNumber
Dec 27, 2017
2806192
Add ACCESS_NETWORK_STATE
Dec 27, 2017
1547248
Fix typo
Dec 27, 2017
232a41e
Update example app
Dec 27, 2017
f541b97
Add Google Play services to exaple app
Dec 28, 2017
0fa2bcb
Update example app with correct app secret
Dec 28, 2017
6a3f77d
Delete iOS Index folder from Git
Dec 28, 2017
6ee48c3
Enable Associated Domains for testing deferred depplinking in example…
Dec 28, 2017
4e18846
Automatic build changes from XCode
Dec 28, 2017
c991906
Update CHANGELOG
Dec 28, 2017
578abd9
Update example app's index.ios.js to be the same as Android
Dec 28, 2017
668bef2
Update test scripts to handle removal and uninstall of module better
Dec 28, 2017
f375000
Update CHANGELOG to reflect latest Android/iOS changes
Dec 28, 2017
eef41bd
Update .podspec file to match latest iOS SDK version
Dec 28, 2017
e43e329
Reinclude statement for importing RCTBridgeModule.h
Dec 28, 2017
de50df4
Add createJSModules() to support pre-0.47.0 RN apps
Dec 28, 2017
895028d
Add 'AdjustEventEmitter' to project
Dec 29, 2017
8846217
Modify middleware JS to accomodate for new emitter
Dec 29, 2017
13db9a8
Add public method to unsubscribe from listeners
Dec 29, 2017
88585e8
Remove dependency on RCTBridge component
Dec 29, 2017
97c0cb4
Use new AdjustEventEmitter for emitting events
Dec 29, 2017
7808618
Update example app's project
Dec 29, 2017
5ff2819
Update CHANGELOG
Dec 29, 2017
fd43855
Update README to accomodate for unsubscription
Dec 29, 2017
f8f0139
Remove 'react-native' import statement
Jan 2, 2018
f38a812
Add setReferrer() to middleware JS and iOS bridge
Jan 2, 2018
582b57d
Remove setReferrer() from AdjustConfig class
Jan 2, 2018
6f79de9
Android example app and script update
uerceg Jan 2, 2018
3e98cf5
Remove android.util.Log import statement
Jan 3, 2018
5f49186
Styling changes
Jan 3, 2018
c041237
Support dynamic versioning in Gradle dependencies
Jan 3, 2018
cbe6916
Remove app secret from example app
Jan 3, 2018
e8aeb4c
Add componentWillUnmount() to example app
Jan 3, 2018
c8f14b9
Modify deeplink schema in example app
Jan 3, 2018
61484b6
Fix potential null values for app secret in JS
Jan 3, 2018
a458cd4
Inline Long conversions in Obj-C for app secret
Jan 3, 2018
c890335
Modify handling of NSUrl to remove Xcode deprecation
Jan 3, 2018
a67b37c
Adding android:scheme to MainActivity
uerceg Jan 3, 2018
399f7d7
Removing unused field
uerceg Jan 3, 2018
f2e0c40
iOS bridge cleanup
uerceg Jan 3, 2018
63a4247
Example app cleanup
uerceg Jan 3, 2018
eeb14ce
Update CHANGELOG.md
uerceg Jan 3, 2018
92d8331
Update README.md
uerceg Jan 3, 2018
1f97f22
Update README.md
uerceg Jan 3, 2018
6ec424c
Amazon advertising identifier chapter cleanup
uerceg Jan 4, 2018
015c99b
Merge pull request #1 from adjust/v4120
uerceg Jan 4, 2018
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,6 @@ package-lock.json
# exceptions
!*adjust-android.jar
!android/libs/adjust*.jar

ios/Build/
ios/Index/
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "ext/Android/sdk"]
path = ext/Android/sdk
url = [email protected]:adjust/android_sdk.git
branch = react_native
url = [email protected]:adjust/android_sdk_dev.git
branch = master
[submodule "ext/iOS/sdk"]
path = ext/iOS/sdk
url = [email protected]:adjust/ios_sdk.git
branch = react_native
url = [email protected]:adjust/ios_sdk_dev.git
branch = master
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
### Version 4.12.0 (4th January 2018)
#### Native changes:
- **[iOS]** https://github.com/adjust/ios_sdk/blob/master/CHANGELOG.md#version-4120-13th-december-2017
- **[iOS]** https://github.com/adjust/ios_sdk/blob/master/CHANGELOG.md#version-4121-13th-december-2017
- **[AND]** https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md#version-4120-13th-december-2017

#### Added
- Added `getAmazonAdId` method to `Adjust` interface.
- Added `setAppSecret` method to `AdjustConfig` interface.
- Added `setReadMobileEquipmentIdentity` method to `AdjustConfig` interface.
- Added `componentWillUnmount` method to `Adjust` interface to unsubscribe from callbacks.

#### Changed
- Switched to `RCTEventEmitter` instead of `RCTBridge` for emitting native events ([reference](https://github.com/facebook/react-native/issues/8714)).

#### Native SDKs
- **[iOS]** [[email protected]][ios_sdk_v4.12.1]
- **[AND]** [[email protected]][android_sdk_v4.12.0]

---


### Version 4.11.7 (5th October 2017)
#### Added
- **[iOS]** Added support for `use_frameworks!` option in `Podfile` (thanks to @jimmy-devine).
Expand Down Expand Up @@ -146,9 +168,11 @@
[ios_sdk_v4.11.3]: https://github.com/adjust/ios_sdk/tree/v4.11.3
[ios_sdk_v4.11.4]: https://github.com/adjust/ios_sdk/tree/v4.11.4
[ios_sdk_v4.11.5]: https://github.com/adjust/ios_sdk/tree/v4.11.5
[ios_sdk_v4.12.1]: https://github.com/adjust/ios_sdk/tree/v4.12.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
[android_sdk_v4.11.1]: https://github.com/adjust/android_sdk/tree/v4.11.1
[android_sdk_v4.11.3]: https://github.com/adjust/android_sdk/tree/v4.11.3
[android_sdk_v4.11.4]: https://github.com/adjust/android_sdk/tree/v4.11.4
[android_sdk_v4.12.0]: https://github.com/adjust/android_sdk/tree/v4.12.0
152 changes: 128 additions & 24 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.11.7
4.12.0
Binary file modified android/libs/adjust-android.jar
Binary file not shown.
1 change: 1 addition & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.adjust.nativemodule">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application>
<receiver
Expand Down
68 changes: 55 additions & 13 deletions android/src/main/java/com/adjust/sdk/Adjust.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,25 @@ public boolean launchReceivedDeeplink(Uri uri) {

@ReactMethod
public void create(ReadableMap mapConfig) {
String environment = null;
String appToken = null;
String defaultTracker = null;
String processName = null;
String sdkPrefix = null;
String logLevel = null;
boolean eventBufferingEnabled = false;
String userAgent = null;
boolean sendInBackground = false;
boolean shouldLaunchDeeplink = false;
double delayStart = 0.0;
boolean isLogLevelSuppress = false;
String environment = null;
String appToken = null;
String defaultTracker = null;
String processName = null;
String sdkPrefix = null;
String logLevel = null;
boolean eventBufferingEnabled = false;
String userAgent = null;
long secretId = 0L;
long info1 = 0L;
long info2 = 0L;
long info3 = 0L;
long info4 = 0L;
boolean sendInBackground = false;
boolean shouldLaunchDeeplink = false;
double delayStart = 0.0;
boolean isLogLevelSuppress = false;
boolean isDeviceKnown = false;
boolean readMobileEquipmentIdentity = false;

// Check for isLogLevelSuppress.
if (!mapConfig.isNull("logLevel")) {
Expand Down Expand Up @@ -181,12 +188,40 @@ public void create(ReadableMap mapConfig) {
adjustConfig.setUserAgent(userAgent);
}

// App secret
if (!mapConfig.isNull("secretId")
&& !mapConfig.isNull("info1")
&& !mapConfig.isNull("info2")
&& !mapConfig.isNull("info3")
&& !mapConfig.isNull("info4")) {
try {
secretId = Long.parseLong(mapConfig.getString("secretId"), 10);
info1 = Long.parseLong(mapConfig.getString("info1"), 10);
info2 = Long.parseLong(mapConfig.getString("info2"), 10);
info3 = Long.parseLong(mapConfig.getString("info3"), 10);
info4 = Long.parseLong(mapConfig.getString("info4"), 10);
adjustConfig.setAppSecret(secretId, info1, info2, info3, info4);
} catch(NumberFormatException ignore) { }
}

// Background tracking
if (!mapConfig.isNull("sendInBackground")) {
sendInBackground = mapConfig.getBoolean("sendInBackground");
adjustConfig.setSendInBackground(sendInBackground);
}

// Set device Known
if (!mapConfig.isNull("isDeviceKnown")) {
isDeviceKnown = mapConfig.getBoolean("isDeviceKnown");
adjustConfig.setDeviceKnown(isDeviceKnown);
}

// Set read mobile equipment id
if (!mapConfig.isNull("readMobileEquipmentIdentity")) {
readMobileEquipmentIdentity = mapConfig.getBoolean("readMobileEquipmentIdentity");
adjustConfig.setReadMobileEquipmentIdentity(readMobileEquipmentIdentity);
}

// Launching deferred deep link
if (!mapConfig.isNull("shouldLaunchDeeplink")) {
shouldLaunchDeeplink = mapConfig.getBoolean("shouldLaunchDeeplink");
Expand Down Expand Up @@ -280,7 +315,9 @@ public void isEnabled(Callback callback) {

@ReactMethod
public void setReferrer(String referrer) {
com.adjust.sdk.Adjust.setReferrer(referrer);
com.adjust.sdk.Adjust.setReferrer(
referrer,
getReactApplicationContext());
}

@ReactMethod
Expand Down Expand Up @@ -354,6 +391,11 @@ public void getAdid(Callback callback) {
callback.invoke(com.adjust.sdk.Adjust.getAdid());
}

@ReactMethod
public void getAmazonAdId(Callback callback) {
callback.invoke(com.adjust.sdk.Adjust.getAmazonAdId(getReactApplicationContext()));
}

@ReactMethod
public void getAttribution(Callback callback) {
callback.invoke(AdjustUtil.attributionToMap(com.adjust.sdk.Adjust.getAttribution()));
Expand Down
11 changes: 6 additions & 5 deletions android/src/main/java/com/adjust/sdk/AdjustPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.ArrayList;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
Expand All @@ -22,18 +23,18 @@
public class AdjustPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(
new Adjust(reactContext)
);
List<NativeModule> modules = new ArrayList<>();
modules.add(new Adjust(reactContext));
return modules;
}

// Deprecated RN 0.47
// Deprecated in RN 0.47
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Arrays.<ViewManager>asList();
return Collections.emptyList();
}
}
5 changes: 3 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ android {
}

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

// Run this once to be able to run the application with BUCK
Expand Down
45 changes: 29 additions & 16 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,42 @@
android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_PHONE_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="adjust-example" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<receiver
android:name="com.adjust.sdk.AdjustReferrerReceiver"
android:exported="true" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.adjust.examples;

import android.app.Application;
import com.adjust.nativemodule.AdjustPackage;

import com.adjust.examples.BuildConfig;
import com.facebook.react.ReactApplication;
import com.adjust.nativemodule.AdjustPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
Expand Down
6 changes: 3 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ allprojects {
repositories {
mavenLocal()
jcenter()
maven {
url "https://jitpack.io"
}
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" // Google's Maven repository
}
}
}
4 changes: 2 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rootProject.name = 'example'

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

include ':app'
2 changes: 1 addition & 1 deletion example/app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "example",
"displayName": "example"
}
}
Loading