Skip to content

Commit

Permalink
Mt 975 (#128)
Browse files Browse the repository at this point in the history
* Core updates + Adjust Remote Command support

* Latest Tealium Android

* PR fixes per code review

* PR code review fixes

* Changelog update

* Update remote command dependency in Adjust RC

Co-authored-by: Karen Tamayo <[email protected]>
  • Loading branch information
tamayok and Karen Tamayo authored Jul 19, 2022
1 parent 04ad6be commit 6f1b35b
Show file tree
Hide file tree
Showing 45 changed files with 2,021 additions and 672 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

[Full documentation](https://docs.tealium.com/platforms/react-native/install/)

- 2.2.1
- Kotlin dependency upgraded to 1.4.1
- Swift dependency upgraded to 2.6.4
- Added overrideCollectProfile and sessionCountingEnabled keys to the config
- Added gatherTrackData method to tealium instance

- 2.2.0
- Support added up to React Native 0.67.1 + gradle 7
- Support for additional Optional Modules, as well as packaged Remote Commands
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Use of this software is subject to the terms and conditions of the license agree


---
Copyright (C) 2012-2021, Tealium Inc.
Copyright (C) 2012-2022, Tealium Inc.
22 changes: 22 additions & 0 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { TealiumLocationConfig, Accuracy, DesiredAccuracy } from 'tealium-react-
import { TealiumConfig, TealiumView, TealiumEvent, ConsentCategories, Dispatchers, Collectors, ConsentPolicy, Expiry, ConsentExpiry, TimeUnit, ConsentStatus, TealiumEnvironment, RemoteCommand } from 'tealium-react-native/common';
import FirebaseRemoteCommand from 'tealium-react-firebase';
import BrazeRemoteCommand from 'tealium-react-braze';
import AdjustRemoteCommand from 'tealium-react-adjust';
import { AdjustConfig, AdjustEnvironemnt} from 'tealium-react-adjust/common';
import { checkAndRequestPermissions } from "./Utils"

export default class App extends Component < {} > {
Expand All @@ -17,9 +19,16 @@ export default class App extends Component < {} > {
updateDistance: 150
}

let adjustConfig: AdjustConfig = {
appToken: "someToken",
environment: AdjustEnvironemnt.sandbox,
allowSuppressLogLevel: false
}

TealiumLocation.configure(locationConfig);
FirebaseRemoteCommand.initialize();
BrazeRemoteCommand.initialize();
AdjustRemoteCommand.initialize();
let config: TealiumConfig = {
account: 'tealiummobile',
profile: 'demo',
Expand Down Expand Up @@ -51,6 +60,9 @@ export default class App extends Component < {} > {
}, {
id: BrazeRemoteCommand.name,
path: 'braze.json'
}, {
id: AdjustRemoteCommand.name,
path: 'adjust.json'
}]
};
Tealium.initialize(config, success => {
Expand Down Expand Up @@ -148,6 +160,12 @@ export default class App extends Component < {} > {
})
}

gatherTrackData() {
Tealium.gatherTrackData(value => {
console.log("Track data: " + JSON.stringify(value))
})
}

removeData() {
Tealium.removeData(['test_session_data']);
Tealium.removeData(['my_test_value']);
Expand Down Expand Up @@ -259,6 +277,10 @@ export default class App extends Component < {} > {
<Text style={styles.textStyle}>GET DATA</Text>
</TouchableOpacity>
<View style={styles.space} />
<TouchableOpacity style={styles.buttonContainer} onPress={this.gatherTrackData}>
<Text style={styles.textStyle}>GATHER TRACK DATA</Text>
</TouchableOpacity>
<View style={styles.space} />
<TouchableOpacity style={styles.buttonContainer} onPress={this.removeData}>
<Text style={styles.textStyle}>REMOVE DATA</Text>
</TouchableOpacity>
Expand Down
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
59 changes: 59 additions & 0 deletions example/android/app/src/main/assets/adjust.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"config": {
"api_token": "<your api token>",
"sandbox": true,
"settings": {
"log_level": "verbose",
"app_secret" : "",
"app_secret_info_1" : "",
"app_secret_info_2" : "",
"app_secret_info_3" : "",
"app_secret_info_4" : "",
"url_strategy" : "",
"coppa_compliant": true,
"play_store_kids_enabled": true
}
},
"mappings": {
"event_token": "event_token",
"push_token": "push_token",
"order_total": "revenue",
"order_currency": "currency",
"order_id": "order_id",
"callback_id": "callback_id",
"source": "ad_revenue_source",
"payload": "ad_revenue_payload",
"deeplink_url": "deeplink_open_url",
"sku": "sku",
"signature": "signature",
"purchase_token": "purchase_token",
"event_param_1": "callback.param1",
"event_param_2": "callback.param2",
"partner_param_1": "partner.param1",
"partner_param_2": "partner.param2",
"session_param_1": "session_callback.param1",
"session_param_2": "session_callback.param2",
"session_callback_params": "session_callback",
"partner_session_param_1": "session_partner.param1",
"partner_session_param_2": "session_partner.param2",
"session_partner_params": "session_partner",
"consent_granted": "measurement_consent",
"enabled": "enabled,offline"
},
"commands": {
"launch": "initialize",
"purchase": "trackevent",
"event": "trackevent",
"track_deeplink": "appwillopenurl",
"ad_revenue": "trackadrevenue",
"subscribe": "tracksubscription",
"push_token": "setpushtoken",
"add_session_callback": "addsessioncallbackparams",
"add_session_partner": "addsessionpartnerparams",
"contact": "trackevent",
"consent_revoked": "gdprforgetme,trackmeasurementconsent",
"consent_granted": "trackmeasurementconsent",
"disable": "setenabled",
"offline": "setofflinemode"
}
}
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
buildToolsVersion = "30.0.2"
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
}
repositories {
Expand Down
Loading

0 comments on commit 6f1b35b

Please sign in to comment.