Skip to content

Commit 37be624

Browse files
authored
Add appsflyer UDL listeners (#126)
1 parent 1690b9d commit 37be624

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "median-js-bridge",
3-
"version": "2.13.3",
3+
"version": "2.13.4",
44
"description": "Median bridge and utilities for JS web frameworks",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ namespace Median {
169169
///////////////////////////////
170170
// Events //
171171
///////////////////////////////
172-
export const appsFlyerConversionData = createListenerProp<any>('_median_appsflyer_cd_success');
172+
export const appsFlyerConversionData = createListenerProp<any>('_median_appsflyer_cd');
173+
export const appsFlyerDeeplinkResult = createListenerProp<any>('_median_appsflyer_deeplink_result');
174+
export const appsFlyerSdkStart = createListenerProp<any>('_median_appsflyer_sdk_start');
173175
export const appResumed = createListenerProp('_median_app_resumed');
174176
export const branchInitialized = createListenerProp<BranchInitializedData>('_median_branch_initialized');
175177
export const deviceShake = createListenerProp('_median_device_shake');

src/plugins/appsflyer.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
import { AnyData } from '../types/index.js';
21
import { addCommand } from '../utils.js';
32

3+
/**
4+
* Appsflyer plugin for Median.
5+
* Provides methods to track events and associate actions with a user.
6+
*/
47
const appsflyer = {
5-
logEvent: function (eventName: string, eventValues: AnyData) {
8+
/**
9+
* Log a custom event to Appsflyer.
10+
*
11+
* @param eventName - The name of the event to be tracked.
12+
* @param eventValues - Key-value pairs containing event metadata.
13+
*/
14+
logEvent: function (eventName: string, eventValues: any) {
615
addCommand('median://appsflyer/logEvent', { eventName, eventValues });
716
},
17+
18+
/**
19+
* Set a unique customer user ID for Appsflyer.
20+
* This is typically used to associate events with a logged-in user.
21+
*
22+
* @param userId - Unique identifier for the current user.
23+
*/
824
setCustomerUserId: function (userId: string) {
925
addCommand('median://appsflyer/setCustomerUserId', { userId });
1026
},

0 commit comments

Comments
 (0)