ReactNative SDK for SubTruck
Install and link react-native-appsflyer
Install and link react-native-adjust
Install and link react-native-idfa
Install and link react-native-device-info
Fetches product for current user.
- project: String - Project ID registered in SubTruck
- product:
- id: String
- period: String -
WEEKLY
|MONTHLY
|YEARLY
- trial: Number - amount days of free trial
SubTruck.fetchProduct('com.wowapp')
.then((product) => {
console.log(product);
});
Tracks event that current user has faced the product/price. Call it when user clicks 'Subscribe' button.
- project: String - Project ID registered in SubTruck
- productId: String
SubTruck.trackViewEvent('com.wowapp', 'com.wowapp.full.weekly');
Tracks event that current user has subscribed successfuly.
- project: String - Project ID registered in SubTruck
- transaction:
- orderId: String
- productId: String
- currency: String
- revenue: Double
- purchaseToken: String - Android purchase info
- transactionReceipt: String - iOS purchase info
- countryCode: String - country code, required for iOS
SubTruck.trackPurchaseEvent('com.wowapp', {
orderId: 'wow-transaction-id',
productId: 'com.wowapp.full.weekly',
currency: 'USD',
revenue: 4.99,
purchaseToken: "gho...4n8",
transactionReceipt: "od1...ju3",
countryCode: "US",
);