The Tenjin React Native Plugin allows users to track events and installs in their iOS/Android apps. To learn more about Tenjin and our product offering, please visit https://www.tenjin.com.
On iOS:
For AppTrackingTransparency, be sure to update your project .plist
file and add NSUserTrackingUsageDescription
along with the text message you want to display to users. This library is only available in iOS 14.0+. For further information on this, you can check our iOS documentation
On Android: You will need to add Google's Install Referrer Library to your gradle dependencies. If you haven’t already installed the Google Play Services you also need to add it
dependencies {
classpath("com.android.installreferrer:installreferrer:1.1.2")
classpath("com.google.android.gms:play-services-analytics:17.0.0")
}
$ npm install react-native-tenjin --save
$ react-native link react-native-tenjin
import Tenjin from 'react-native-tenjin';
You need to initialize the plugin before doing calling any of the other methods available, for this, you would need the api key provided on Tenjin's dashboard:
Tenjin.initialize(apiKey)
Parameters:
apiKey
: String
Tenjin.connect()
Tenjin.setAppStore(type)
Parameters:
type
: String, possible values (googleplay, amazon, other)
Tenjin.optIn()
Tenjin.optOut()
Tenjin.optIn(parameters)
Parameters:
parameters
: Array
Tenjin.optOut(parameters)
Parameters:
parameters
: Array
transaction(productName, currencyCode, quantity, unitPrice)
Parameters:
productName
: StringcurrencyCode
: Stringquantity
: NumberunitPrice
: Number
Tenjin.eventWithName(name)
Parameters:
name
: String
Tenjin.eventWithNameAndValue(name, value)
Parameters:
name
: Stringvalue
: String
Tenjin.getAttributionInfo(
(success) => {
console.log(`Attibution info found! ${success}`);
},
() => {
console.error(`Attribution info failed`);
}
)
Parameters:
successCallback
: CallbackerrorCallback
: Callback
Tenjin.appendAppSubversion(subversion)
Parameters:
subversion
: Number
Tenjin.setCustomerUserId(userId)
Parameters:
userId
: string
Tenjin.getCustomerUserId()
Returns: callback -> string
Tenjin.eventAdImpressionAdMob(json)
Parameters:
json
: JSON
Tenjin.eventAdImpressionAppLovin(json)
Parameters:
json
: JSON
Tenjin.eventAdImpressionHyperBid(json)
Parameters:
json
: JSON
Tenjin.eventAdImpressionIronSource(json)
Parameters:
json
: JSON
Tenjin.eventAdImpressionTopOn(json)
Parameters:
json
: JSON
If you have any issues with the plugin integration or usage, please contact us to [email protected]