insert-affiliate-react-native-sdk 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/readme.md +42 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "insert-affiliate-react-native-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "A package that will give context having implementation of react-native-branch and react-native-iap and iaptic validate api.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/readme.md
CHANGED
|
@@ -122,3 +122,45 @@ const App = () => {
|
|
|
122
122
|
export default App;
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
+
|
|
126
|
+
## Event Tracking (Beta)
|
|
127
|
+
|
|
128
|
+
The **InsertAffiliateReactNative SDK** now includes a beta feature for event tracking. You can use this feature to track specific user actions within your app. However, please note that this feature is currently in beta, and while we aim to secure its functionality, we cannot guarantee that it is fully resistant to tampering or manipulation at this stage.
|
|
129
|
+
|
|
130
|
+
### Using `trackEvent`
|
|
131
|
+
|
|
132
|
+
To track an event, then use the `trackEvent` function. Make sure to open an Affiliate's deep link before tracking the event; otherwise, event tracking won’t work. Here’s an example:
|
|
133
|
+
|
|
134
|
+
```javascript
|
|
135
|
+
const {
|
|
136
|
+
referrerLink,
|
|
137
|
+
subscriptions,
|
|
138
|
+
iapLoading,
|
|
139
|
+
handleBuySubscription,
|
|
140
|
+
userId,
|
|
141
|
+
userPurchase,
|
|
142
|
+
isIapticValidated,
|
|
143
|
+
trackEvent, // Required for trackEvent
|
|
144
|
+
} = useDeepLinkIapProvider();
|
|
145
|
+
|
|
146
|
+
<Button
|
|
147
|
+
title={'track event'}
|
|
148
|
+
onPress={() => {
|
|
149
|
+
trackEvent('event_name')
|
|
150
|
+
.then(() => console.log('Event tracked successfully!'))
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Example Usage
|
|
156
|
+
Set the Affiliate Identifier (required for tracking):
|
|
157
|
+
|
|
158
|
+
```swift
|
|
159
|
+
InsertAffiliateSwift.setInsertAffiliateIdentifier(referringLink: "your_affiliate_link")
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### Track an Event:
|
|
163
|
+
|
|
164
|
+
```swift
|
|
165
|
+
InsertAffiliateSwift.trackEvent(eventName: "user_signup")
|
|
166
|
+
```
|