insert-affiliate-react-native-sdk 1.4.6 → 1.4.8
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/dist/DeepLinkIapProvider.js +5 -0
- package/package.json +1 -1
- package/readme.md +1 -0
- package/src/DeepLinkIapProvider.tsx +6 -0
|
@@ -390,6 +390,10 @@ const DeepLinkIapProvider = ({ children, }) => {
|
|
|
390
390
|
// MARK: Track Event
|
|
391
391
|
const trackEvent = (eventName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
392
392
|
try {
|
|
393
|
+
if (!companyCode || (companyCode.trim() === '' && companyCode !== null)) {
|
|
394
|
+
console.error("[Insert Affiliate] Company code is not set. Please initialize the SDK with a valid company code.");
|
|
395
|
+
return Promise.resolve();
|
|
396
|
+
}
|
|
393
397
|
if (!referrerLink || !userId) {
|
|
394
398
|
console.warn('[Insert Affiliate] No affiliate identifier found. Please set one before tracking events.');
|
|
395
399
|
return Promise.resolve();
|
|
@@ -397,6 +401,7 @@ const DeepLinkIapProvider = ({ children, }) => {
|
|
|
397
401
|
const payload = {
|
|
398
402
|
eventName,
|
|
399
403
|
deepLinkParam: `${referrerLink}/${userId}`,
|
|
404
|
+
companyId: companyCode,
|
|
400
405
|
};
|
|
401
406
|
const response = yield axios_1.default.post('https://api.insertaffiliate.com/v1/trackEvent', payload, {
|
|
402
407
|
headers: { 'Content-Type': 'application/json' },
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -118,6 +118,7 @@ React.useEffect(() => {
|
|
|
118
118
|
2. Configure the webhook with these settings:
|
|
119
119
|
- Webhook URL: `https://api.insertaffiliate.com/v1/api/revenuecat-webhook`
|
|
120
120
|
- Authorization header: Use the value from your Insert Affiliate dashboard (you'll get this in step 4)
|
|
121
|
+
- Set "Event Type" to "All events"
|
|
121
122
|
|
|
122
123
|
3. In your [Insert Affiliate dashboard settings](https://app.insertaffiliate.com/settings):
|
|
123
124
|
- Navigate to the verification settings
|
|
@@ -463,6 +463,11 @@ const DeepLinkIapProvider: React.FC<T_DEEPLINK_IAP_PROVIDER> = ({
|
|
|
463
463
|
// MARK: Track Event
|
|
464
464
|
const trackEvent = async (eventName: string): Promise<void> => {
|
|
465
465
|
try {
|
|
466
|
+
if (!companyCode || (companyCode.trim() === '' && companyCode !== null)) {
|
|
467
|
+
console.error("[Insert Affiliate] Company code is not set. Please initialize the SDK with a valid company code.");
|
|
468
|
+
return Promise.resolve();
|
|
469
|
+
}
|
|
470
|
+
|
|
466
471
|
if (!referrerLink || !userId) {
|
|
467
472
|
console.warn(
|
|
468
473
|
'[Insert Affiliate] No affiliate identifier found. Please set one before tracking events.'
|
|
@@ -473,6 +478,7 @@ const DeepLinkIapProvider: React.FC<T_DEEPLINK_IAP_PROVIDER> = ({
|
|
|
473
478
|
const payload = {
|
|
474
479
|
eventName,
|
|
475
480
|
deepLinkParam: `${referrerLink}/${userId}`,
|
|
481
|
+
companyId: companyCode,
|
|
476
482
|
};
|
|
477
483
|
|
|
478
484
|
const response = await axios.post(
|