Skip to content

Commit

Permalink
Merge pull request #1 from adjust/v4120
Browse files Browse the repository at this point in the history
V4120
  • Loading branch information
uerceg authored Jan 4, 2018
2 parents cb4396f + 6ec424c commit 015c99b
Show file tree
Hide file tree
Showing 66 changed files with 2,541 additions and 1,092 deletions.
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

0 comments on commit 015c99b

Please sign in to comment.