Skip to content

Commit d659caa

Browse files
author
Uglješa Erceg
committed
Update README.md
1 parent 42069e1 commit d659caa

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ Press the same button to re-enable it.
9999

100100
#### iOS
101101

102-
The iOS build script is located at `Assets/Editor/PostprocessBuildPlayer_AdjustPostBuildiOS`. It changes the Unity3d iOS generated project in the following ways:
102+
The iOS build script is located at `Assets/Editor/PostprocessBuildPlayer_AdjustPostBuildiOS.py`. It changes the Unity3d iOS generated project in the following ways:
103103

104104
1. Adds the iAd and AdSupport frameworks to the project. This is required by the adjust SDK - check out the adjust
105105
[iOS][ios] page for more details.
106106

107-
2. Adds the other linker flag `-all_load`. This allows the adjust Objective-C categories to be recognized during the build time.
107+
2. Adds the other linker flag `-ObjC`. This allows the adjust Objective-C categories to be recognized during the build time.
108108

109109
If you have a custom build that puts the Unity3d iOS generated project in a different location,
110110
inform the script by clicking on the menu `Assets → Adjust → Set iOS build path` and choosing the build path of the iOS project.
@@ -113,7 +113,7 @@ After running, the script writes the log file `AdjustPostBuildiOSLog.txt` at the
113113

114114
#### Android
115115

116-
The android build script is located at `Assets/Editor/PostprocessBuildPlayer_AdjustPostBuildAndroid`. It changes the `AndroidManifest.xml` file located at `Assets/Plugins/Android/`. The problem with this approach is that, the manifest file used for the Android package was the one before the build process ended.
116+
The android build script is located at `Assets/Editor/PostprocessBuildPlayer_AdjustPostBuildAndroid.py`. It changes the `AndroidManifest.xml` file located at `Assets/Plugins/Android/`. The problem with this approach is that, the manifest file used for the Android package was the one before the build process ended.
117117

118118
To mitigate this, simply run the build again, using the manifest created or changed by the previous run, or click on the menu `Assets → Adjust → Fix AndroidManifest.xml` so the script can run before the build process. Either way, it is only necessary to do this step once, as long the manifest file remains compatible with the adjust SDK.
119119

@@ -156,6 +156,38 @@ adjustEvent.setRevenue (0.01, "EUR");
156156
Adjust.trackEvent (adjustEvent);
157157
```
158158

159+
#### iOS
160+
161+
##### <a id="deduplication"></a> Revenue deduplication
162+
163+
You can also pass in an optional transaction ID to avoid tracking duplicate revenues. The last ten transaction
164+
IDs are remembered and revenue events with duplicate transaction IDs are skipped. This is especially useful for
165+
in-app purchase tracking. See an example below.
166+
167+
If you want to track in-app purchases, please make sure to call `trackEvent` only if the transaction is finished
168+
and item is purchased. That way you can avoid tracking revenue that is not actually being generated.
169+
170+
```cs
171+
AdjustEvent adjustEvent = new AdjustEvent ("abc123");
172+
adjustEvent.setRevenue (0.01, "EUR");
173+
adjustEvent.setTransactionId ("transactionIdentifier");
174+
Adjust.trackEvent (adjustEvent);
175+
```
176+
177+
##### Receipt verification
178+
179+
If you track in-app purchases, you can also attach the receipt to the tracked event. In that case our servers
180+
will verify that receipt with Apple and discard the event if the verification failed. To make this work, you
181+
also need to send us the transaction ID of the purchase. The transaction ID will also be used for SDK side
182+
deduplication as explained [above](#deduplication):
183+
184+
```cs
185+
AdjustEvent adjustEvent = new AdjustEvent ("abc123");
186+
adjustEvent.setRevenue (0.01, "EUR");
187+
adjustEvent.setReceipt ("receipt", "transactionId");
188+
Adjust.trackEvent (adjustEvent);
189+
```
190+
159191
### 8. Add callback parameters
160192

161193
You can also register a callback URL for that event in your [dashboard] and we
@@ -302,7 +334,7 @@ If needed, disable dSYM File. In the `Project Navigator`, select the `Unity-iPho
302334

303335
### Build scripts
304336

305-
The post build scripts require execute permissions to be able to run. If the build process freezes in the end and opens one of the script files, this may be that your system is configured to not allow scripts to run by default. If this is the case, use the `chmod` tool in both `Assets/Editor/AdjustPostBuildiOS` and `Assets/Editor/AdjustPostBuildAndroid` to add execute privileges.
337+
The post build scripts require execute permissions to be able to run. If the build process freezes in the end and opens one of the script files, this may be that your system is configured to not allow scripts to run by default. If this is the case, use the `chmod` tool in both `Assets/Editor/PostprocessBuildPlayer_AdjustPostBuildiOS.py` and `Assets/Editor/PostprocessBuildPlayer_AdjustPostBuildAndroid.py` to add execute privileges.
306338

307339
[adjust.com]: http://adjust.com
308340
[dashboard]: http://adjust.com

0 commit comments

Comments
 (0)