Skip to content

Commit

Permalink
Merge pull request #158 from Tealium/mt-1292
Browse files Browse the repository at this point in the history
Crash Reporter & Adobe Visitor API update
  • Loading branch information
craigrouse authored Aug 7, 2023
2 parents 5c1af1c + 5b5f583 commit a8c2ef3
Show file tree
Hide file tree
Showing 32 changed files with 940 additions and 160 deletions.
30 changes: 26 additions & 4 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ import AdjustRemoteCommand from 'tealium-react-adjust';
import { AdjustConfig, AdjustEnvironemnt } from 'tealium-react-adjust/common';
import AppsFlyerRemoteCommand from 'tealium-react-appsflyer';
import { checkAndRequestPermissions } from "./Utils"
import { AuthState } from 'tealium-react-native-adobe-visitor/common';
// import { AuthState } from 'tealium-react-native-adobe-visitor/common';
import TealiumCrashReporter from 'tealium-react-native-crash-reporter';

export default class App extends Component<{}> {

componentDidMount() {
// let adobeVisitorConfig: TealiumAdobeVisitorConfig = {
// adobeVisitorOrgId: "<YOUR-ADOBE-ORG-ID>"
// adobeVisitorOrgId: "YOUR-ADOBE-ORG-ID"
// }

let locationConfig: TealiumLocationConfig = {
Expand All @@ -52,12 +53,13 @@ export default class App extends Component<{}> {
allowSuppressLogLevel: false
}

// TealiumAdobeVisitor.configure(adobeVisitorConfig)
// TealiumAdobeVisitor.configure(adobeVisitorConfig);
TealiumLocation.configure(locationConfig);
FirebaseRemoteCommand.initialize();
BrazeRemoteCommand.initialize();
AdjustRemoteCommand.initialize(adjustConfig);
AppsFlyerRemoteCommand.initialize()
AppsFlyerRemoteCommand.initialize();
TealiumCrashReporter.initialize();
let config: TealiumConfig = {
account: 'tealiummobile',
profile: 'demo',
Expand Down Expand Up @@ -241,6 +243,10 @@ export default class App extends Component<{}> {
});
}

forceCrash() {
console.log(test.should.crash);
}

terminate() {
Tealium.terminateInstance();
}
Expand Down Expand Up @@ -291,6 +297,20 @@ export default class App extends Component<{}> {
});
}

getUrlParameters() {
TealiumAdobeVisitor.getUrlParameters(value => {
if (value === null || value === undefined) {
Alert.alert("Null Visitor","No data available for Adobe Visitor", [{ text: "OK", style: "cancel" }]);
return;
} else {
for (var key of Object.keys(value)) {
Alert.alert("Retrieved URL Parameters: ", key + "=" + value[key], [{ text: "OK", style: "cancel" }]);
break;
}
}
});
}

resetAdobeVisitor() {
TealiumAdobeVisitor.resetVisitor();
}
Expand Down Expand Up @@ -353,12 +373,14 @@ export default class App extends Component<{}> {
{ section: Sections.Visitor, text: "RESET VISITOR ID", onPress: this.resetVisitorId },
{ section: Sections.Visitor, text: "CLEAR STORED VISITOR IDS", onPress: this.clearStoredVisitorIds },
{ section: Sections.Misc, text: "GET SESSION ID", onPress: this.getSessionId },
{ section: Sections.Misc, text: "FORCE TEST CRASH", onPress: this.forceCrash },
{ section: Sections.Misc, text: "DISABLE TEALIUM", onPress: this.terminate },
{ section: Sections.Location, text: "GET LOCATION", onPress: this.getLastLocation },
{ section: Sections.Location, text: "START TRACKING LOCATION", onPress: this.startLocationTracking },
{ section: Sections.Location, text: "STOP TRACKING LOCATION", onPress: this.stopLocationTracking },
{ section: Sections.AdobeVisitorService, text: "GET CURRENT ADOBE VISITOR", onPress: this.getCurrentAdobeVisitor },
{ section: Sections.AdobeVisitorService, text: "DECORATE URL", onPress: this.decorateUrl },
{ section: Sections.AdobeVisitorService, text: "GET URL PARAMS", onPress: this.getUrlParameters },
{ section: Sections.AdobeVisitorService, text: "RESET ADOBE VISITOR", onPress: this.resetAdobeVisitor },
]
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
kotlin_version = '1.6.0'
kotlin_version = '1.8.22'
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
Expand Down
15 changes: 13 additions & 2 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,18 @@ target 'example' do
end

post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)

# Backport of: https://github.com/AlexanderEggers/react-native/blob/18ac6a3743749c0b8273c64dac982c30b74928e3/packages/react-native/scripts/cocoapods/utils.rb#L124
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
target_installation_result.native_target.build_configurations.each do |config|
# unary_function and binary_function are no longer provided in C++17 and newer standard modes as part of Xcode 15. They can be re-enabled with setting _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
# Ref: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Deprecations
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= '$(inherited) '
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << '"_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION" '
end
end
end
end
Loading

0 comments on commit a8c2ef3

Please sign in to comment.