Skip to content

Commit

Permalink
Merge pull request #11 from tenjin/dg/release-1.1.2/TENJIN-20329
Browse files Browse the repository at this point in the history
Release 1.1.2 [TENJIN-20329]
  • Loading branch information
giraldogdiego authored Sep 3, 2024
2 parents 427dcbc + 1c48d89 commit a9eceba
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ Tenjin.optInGoogleDMA()

### Register transaction
```javascript
transaction(productName, currencyCode, quantity, unitPrice)
transactionWithReceipt(productName, currencyCode, quantity, unitPrice, transactionId, receipt)
```
Parameters:
- `productName`: String
- `currencyCode`: String
- `quantity`: Number
- `unitPrice`: Number
- `transactionId`: String
- `receipt`: String (Base 64)

### Send event with name
```javascript
Expand Down Expand Up @@ -199,5 +201,22 @@ Parameters:
- `adPersonalization`: Boolean
- `adUserData`: Boolean

### SKAdNetwork and Conversion value (iOS)

As part of <a href="https://developer.apple.com/documentation/storekit/skadnetwork">SKAdNetwork</a>, we created a wrapper method for <a href="https://developer.apple.com/documentation/storekit/skadnetwork/3919928-updatepostbackconversionvalue">`updatePostbackConversionValue(conversionValue: Integer)`</a>.
Our method will register the equivalent SKAdNetwork methods and also send the conversion values to our servers.

`updatePostbackConversionValue(conversionValue: Integer)` 6 bit value should correspond to the in-app event and shouldn’t be entered as binary representation but 0-63 integer.

As of iOS 16.1, which supports SKAdNetwork 4.0, you can now send `coarseValue` (String, with possible variants being "low", "medium" or "high") and `lockWindow` (Boolean) as parameters on the update postback method:

`updatePostbackConversionValue(conversionValue: Integer, coarseValue: String)`

`updatePostbackConversionValue(conversionValue: Integer, coarseValue: String, lockWindow: Bool)`

- For iOS version 16.1+ which supports SKAdNetwork 4.0, you can call this method as many times as you want and can make the conversion value lower or higher than the previous value.

- For iOS versions lower than 16.1 supporting SKAdnetWork versions lower than 4.0, you can call this method and our SDK will automatically detect the iOS version and update `conversionValue` only.

## Support
If you have any issues with the plugin integration or usage, please contact us to [email protected]
5 changes: 5 additions & 0 deletions android/src/main/java/com/tenjin/TenjinModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public void transaction(String productName, String currencyCode, Double quantity
instance.transaction(productName, currencyCode, Integer.valueOf(quantity.intValue()), unitPrice);
}

@ReactMethod
public void transactionWithReceipt(String productName, String currencyCode, Double quantity, Double unitPrice, String transaction, String data) {
instance.transaction(productName, currencyCode, Integer.valueOf(quantity.intValue()), unitPrice, transaction, data);
}

@ReactMethod
public void eventWithName(String name) {
instance.eventWithName(name);
Expand Down
11 changes: 11 additions & 0 deletions ios/Tenjin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ @implementation Tenjin
[TenjinSDK transactionWithProductName: productName andCurrencyCode: currencyCode andQuantity:quantity andUnitPrice: price];
}

RCT_EXPORT_METHOD(transactionWithReceipt:(NSString * _Nonnull)productName
currencyCode:(NSString * _Nonnull)currencyCode
quantity:(NSInteger)quantity
unitPrice:(double)unitPrice
transaction:(NSString * _Nonnull)transaction
data:(NSString * _Nonnull)data)
{
NSDecimalNumber *price = [[NSDecimalNumber alloc] initWithDouble:unitPrice];
[TenjinSDK transactionWithProductName: productName andCurrencyCode: currencyCode andQuantity:quantity andUnitPrice: price andTransactionId: transaction andBase64Receipt: data];
}

RCT_EXPORT_METHOD(eventWithName:(NSString * _Nonnull)name)
{
[TenjinSDK sendEventWithName:name];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-tenjin",
"title": "React Native Tenjin",
"version": "1.1.1",
"version": "1.1.2",
"description": "Tenjin is a unique growth infrastructure platform that helps you streamline your mobile marketing.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
2 changes: 1 addition & 1 deletion react-native-tenjin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm}"

s.dependency "React-Core"
s.dependency "TenjinSDK", "1.14.3"
s.dependency "TenjinSDK", "1.14.4"


# Don't install the dependencies when we run `pod install` in the old architecture.
Expand Down

0 comments on commit a9eceba

Please sign in to comment.