rn-auryc-sdk

2.2.10 • Public • Published

rn-auryc-sdk

iOS

  1. 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

  1. 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

  1. 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

  1. 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});
}
  1. (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("abc@example.com");
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

  1. 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/"
        }
    
        ...
      }
    }
    

    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>
  2. Add the Auryc package to your project

npm install rn-auryc-sdk
  1. Call the following method when your app starts (when your root component loads):
import Auryc from 'rn-auryc-sdk';

onCreate () {
  Auryc.initialize(YOUR_SITE_TOKEN, YOUR_SITE_ID);
}
  1. (Optional) Call the available APIs. Please refer to your portal instructions for the complete list of APIs.
Auryc.identify('abc@example.com')
Auryc.addUserProperties({'company': 'Example Inc'});
...
  1. run your android project
npx react-native run-android

Other notes

Android integration

  1. Use gradle version 4+

  2. 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

  1. RNAuryc currently requires the compiler to be ‘Objective-C’ or ‘Objective-C++’ in XCode.

  2. If you run into issues regarding

Print: Entry, “:CFBundleIdentifier”, Does Not Exist

follow the answers here: https://stackoverflow.com/a/41854111

Package Sidebar

Install

npm i rn-auryc-sdk

Weekly Downloads

208

Version

2.2.10

License

MIT

Unpacked Size

41.9 MB

Total Files

1444

Last publish

Collaborators

  • auryc
  • alcides.zelaya