rn-auryc-sdk-voc
v2.3.11
Published
React native bridge library for Auryc SDK VOC Only
Downloads
5
Maintainers
Readme
rn-auryc-sdk
iOS
- Go to the root level of your project and add the Auryc bridge
npm install rn-auryc-sdk --save
react-native link rn-auryc-sdk
for projects using Cocoapods
Go to ./ios folder in your react native project and do the followings
1.1 make sure the following line is added to your Podfile
pod 'rn-auryc-sdk', :path => '../node_modules/rn-auryc-sdk'
1.2 Run the following commands
pod install pod update
for projects NOT using cocoapods
- Go to the {ProjectRootDirectory}/node_modules/rn-auryc-sdk/ios and copy (Command + C) AurycSDK.framework into {ProjectRootDirectory}/ios
2.1 Open your project on Xcode and drag AurycSDK.framework from {ProjectRootDirectory}/ios into the folder named after your App; Make sure 'Copy items if needed' is NOT selected
2.2 click on your Xcode project to reveal the project settings and go to General; scroll and find the section 'Embedded Binaries'
2.3 drag AurycSDK.framework file added to Xcode in step 2.1 into 'Embedded Binaries'
for all projects
- Call the following method when your app starts (when your root component loads):
componentDidMount () {
var Auryc = require('rn-auryc-sdk');
Auryc.initialize({YOUR_SITE_TOKEN}, {YOUR_SITE_ID});
}
- (Optional) Call the available APIs. Please refer to your portal instructions for the complete list of APIs.
var Auryc = require('rn-auryc-sdk');
Auryc.identify("[email protected]");
Auryc.track("Event name", {"property key" : "property value"});
Auryc.addSessionProperties({"property key" : "property value"});
Auryc.addUserProperties({'company': 'Example Inc'});
<View ref={ x => Auryc.markViewAsSensitiveInformation(x) }>
...
Android
Go to ./android folder in your react native project and add Auryc library
1.1 In the project level, build.gradle, add Auryc’s maven repository.
allprojects { repositories { ... maven { url "https://bintray.auryc.com/repository/android-sdk-voc/" } ... } }
1.2 In your res/values/strings.xml, add the token and site_id.
<string name="auryc_token">YOUR_SITE_TOKEN</string> <string name="auryc_site_id">YOUR_SITE_ID</string>
Add the Auryc package to your project
npm install rn-auryc-sdk
- Call the following method when your app starts (when your root component loads):
import Auryc from 'react-native-auryc';
onCreate () {
Auryc.initialize(YOUR_SITE_TOKEN, YOUR_SITE_ID);
}
- (Optional) Call the available APIs. Please refer to your portal instructions for the complete list of APIs.
Auryc.identify('[email protected]')
Auryc.addUserProperties({'company': 'Example Inc'});
...
- run your android project
npx react-native run-android
Other notes
Android integration
Use gradle version 4+
React-Native uses Android SDK version 23 which might introduce conflicts when newer version of SDK is used in your project. Consider adding the following block to build.gradle to resolve this.
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
}
}
}
}
Other Notes iOS
RNAuryc currently requires the compiler to be ‘Objective-C’ or ‘Objective-C++’ in XCode.
If you run into issues regarding
Print: Entry, “:CFBundleIdentifier”, Does Not Exist
follow the answers here: https://stackoverflow.com/a/41854111