Skip to content

Commit dec16d8

Browse files
authored
Merge pull request #25 from adjust/v4120
Version 4.12.0
2 parents cb4396f + 015c99b commit dec16d8

Some content is hidden

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

66 files changed

+2541
-1092
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,6 @@ package-lock.json
9696
# exceptions
9797
!*adjust-android.jar
9898
!android/libs/adjust*.jar
99+
100+
ios/Build/
101+
ios/Index/

.gitmodules

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[submodule "ext/Android/sdk"]
22
path = ext/Android/sdk
3-
url = [email protected]:adjust/android_sdk.git
4-
branch = react_native
3+
url = [email protected]:adjust/android_sdk_dev.git
4+
branch = master
55
[submodule "ext/iOS/sdk"]
66
path = ext/iOS/sdk
7-
url = [email protected]:adjust/ios_sdk.git
8-
branch = react_native
7+
url = [email protected]:adjust/ios_sdk_dev.git
8+
branch = master

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
### Version 4.12.0 (4th January 2018)
2+
#### Native changes:
3+
- **[iOS]** https://github.com/adjust/ios_sdk/blob/master/CHANGELOG.md#version-4120-13th-december-2017
4+
- **[iOS]** https://github.com/adjust/ios_sdk/blob/master/CHANGELOG.md#version-4121-13th-december-2017
5+
- **[AND]** https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md#version-4120-13th-december-2017
6+
7+
#### Added
8+
- Added `getAmazonAdId` method to `Adjust` interface.
9+
- Added `setAppSecret` method to `AdjustConfig` interface.
10+
- Added `setReadMobileEquipmentIdentity` method to `AdjustConfig` interface.
11+
- Added `componentWillUnmount` method to `Adjust` interface to unsubscribe from callbacks.
12+
13+
#### Changed
14+
- Switched to `RCTEventEmitter` instead of `RCTBridge` for emitting native events ([reference](https://github.com/facebook/react-native/issues/8714)).
15+
16+
#### Native SDKs
17+
- **[iOS]** [[email protected]][ios_sdk_v4.12.1]
18+
- **[AND]** [[email protected]][android_sdk_v4.12.0]
19+
20+
---
21+
22+
123
### Version 4.11.7 (5th October 2017)
224
#### Added
325
- **[iOS]** Added support for `use_frameworks!` option in `Podfile` (thanks to @jimmy-devine).
@@ -146,9 +168,11 @@
146168
[ios_sdk_v4.11.3]: https://github.com/adjust/ios_sdk/tree/v4.11.3
147169
[ios_sdk_v4.11.4]: https://github.com/adjust/ios_sdk/tree/v4.11.4
148170
[ios_sdk_v4.11.5]: https://github.com/adjust/ios_sdk/tree/v4.11.5
171+
[ios_sdk_v4.12.1]: https://github.com/adjust/ios_sdk/tree/v4.12.1
149172

150173
[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
151174
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
152175
[android_sdk_v4.11.1]: https://github.com/adjust/android_sdk/tree/v4.11.1
153176
[android_sdk_v4.11.3]: https://github.com/adjust/android_sdk/tree/v4.11.3
154177
[android_sdk_v4.11.4]: https://github.com/adjust/android_sdk/tree/v4.11.4
178+
[android_sdk_v4.12.0]: https://github.com/adjust/android_sdk/tree/v4.12.0

README.md

Lines changed: 128 additions & 24 deletions
Large diffs are not rendered by default.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.11.7
1+
4.12.0

android/libs/adjust-android.jar

24.7 KB
Binary file not shown.

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.adjust.nativemodule">
33
<uses-permission android:name="android.permission.INTERNET" />
44
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
56

67
<application>
78
<receiver

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

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,25 @@ public boolean launchReceivedDeeplink(Uri uri) {
9696

9797
@ReactMethod
9898
public void create(ReadableMap mapConfig) {
99-
String environment = null;
100-
String appToken = null;
101-
String defaultTracker = null;
102-
String processName = null;
103-
String sdkPrefix = null;
104-
String logLevel = null;
105-
boolean eventBufferingEnabled = false;
106-
String userAgent = null;
107-
boolean sendInBackground = false;
108-
boolean shouldLaunchDeeplink = false;
109-
double delayStart = 0.0;
110-
boolean isLogLevelSuppress = false;
99+
String environment = null;
100+
String appToken = null;
101+
String defaultTracker = null;
102+
String processName = null;
103+
String sdkPrefix = null;
104+
String logLevel = null;
105+
boolean eventBufferingEnabled = false;
106+
String userAgent = null;
107+
long secretId = 0L;
108+
long info1 = 0L;
109+
long info2 = 0L;
110+
long info3 = 0L;
111+
long info4 = 0L;
112+
boolean sendInBackground = false;
113+
boolean shouldLaunchDeeplink = false;
114+
double delayStart = 0.0;
115+
boolean isLogLevelSuppress = false;
116+
boolean isDeviceKnown = false;
117+
boolean readMobileEquipmentIdentity = false;
111118

112119
// Check for isLogLevelSuppress.
113120
if (!mapConfig.isNull("logLevel")) {
@@ -181,12 +188,40 @@ public void create(ReadableMap mapConfig) {
181188
adjustConfig.setUserAgent(userAgent);
182189
}
183190

191+
// App secret
192+
if (!mapConfig.isNull("secretId")
193+
&& !mapConfig.isNull("info1")
194+
&& !mapConfig.isNull("info2")
195+
&& !mapConfig.isNull("info3")
196+
&& !mapConfig.isNull("info4")) {
197+
try {
198+
secretId = Long.parseLong(mapConfig.getString("secretId"), 10);
199+
info1 = Long.parseLong(mapConfig.getString("info1"), 10);
200+
info2 = Long.parseLong(mapConfig.getString("info2"), 10);
201+
info3 = Long.parseLong(mapConfig.getString("info3"), 10);
202+
info4 = Long.parseLong(mapConfig.getString("info4"), 10);
203+
adjustConfig.setAppSecret(secretId, info1, info2, info3, info4);
204+
} catch(NumberFormatException ignore) { }
205+
}
206+
184207
// Background tracking
185208
if (!mapConfig.isNull("sendInBackground")) {
186209
sendInBackground = mapConfig.getBoolean("sendInBackground");
187210
adjustConfig.setSendInBackground(sendInBackground);
188211
}
189212

213+
// Set device Known
214+
if (!mapConfig.isNull("isDeviceKnown")) {
215+
isDeviceKnown = mapConfig.getBoolean("isDeviceKnown");
216+
adjustConfig.setDeviceKnown(isDeviceKnown);
217+
}
218+
219+
// Set read mobile equipment id
220+
if (!mapConfig.isNull("readMobileEquipmentIdentity")) {
221+
readMobileEquipmentIdentity = mapConfig.getBoolean("readMobileEquipmentIdentity");
222+
adjustConfig.setReadMobileEquipmentIdentity(readMobileEquipmentIdentity);
223+
}
224+
190225
// Launching deferred deep link
191226
if (!mapConfig.isNull("shouldLaunchDeeplink")) {
192227
shouldLaunchDeeplink = mapConfig.getBoolean("shouldLaunchDeeplink");
@@ -280,7 +315,9 @@ public void isEnabled(Callback callback) {
280315

281316
@ReactMethod
282317
public void setReferrer(String referrer) {
283-
com.adjust.sdk.Adjust.setReferrer(referrer);
318+
com.adjust.sdk.Adjust.setReferrer(
319+
referrer,
320+
getReactApplicationContext());
284321
}
285322

286323
@ReactMethod
@@ -354,6 +391,11 @@ public void getAdid(Callback callback) {
354391
callback.invoke(com.adjust.sdk.Adjust.getAdid());
355392
}
356393

394+
@ReactMethod
395+
public void getAmazonAdId(Callback callback) {
396+
callback.invoke(com.adjust.sdk.Adjust.getAmazonAdId(getReactApplicationContext()));
397+
}
398+
357399
@ReactMethod
358400
public void getAttribution(Callback callback) {
359401
callback.invoke(AdjustUtil.attributionToMap(com.adjust.sdk.Adjust.getAttribution()));

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.util.Arrays;
1313
import java.util.Collections;
1414
import java.util.List;
15+
import java.util.ArrayList;
1516

1617
import com.facebook.react.ReactPackage;
1718
import com.facebook.react.bridge.JavaScriptModule;
@@ -22,18 +23,18 @@
2223
public class AdjustPackage implements ReactPackage {
2324
@Override
2425
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
25-
return Arrays.<NativeModule>asList(
26-
new Adjust(reactContext)
27-
);
26+
List<NativeModule> modules = new ArrayList<>();
27+
modules.add(new Adjust(reactContext));
28+
return modules;
2829
}
2930

30-
// Deprecated RN 0.47
31+
// Deprecated in RN 0.47
3132
public List<Class<? extends JavaScriptModule>> createJSModules() {
3233
return Collections.emptyList();
3334
}
3435

3536
@Override
3637
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
37-
return Arrays.<ViewManager>asList();
38+
return Collections.emptyList();
3839
}
3940
}

example/android/app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,12 @@ android {
133133
}
134134

135135
dependencies {
136+
compile project(':react-native-adjust')
136137
compile fileTree(dir: "libs", include: ["*.jar"])
137-
compile 'com.android.support:appcompat-v7:25.0.1'
138+
compile "com.android.support:appcompat-v7:25.0.1"
138139
compile "com.facebook.react:react-native:+" // From node_modules
139-
compile project(':react-native-adjust')
140140
compile 'com.google.android.gms:play-services-analytics:+'
141+
compile 'com.android.installreferrer:installreferrer:+'
141142
}
142143

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

example/android/app/src/main/AndroidManifest.xml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,42 @@
44
android:versionName="1.0">
55

66
<uses-permission android:name="android.permission.INTERNET" />
7+
<uses-permission android:name="android.permission.ACCESS_PHONE_STATE" />
78
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
89

910
<uses-sdk
1011
android:minSdkVersion="16"
1112
android:targetSdkVersion="22" />
1213

1314
<application
14-
android:name=".MainApplication"
15-
android:allowBackup="true"
16-
android:label="@string/app_name"
17-
android:icon="@mipmap/ic_launcher"
18-
android:theme="@style/AppTheme">
19-
<activity
20-
android:name=".MainActivity"
15+
android:name=".MainApplication"
16+
android:allowBackup="true"
2117
android:label="@string/app_name"
22-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
23-
android:windowSoftInputMode="adjustResize">
24-
<intent-filter>
25-
<action android:name="android.intent.action.MAIN" />
26-
<category android:name="android.intent.category.LAUNCHER" />
27-
</intent-filter>
28-
</activity>
29-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
18+
android:icon="@mipmap/ic_launcher"
19+
android:theme="@style/AppTheme">
20+
<activity
21+
android:name=".MainActivity"
22+
android:label="@string/app_name"
23+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
24+
android:windowSoftInputMode="adjustResize">
25+
<intent-filter>
26+
<action android:name="android.intent.action.MAIN" />
27+
<category android:name="android.intent.category.LAUNCHER" />
28+
</intent-filter>
29+
<intent-filter>
30+
<action android:name="android.intent.action.VIEW" />
31+
<category android:name="android.intent.category.DEFAULT" />
32+
<category android:name="android.intent.category.BROWSABLE" />
33+
<data android:scheme="adjust-example" />
34+
</intent-filter>
35+
</activity>
36+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
37+
<receiver
38+
android:name="com.adjust.sdk.AdjustReferrerReceiver"
39+
android:exported="true" >
40+
<intent-filter>
41+
<action android:name="com.android.vending.INSTALL_REFERRER" />
42+
</intent-filter>
43+
</receiver>
3044
</application>
31-
3245
</manifest>

example/android/app/src/main/java/com/adjust/examples/MainApplication.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package com.adjust.examples;
22

33
import android.app.Application;
4-
import com.adjust.nativemodule.AdjustPackage;
54

5+
import com.adjust.examples.BuildConfig;
66
import com.facebook.react.ReactApplication;
7+
import com.adjust.nativemodule.AdjustPackage;
78
import com.facebook.react.ReactNativeHost;
89
import com.facebook.react.ReactPackage;
910
import com.facebook.react.shell.MainReactPackage;

example/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ allprojects {
1616
repositories {
1717
mavenLocal()
1818
jcenter()
19-
maven {
20-
url "https://jitpack.io"
21-
}
2219
maven {
2320
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2421
url "$rootDir/../node_modules/react-native/android"
2522
}
23+
maven {
24+
url "https://maven.google.com" // Google's Maven repository
25+
}
2626
}
2727
}

example/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rootProject.name = 'example'
2-
3-
include ':app'
42
include ':react-native-adjust'
53
project(':react-native-adjust').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-adjust/android')
4+
5+
include ':app'

example/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "example",
33
"displayName": "example"
4-
}
4+
}

0 commit comments

Comments
 (0)