@amplytools/react-native-amply-sdk 0.4.0 → 0.5.0
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/AmplyReactNative.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/tools/amply/sdk/reactnative/AmplyModule.kt +73 -0
- package/android/src/main/java/tools/amply/sdk/reactnative/core/AmplyClient.kt +36 -0
- package/android/src/main/java/tools/amply/sdk/reactnative/core/DefaultAmplyClient.kt +264 -0
- package/android/src/main/java/tools/amply/sdk/reactnative/core/GateDecision.kt +23 -0
- package/android/src/main/java/tools/amply/sdk/reactnative/model/CampaignPresentPayload.kt +18 -0
- package/android/src/main/java/tools/amply/sdk/reactnative/model/DeepLinkPayload.kt +15 -0
- package/android/src/newarch/java/tools/amply/sdk/reactnative/NativeAmplyModuleSpec.java +16 -0
- package/android/src/newarch/jni/AmplyReactNative-generated.cpp +19 -0
- package/dist/src/__tests__/campaignResolved.test.d.ts +2 -0
- package/dist/src/__tests__/campaignResolved.test.d.ts.map +1 -0
- package/dist/src/__tests__/campaignResolved.test.js +196 -0
- package/dist/src/index.d.ts +81 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +120 -0
- package/dist/src/nativeSpecs/NativeAmplyModule.d.ts +82 -0
- package/dist/src/nativeSpecs/NativeAmplyModule.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ios/Sources/AmplyReactNative/AmplyModule.mm +349 -0
- package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative-generated.mm +26 -0
- package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative.h +10 -0
- package/package.json +1 -1
- package/src/__tests__/campaignResolved.test.ts +276 -0
- package/src/index.ts +198 -0
- package/src/nativeSpecs/NativeAmplyModule.ts +82 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import * as Amply from '../index';
|
|
2
|
+
import { __setNativeModule } from '../nativeModule';
|
|
3
|
+
// Drains the microtask queue a few times so promise-chained presenter resolutions
|
|
4
|
+
// (sync or async) settle before assertions run.
|
|
5
|
+
async function flushMicrotasks() {
|
|
6
|
+
for (let i = 0; i < 5; i++) {
|
|
7
|
+
await Promise.resolve();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const mockNativeModule = {
|
|
11
|
+
initialize: jest.fn(),
|
|
12
|
+
isInitialized: jest.fn(() => true),
|
|
13
|
+
track: jest.fn(),
|
|
14
|
+
trackGated: jest.fn(),
|
|
15
|
+
resolveCampaign: jest.fn(),
|
|
16
|
+
getRecentEvents: jest.fn(),
|
|
17
|
+
getDataSetSnapshot: jest.fn(),
|
|
18
|
+
registerDeepLinkListener: jest.fn(),
|
|
19
|
+
registerGate: jest.fn(),
|
|
20
|
+
addListener: jest.fn(),
|
|
21
|
+
removeListeners: jest.fn(),
|
|
22
|
+
onSystemEvent: jest.fn(),
|
|
23
|
+
onDeepLink: jest.fn(),
|
|
24
|
+
onCampaignPresent: jest.fn(),
|
|
25
|
+
setCustomProperties: jest.fn(),
|
|
26
|
+
getCustomProperty: jest.fn(),
|
|
27
|
+
removeCustomProperty: jest.fn(),
|
|
28
|
+
clearCustomProperties: jest.fn(),
|
|
29
|
+
};
|
|
30
|
+
describe('Amply gate API (trackGated + registerGate)', () => {
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
jest.clearAllMocks();
|
|
33
|
+
Amply.removeAllListeners();
|
|
34
|
+
__setNativeModule(null);
|
|
35
|
+
});
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
__setNativeModule(mockNativeModule);
|
|
38
|
+
});
|
|
39
|
+
describe('trackEvent (fire-and-forget)', () => {
|
|
40
|
+
it('forwards to native track and never gates', async () => {
|
|
41
|
+
await Amply.trackEvent('SaveTapped', { foo: 'bar' });
|
|
42
|
+
expect(mockNativeModule.track).toHaveBeenCalledWith({
|
|
43
|
+
name: 'SaveTapped',
|
|
44
|
+
properties: { foo: 'bar' },
|
|
45
|
+
});
|
|
46
|
+
expect(mockNativeModule.trackGated).not.toHaveBeenCalled();
|
|
47
|
+
});
|
|
48
|
+
it('defaults missing properties to an empty object', async () => {
|
|
49
|
+
await Amply.trackEvent('Ping');
|
|
50
|
+
expect(mockNativeModule.track).toHaveBeenCalledWith({
|
|
51
|
+
name: 'Ping',
|
|
52
|
+
properties: {},
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
describe('trackGated', () => {
|
|
57
|
+
it('resolves proceed/completed when the gate is satisfied', async () => {
|
|
58
|
+
mockNativeModule.trackGated.mockResolvedValueOnce({
|
|
59
|
+
outcome: 'proceed',
|
|
60
|
+
reason: 'completed',
|
|
61
|
+
});
|
|
62
|
+
const decision = await Amply.trackGated('SaveTapped', { foo: 'bar' });
|
|
63
|
+
expect(mockNativeModule.trackGated).toHaveBeenCalledWith('SaveTapped', {
|
|
64
|
+
foo: 'bar',
|
|
65
|
+
});
|
|
66
|
+
expect(decision).toEqual({ outcome: 'proceed', reason: 'completed' });
|
|
67
|
+
});
|
|
68
|
+
it('resolves proceed/failOpen when the native layer reports fail-open', async () => {
|
|
69
|
+
mockNativeModule.trackGated.mockResolvedValueOnce({
|
|
70
|
+
outcome: 'proceed',
|
|
71
|
+
reason: 'failOpen',
|
|
72
|
+
});
|
|
73
|
+
const decision = await Amply.trackGated('SaveTapped', {});
|
|
74
|
+
expect(decision).toEqual({ outcome: 'proceed', reason: 'failOpen' });
|
|
75
|
+
});
|
|
76
|
+
it('resolves cancelled on a user dismiss under onAbort=cancel', async () => {
|
|
77
|
+
mockNativeModule.trackGated.mockResolvedValueOnce({ outcome: 'cancelled' });
|
|
78
|
+
const decision = await Amply.trackGated('SaveTapped', undefined);
|
|
79
|
+
expect(mockNativeModule.trackGated).toHaveBeenCalledWith('SaveTapped', {});
|
|
80
|
+
expect(decision).toEqual({ outcome: 'cancelled' });
|
|
81
|
+
});
|
|
82
|
+
it('never rejects — fails open to proceed/failOpen when native rejects', async () => {
|
|
83
|
+
mockNativeModule.trackGated.mockRejectedValueOnce(new Error('boom'));
|
|
84
|
+
const decision = await Amply.trackGated('SaveTapped', {});
|
|
85
|
+
expect(decision).toEqual({ outcome: 'proceed', reason: 'failOpen' });
|
|
86
|
+
});
|
|
87
|
+
it('fails open on an unexpected/malformed native decision', async () => {
|
|
88
|
+
mockNativeModule.trackGated.mockResolvedValueOnce({ outcome: 'wat' });
|
|
89
|
+
const decision = await Amply.trackGated('SaveTapped', {});
|
|
90
|
+
expect(decision).toEqual({ outcome: 'proceed', reason: 'failOpen' });
|
|
91
|
+
});
|
|
92
|
+
it('normalizes an unknown proceed reason to failOpen', async () => {
|
|
93
|
+
mockNativeModule.trackGated.mockResolvedValueOnce({
|
|
94
|
+
outcome: 'proceed',
|
|
95
|
+
reason: 'something-else',
|
|
96
|
+
});
|
|
97
|
+
const decision = await Amply.trackGated('SaveTapped', {});
|
|
98
|
+
expect(decision).toEqual({ outcome: 'proceed', reason: 'failOpen' });
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
describe('registerGate', () => {
|
|
102
|
+
it('registers once on the native module per baseUrl and subscribes to onCampaignPresent', async () => {
|
|
103
|
+
const remove = jest.fn();
|
|
104
|
+
mockNativeModule.onCampaignPresent.mockReturnValue({ remove });
|
|
105
|
+
const presenter = jest.fn();
|
|
106
|
+
const unsubscribe = await Amply.registerGate('stillframe://ad', presenter);
|
|
107
|
+
expect(mockNativeModule.registerGate).toHaveBeenCalledTimes(1);
|
|
108
|
+
expect(mockNativeModule.registerGate).toHaveBeenCalledWith('stillframe://ad', 'cancel', 0);
|
|
109
|
+
expect(mockNativeModule.onCampaignPresent).toHaveBeenCalledTimes(1);
|
|
110
|
+
// Second registration of the same baseUrl re-subscribes but does NOT re-register.
|
|
111
|
+
await Amply.registerGate('stillframe://ad', jest.fn());
|
|
112
|
+
expect(mockNativeModule.registerGate).toHaveBeenCalledTimes(1);
|
|
113
|
+
unsubscribe();
|
|
114
|
+
expect(remove).toHaveBeenCalledTimes(1);
|
|
115
|
+
});
|
|
116
|
+
it('passes through onAbort and timeoutMs options', async () => {
|
|
117
|
+
mockNativeModule.onCampaignPresent.mockReturnValue({ remove: jest.fn() });
|
|
118
|
+
await Amply.registerGate('stillframe://ad', jest.fn(), {
|
|
119
|
+
onAbort: 'proceed',
|
|
120
|
+
timeoutMs: 8000,
|
|
121
|
+
});
|
|
122
|
+
expect(mockNativeModule.registerGate).toHaveBeenCalledWith('stillframe://ad', 'proceed', 8000);
|
|
123
|
+
});
|
|
124
|
+
it('delivers params + info to the presenter and forwards completed', async () => {
|
|
125
|
+
let emit;
|
|
126
|
+
mockNativeModule.onCampaignPresent.mockImplementation((listener) => {
|
|
127
|
+
emit = listener;
|
|
128
|
+
return { remove: jest.fn() };
|
|
129
|
+
});
|
|
130
|
+
const presenter = jest.fn((_params, _info, resolution) => resolution.completed());
|
|
131
|
+
await Amply.registerGate('stillframe://ad', presenter);
|
|
132
|
+
expect(emit).toBeDefined();
|
|
133
|
+
emit({
|
|
134
|
+
url: 'stillframe://ad?adUnit=rewarded_main',
|
|
135
|
+
params: { adUnit: 'rewarded_main' },
|
|
136
|
+
info: { campaignId: 'c1' },
|
|
137
|
+
mediationId: 'm1',
|
|
138
|
+
});
|
|
139
|
+
await flushMicrotasks();
|
|
140
|
+
expect(presenter).toHaveBeenCalledWith({ adUnit: 'rewarded_main' }, { campaignId: 'c1' }, expect.any(Object));
|
|
141
|
+
expect(mockNativeModule.resolveCampaign).toHaveBeenCalledWith('m1', 'Completed');
|
|
142
|
+
});
|
|
143
|
+
it('forwards a dismissed resolution', async () => {
|
|
144
|
+
let emit;
|
|
145
|
+
mockNativeModule.onCampaignPresent.mockImplementation((listener) => {
|
|
146
|
+
emit = listener;
|
|
147
|
+
return { remove: jest.fn() };
|
|
148
|
+
});
|
|
149
|
+
await Amply.registerGate('stillframe://ad', (_p, _i, resolution) => resolution.dismissed());
|
|
150
|
+
emit({ url: 'stillframe://ad', params: {}, info: {}, mediationId: 'm2' });
|
|
151
|
+
await flushMicrotasks();
|
|
152
|
+
expect(mockNativeModule.resolveCampaign).toHaveBeenCalledWith('m2', 'Dismissed');
|
|
153
|
+
});
|
|
154
|
+
it('reports Unavailable (fail-open) when the presenter throws', async () => {
|
|
155
|
+
let emit;
|
|
156
|
+
mockNativeModule.onCampaignPresent.mockImplementation((listener) => {
|
|
157
|
+
emit = listener;
|
|
158
|
+
return { remove: jest.fn() };
|
|
159
|
+
});
|
|
160
|
+
await Amply.registerGate('stillframe://ad', () => {
|
|
161
|
+
throw new Error('presenter blew up');
|
|
162
|
+
});
|
|
163
|
+
emit({ url: 'stillframe://ad', params: {}, info: {}, mediationId: 'm3' });
|
|
164
|
+
await flushMicrotasks();
|
|
165
|
+
expect(mockNativeModule.resolveCampaign).toHaveBeenCalledWith('m3', 'Unavailable');
|
|
166
|
+
});
|
|
167
|
+
it('resolves at most once even if the presenter reports twice', async () => {
|
|
168
|
+
let emit;
|
|
169
|
+
mockNativeModule.onCampaignPresent.mockImplementation((listener) => {
|
|
170
|
+
emit = listener;
|
|
171
|
+
return { remove: jest.fn() };
|
|
172
|
+
});
|
|
173
|
+
await Amply.registerGate('stillframe://ad', (_p, _i, resolution) => {
|
|
174
|
+
resolution.completed();
|
|
175
|
+
resolution.dismissed();
|
|
176
|
+
});
|
|
177
|
+
emit({ url: 'stillframe://ad', params: {}, info: {}, mediationId: 'm4' });
|
|
178
|
+
await flushMicrotasks();
|
|
179
|
+
expect(mockNativeModule.resolveCampaign).toHaveBeenCalledTimes(1);
|
|
180
|
+
expect(mockNativeModule.resolveCampaign).toHaveBeenCalledWith('m4', 'Completed');
|
|
181
|
+
});
|
|
182
|
+
it('ignores dispatches whose url does not match the registered baseUrl', async () => {
|
|
183
|
+
let emit;
|
|
184
|
+
mockNativeModule.onCampaignPresent.mockImplementation((listener) => {
|
|
185
|
+
emit = listener;
|
|
186
|
+
return { remove: jest.fn() };
|
|
187
|
+
});
|
|
188
|
+
const presenter = jest.fn();
|
|
189
|
+
await Amply.registerGate('stillframe://ad', presenter);
|
|
190
|
+
emit({ url: 'other://thing', params: {}, info: {}, mediationId: 'm5' });
|
|
191
|
+
await flushMicrotasks();
|
|
192
|
+
expect(presenter).not.toHaveBeenCalled();
|
|
193
|
+
expect(mockNativeModule.resolveCampaign).not.toHaveBeenCalled();
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { useAmplySystemEvents } from './hooks/useAmplySystemEvents';
|
|
2
2
|
export { formatSystemEventLabel } from './systemEventUtils';
|
|
3
3
|
export type { FormatOptions } from './systemEventUtils';
|
|
4
|
-
import type { AmplyInitializationConfig, DataSetSnapshot, DataSetType, DeepLinkEvent, EventRecord, LogLevel, TrackEventPayload } from './nativeSpecs/NativeAmplyModule';
|
|
4
|
+
import type { CampaignResult, GateDecision, AmplyInitializationConfig, DataSetSnapshot, DataSetType, DeepLinkEvent, EventRecord, LogLevel, CampaignPresentEvent, TrackEventPayload } from './nativeSpecs/NativeAmplyModule';
|
|
5
5
|
export declare function initialize(config: AmplyInitializationConfig): Promise<void>;
|
|
6
6
|
/**
|
|
7
7
|
* Set the user ID for analytics. Pass null to clear.
|
|
@@ -20,6 +20,82 @@ export declare function setLogLevel(level: LogLevel): void;
|
|
|
20
20
|
export declare function getLogLevel(): LogLevel;
|
|
21
21
|
export declare function isInitialized(): boolean;
|
|
22
22
|
export declare function track(payload: TrackEventPayload): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Possible results a gate presenter can report. Re-exported from the
|
|
25
|
+
* native spec for app presenters.
|
|
26
|
+
*/
|
|
27
|
+
export type { CampaignResult, GateDecision };
|
|
28
|
+
/**
|
|
29
|
+
* Outcome of a gate presenter's presentation, reported back via {@link GateResolution}.
|
|
30
|
+
*/
|
|
31
|
+
export type GatePresenterResult = CampaignResult;
|
|
32
|
+
/**
|
|
33
|
+
* Resolution token handed to a {@link GatePresenter}. The presenter MUST report
|
|
34
|
+
* exactly one terminal result. Convenience helpers map to the underlying
|
|
35
|
+
* {@link CampaignResult}.
|
|
36
|
+
*/
|
|
37
|
+
export type GateResolution = {
|
|
38
|
+
/** The gate condition was satisfied (e.g. rewarded ad watched to completion). */
|
|
39
|
+
completed: () => void;
|
|
40
|
+
/** The user deliberately dismissed without satisfying the condition. */
|
|
41
|
+
dismissed: () => void;
|
|
42
|
+
/** Any non-user failure (no-fill, not-ready, failed-to-show). Fails open. */
|
|
43
|
+
unavailable: () => void;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* A capability presenter for a gate (blocking) action, registered via
|
|
47
|
+
* {@link registerGate} and keyed by the gate's `baseUrl`. Receives the parsed query
|
|
48
|
+
* `params`, the enriched `info`, and a {@link GateResolution} token it must resolve
|
|
49
|
+
* exactly once. Throwing synchronously is treated as `unavailable` (fail-open).
|
|
50
|
+
*/
|
|
51
|
+
export type GatePresenter = (params: Record<string, unknown>, info: Record<string, unknown>, resolution: GateResolution) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Options for {@link registerGate}.
|
|
54
|
+
*/
|
|
55
|
+
export type RegisterGateOptions = {
|
|
56
|
+
/**
|
|
57
|
+
* Abort policy when the user dismisses the gate without satisfying it.
|
|
58
|
+
* - `'cancel'` → {@link trackGated} resolves `{ outcome: 'cancelled' }`.
|
|
59
|
+
* - `'proceed'` → {@link trackGated} resolves `{ outcome: 'proceed', reason: 'failOpen' }`.
|
|
60
|
+
* Defaults to `'cancel'`.
|
|
61
|
+
*/
|
|
62
|
+
onAbort?: 'cancel' | 'proceed';
|
|
63
|
+
/**
|
|
64
|
+
* Max time (ms) the gate waits for a presenter result before failing open.
|
|
65
|
+
* Defaults to the SDK's gate default.
|
|
66
|
+
*/
|
|
67
|
+
timeoutMs?: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Fire-and-forget analytics track. Records the event and lets any matching NORMAL
|
|
71
|
+
* campaign action dispatch as usual. A gate action matched here will NOT block —
|
|
72
|
+
* there is no caller to gate. Use {@link trackGated} to await a gate.
|
|
73
|
+
*/
|
|
74
|
+
export declare function trackEvent(event: string, properties?: Record<string, unknown> | null): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Gated track. Records the event; if a gate action matches AND a presenter is
|
|
77
|
+
* registered for its `baseUrl`, the SDK dispatches the presentation and awaits its
|
|
78
|
+
* outcome before resolving:
|
|
79
|
+
* - `{ outcome: 'proceed', reason: 'completed' }` — the presenter satisfied the gate.
|
|
80
|
+
* - `{ outcome: 'proceed', reason: 'failOpen' }` — no gate matched, not initialized,
|
|
81
|
+
* timeout, unavailable, infra failure, or dismiss under `onAbort=proceed`.
|
|
82
|
+
* - `{ outcome: 'cancelled' }` — user dismiss under an `onAbort=cancel` gate.
|
|
83
|
+
*
|
|
84
|
+
* This NEVER rejects: any infra failure resolves to `{ outcome: 'proceed', reason:
|
|
85
|
+
* 'failOpen' }` so the caller is never stranded.
|
|
86
|
+
*/
|
|
87
|
+
export declare function trackGated(event: string, properties?: Record<string, unknown> | null): Promise<GateDecision>;
|
|
88
|
+
/**
|
|
89
|
+
* Register a gate presenter for a gate (blocking) action, keyed by its `baseUrl`.
|
|
90
|
+
* The presenter is invoked when a matching gate is dispatched; it receives the parsed
|
|
91
|
+
* query `params`, the enriched `info`, and a {@link GateResolution} it must resolve
|
|
92
|
+
* exactly once (`completed`/`dismissed`/`unavailable`). The SDK collapses multi-step
|
|
93
|
+
* ad lifecycles into the single result you report. A synchronous throw → `unavailable`
|
|
94
|
+
* (fail-open).
|
|
95
|
+
*
|
|
96
|
+
* @returns an unsubscribe function.
|
|
97
|
+
*/
|
|
98
|
+
export declare function registerGate(baseUrl: string, presenter: GatePresenter, opts?: RegisterGateOptions): Promise<() => void>;
|
|
23
99
|
export declare function getRecentEvents(limit: number): Promise<EventRecord[]>;
|
|
24
100
|
export declare function getDataSetSnapshot(type: DataSetType): Promise<DataSetSnapshot>;
|
|
25
101
|
export declare function addDeepLinkListener(listener: (event: DeepLinkEvent) => void): Promise<() => void>;
|
|
@@ -55,7 +131,7 @@ export declare function removeCustomProperty(key: string): void;
|
|
|
55
131
|
*/
|
|
56
132
|
export declare function clearCustomProperties(): void;
|
|
57
133
|
export declare function removeAllListeners(): void;
|
|
58
|
-
export type { AmplyInitializationConfig, DataSetSnapshot, DataSetType, DeepLinkEvent, EventRecord, LogLevel, TrackEventPayload, };
|
|
134
|
+
export type { AmplyInitializationConfig, DataSetSnapshot, DataSetType, DeepLinkEvent, EventRecord, LogLevel, CampaignPresentEvent, TrackEventPayload, };
|
|
59
135
|
export declare function addSystemEventsListener(listener: (event: EventRecord) => void): Promise<() => void>;
|
|
60
136
|
export declare const systemEvents: {
|
|
61
137
|
addListener: typeof addSystemEventsListener;
|
|
@@ -64,6 +140,9 @@ declare const _default: {
|
|
|
64
140
|
initialize: typeof initialize;
|
|
65
141
|
isInitialized: typeof isInitialized;
|
|
66
142
|
track: typeof track;
|
|
143
|
+
trackEvent: typeof trackEvent;
|
|
144
|
+
trackGated: typeof trackGated;
|
|
145
|
+
registerGate: typeof registerGate;
|
|
67
146
|
getRecentEvents: typeof getRecentEvents;
|
|
68
147
|
getDataSetSnapshot: typeof getDataSetSnapshot;
|
|
69
148
|
addDeepLinkListener: typeof addDeepLinkListener;
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,yBAAyB,EACzB,eAAe,EACf,WAAW,EACX,aAAa,EACb,WAAW,EACX,QAAQ,EACR,iBAAiB,EAClB,MAAM,iCAAiC,CAAC;
|
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AAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAE/E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,IAAI,CAEzF;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAIxF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAmBzC;AAED,YAAY,EACV,yBAAyB,EACzB,eAAe,EACf,WAAW,EACX,aAAa,EACb,WAAW,EACX,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,GAClB,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GACrC,OAAO,CAAC,MAAM,IAAI,CAAC,CAErB;AAED,eAAO,MAAM,YAAY;;CAExB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,wBAsBE"}
|
package/dist/src/index.js
CHANGED
|
@@ -4,7 +4,9 @@ export { useAmplySystemEvents } from './hooks/useAmplySystemEvents';
|
|
|
4
4
|
export { formatSystemEventLabel } from './systemEventUtils';
|
|
5
5
|
let deepLinkRegistered = false;
|
|
6
6
|
let debugLogListenerRegistered = false;
|
|
7
|
+
const registeredGates = new Set();
|
|
7
8
|
const deepLinkSubscriptions = new Set();
|
|
9
|
+
const campaignPresenterSubscriptions = new Set();
|
|
8
10
|
/**
|
|
9
11
|
* Format a debug log entry for console output using new format.
|
|
10
12
|
*/
|
|
@@ -107,6 +109,111 @@ export function isInitialized() {
|
|
|
107
109
|
export async function track(payload) {
|
|
108
110
|
await getNativeModule().track(payload);
|
|
109
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Fire-and-forget analytics track. Records the event and lets any matching NORMAL
|
|
114
|
+
* campaign action dispatch as usual. A gate action matched here will NOT block —
|
|
115
|
+
* there is no caller to gate. Use {@link trackGated} to await a gate.
|
|
116
|
+
*/
|
|
117
|
+
export async function trackEvent(event, properties) {
|
|
118
|
+
await getNativeModule().track({ name: event, properties: properties !== null && properties !== void 0 ? properties : {} });
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Gated track. Records the event; if a gate action matches AND a presenter is
|
|
122
|
+
* registered for its `baseUrl`, the SDK dispatches the presentation and awaits its
|
|
123
|
+
* outcome before resolving:
|
|
124
|
+
* - `{ outcome: 'proceed', reason: 'completed' }` — the presenter satisfied the gate.
|
|
125
|
+
* - `{ outcome: 'proceed', reason: 'failOpen' }` — no gate matched, not initialized,
|
|
126
|
+
* timeout, unavailable, infra failure, or dismiss under `onAbort=proceed`.
|
|
127
|
+
* - `{ outcome: 'cancelled' }` — user dismiss under an `onAbort=cancel` gate.
|
|
128
|
+
*
|
|
129
|
+
* This NEVER rejects: any infra failure resolves to `{ outcome: 'proceed', reason:
|
|
130
|
+
* 'failOpen' }` so the caller is never stranded.
|
|
131
|
+
*/
|
|
132
|
+
export async function trackGated(event, properties) {
|
|
133
|
+
const props = properties !== null && properties !== void 0 ? properties : {};
|
|
134
|
+
try {
|
|
135
|
+
const decision = (await getNativeModule().trackGated(event, props));
|
|
136
|
+
if (decision && decision.outcome === 'cancelled') {
|
|
137
|
+
return { outcome: 'cancelled' };
|
|
138
|
+
}
|
|
139
|
+
if (decision && decision.outcome === 'proceed') {
|
|
140
|
+
const reason = decision.reason === 'completed' ? 'completed' : 'failOpen';
|
|
141
|
+
return { outcome: 'proceed', reason };
|
|
142
|
+
}
|
|
143
|
+
// Unexpected/malformed payload: fail open.
|
|
144
|
+
console.warn('[Amply] trackGated returned an unexpected decision; failing open', decision);
|
|
145
|
+
return { outcome: 'proceed', reason: 'failOpen' };
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
// Fail open: any bridge/SDK failure must proceed, never strand the caller.
|
|
149
|
+
console.warn('[Amply] trackGated failed; proceeding (fail-open)', error);
|
|
150
|
+
return { outcome: 'proceed', reason: 'failOpen' };
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function trackCampaignPresenterSubscription(subscription) {
|
|
154
|
+
let removed = false;
|
|
155
|
+
const unsubscribe = () => {
|
|
156
|
+
var _a;
|
|
157
|
+
if (removed) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
removed = true;
|
|
161
|
+
(_a = subscription === null || subscription === void 0 ? void 0 : subscription.remove) === null || _a === void 0 ? void 0 : _a.call(subscription);
|
|
162
|
+
campaignPresenterSubscriptions.delete(unsubscribe);
|
|
163
|
+
};
|
|
164
|
+
campaignPresenterSubscriptions.add(unsubscribe);
|
|
165
|
+
return unsubscribe;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Register a gate presenter for a gate (blocking) action, keyed by its `baseUrl`.
|
|
169
|
+
* The presenter is invoked when a matching gate is dispatched; it receives the parsed
|
|
170
|
+
* query `params`, the enriched `info`, and a {@link GateResolution} it must resolve
|
|
171
|
+
* exactly once (`completed`/`dismissed`/`unavailable`). The SDK collapses multi-step
|
|
172
|
+
* ad lifecycles into the single result you report. A synchronous throw → `unavailable`
|
|
173
|
+
* (fail-open).
|
|
174
|
+
*
|
|
175
|
+
* @returns an unsubscribe function.
|
|
176
|
+
*/
|
|
177
|
+
export async function registerGate(baseUrl, presenter, opts) {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
const onAbort = (_a = opts === null || opts === void 0 ? void 0 : opts.onAbort) !== null && _a !== void 0 ? _a : 'cancel';
|
|
180
|
+
const timeoutMs = (_b = opts === null || opts === void 0 ? void 0 : opts.timeoutMs) !== null && _b !== void 0 ? _b : 0;
|
|
181
|
+
if (!registeredGates.has(baseUrl)) {
|
|
182
|
+
getNativeModule().registerGate(baseUrl, onAbort, timeoutMs);
|
|
183
|
+
registeredGates.add(baseUrl);
|
|
184
|
+
}
|
|
185
|
+
const nativeModule = getNativeModule();
|
|
186
|
+
const subscription = nativeModule.onCampaignPresent((event) => {
|
|
187
|
+
const { url, params, info, mediationId } = event;
|
|
188
|
+
// The native side routes by baseUrl, but guard here too in case multiple gates
|
|
189
|
+
// share the single onCampaignPresent channel.
|
|
190
|
+
if (baseUrl && url && !url.startsWith(baseUrl)) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
let settled = false;
|
|
194
|
+
const report = (result) => {
|
|
195
|
+
if (settled) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
settled = true;
|
|
199
|
+
nativeModule.resolveCampaign(mediationId, result);
|
|
200
|
+
};
|
|
201
|
+
const resolution = {
|
|
202
|
+
completed: () => report('Completed'),
|
|
203
|
+
dismissed: () => report('Dismissed'),
|
|
204
|
+
unavailable: () => report('Unavailable'),
|
|
205
|
+
};
|
|
206
|
+
try {
|
|
207
|
+
presenter((params !== null && params !== void 0 ? params : {}), info, resolution);
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
// Presenter failure is an infra failure, never a user dismiss → Unavailable.
|
|
211
|
+
console.warn('[Amply] gate presenter threw; reporting Unavailable (fail-open)', error);
|
|
212
|
+
report('Unavailable');
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
return trackCampaignPresenterSubscription(subscription);
|
|
216
|
+
}
|
|
110
217
|
export async function getRecentEvents(limit) {
|
|
111
218
|
return getNativeModule().getRecentEvents(limit);
|
|
112
219
|
}
|
|
@@ -170,6 +277,16 @@ export function removeAllListeners() {
|
|
|
170
277
|
}
|
|
171
278
|
});
|
|
172
279
|
deepLinkSubscriptions.clear();
|
|
280
|
+
campaignPresenterSubscriptions.forEach(unsubscribe => {
|
|
281
|
+
try {
|
|
282
|
+
unsubscribe();
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
console.warn('[Amply] Failed to remove gate presenter', error);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
campaignPresenterSubscriptions.clear();
|
|
289
|
+
registeredGates.clear();
|
|
173
290
|
}
|
|
174
291
|
export function addSystemEventsListener(listener) {
|
|
175
292
|
return addSystemEventListener(listener);
|
|
@@ -181,6 +298,9 @@ export default {
|
|
|
181
298
|
initialize,
|
|
182
299
|
isInitialized,
|
|
183
300
|
track,
|
|
301
|
+
trackEvent,
|
|
302
|
+
trackGated,
|
|
303
|
+
registerGate,
|
|
184
304
|
getRecentEvents,
|
|
185
305
|
getDataSetSnapshot,
|
|
186
306
|
addDeepLinkListener,
|
|
@@ -78,10 +78,91 @@ export type DeepLinkEvent = {
|
|
|
78
78
|
info: JsonMap;
|
|
79
79
|
consumed: boolean;
|
|
80
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Terminal result reported by a gate presenter back to the SDK.
|
|
83
|
+
*
|
|
84
|
+
* - 'Completed': the presenter satisfied the gate condition (e.g. rewarded ad
|
|
85
|
+
* watched to completion). The gate proceeds with reason `completed`.
|
|
86
|
+
* - 'Dismissed': a USER-INITIATED dismiss without satisfying the condition. With an
|
|
87
|
+
* `onAbort=cancel` gate this cancels; with `onAbort=proceed` it proceeds. Reserved
|
|
88
|
+
* strictly for user intent — never infra failures.
|
|
89
|
+
* - 'Unavailable': any non-user failure (no-fill, failed-to-show, not-ready, missing
|
|
90
|
+
* precondition). Always fails open and proceeds with reason `failOpen`.
|
|
91
|
+
*
|
|
92
|
+
* NOTE: this raw result is intentionally NOT surfaced to app gating code — the public
|
|
93
|
+
* `trackGated` surface only ever sees the collapsed {@link GateDecision}.
|
|
94
|
+
*/
|
|
95
|
+
export type CampaignResult = 'Completed' | 'Dismissed' | 'Unavailable';
|
|
96
|
+
/**
|
|
97
|
+
* Bridge-level gate decision, mirroring the KMP `GateDecision`:
|
|
98
|
+
* - `{ outcome: 'proceed', reason: 'completed' | 'failOpen' }` — the gate cleared.
|
|
99
|
+
* `completed` means the presenter satisfied the condition; `failOpen` means any
|
|
100
|
+
* infra/timeout/not-ready/dismiss-under-proceed path resolved permissively.
|
|
101
|
+
* - `{ outcome: 'cancelled' }` — a deliberate user dismiss under an `onAbort=cancel`
|
|
102
|
+
* gate. The caller should suppress its follow-up action.
|
|
103
|
+
*
|
|
104
|
+
* The raw {@link CampaignResult} is never surfaced here; it is collapsed natively.
|
|
105
|
+
*/
|
|
106
|
+
export type GateDecision = {
|
|
107
|
+
outcome: 'proceed';
|
|
108
|
+
reason: 'completed' | 'failOpen';
|
|
109
|
+
} | {
|
|
110
|
+
outcome: 'cancelled';
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Payload delivered to JS when a gate dispatches its (blocking) presentation.
|
|
114
|
+
* The JS handler must eventually report a {@link CampaignResult} for `mediationId`
|
|
115
|
+
* via `resolveCampaign`.
|
|
116
|
+
*/
|
|
117
|
+
export type CampaignPresentEvent = {
|
|
118
|
+
url: string;
|
|
119
|
+
/**
|
|
120
|
+
* Parsed query parameters from the gate action URL — a flat string map decoded
|
|
121
|
+
* from the URL query string (e.g. `{ adUnit: 'rewarded_main', placement: 'home' }`).
|
|
122
|
+
*/
|
|
123
|
+
params: JsonMap;
|
|
124
|
+
/**
|
|
125
|
+
* Enriched, decoupled action info:
|
|
126
|
+
* `{ url, campaignId, campaignName, triggeringEvent, triggeringProperties, content }`.
|
|
127
|
+
*/
|
|
128
|
+
info: JsonMap;
|
|
129
|
+
mediationId: string;
|
|
130
|
+
};
|
|
81
131
|
export interface Spec extends TurboModule {
|
|
82
132
|
initialize(config: AmplyInitializationConfig): Promise<void>;
|
|
83
133
|
isInitialized(): boolean;
|
|
84
134
|
track(payload: TrackEventPayload): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Gated form of track: records the event, evaluates campaigns, and — if a gate
|
|
137
|
+
* action matches and a presenter is registered — dispatches the gate presentation
|
|
138
|
+
* and awaits its outcome. Resolves with the collapsed {@link GateDecision} as a
|
|
139
|
+
* plain map:
|
|
140
|
+
* - `{ outcome: 'proceed', reason: 'completed' }` — gate satisfied.
|
|
141
|
+
* - `{ outcome: 'proceed', reason: 'failOpen' }` — any permissive path (no gate,
|
|
142
|
+
* not initialized, timeout, unavailable, dismiss under `onAbort=proceed`, infra
|
|
143
|
+
* failure).
|
|
144
|
+
* - `{ outcome: 'cancelled' }` — user dismiss under an `onAbort=cancel` gate.
|
|
145
|
+
*
|
|
146
|
+
* The raw {@link CampaignResult} is never returned to JS; it is collapsed natively.
|
|
147
|
+
* This promise MUST NOT reject — every failure path resolves to a `proceed`/failOpen.
|
|
148
|
+
*/
|
|
149
|
+
trackGated(event: string, properties: JsonMap): Promise<JsonMap>;
|
|
150
|
+
/**
|
|
151
|
+
* Report the terminal result of a gate presentation dispatched to JS via the
|
|
152
|
+
* `onCampaignPresent` event. Idempotent natively — late/duplicate calls are ignored.
|
|
153
|
+
* @param mediationId The id carried by the matching `onCampaignPresent` event.
|
|
154
|
+
* @param result One of {@link CampaignResult} ('Completed' | 'Dismissed' | 'Unavailable').
|
|
155
|
+
*/
|
|
156
|
+
resolveCampaign(mediationId: string, result: string): void;
|
|
157
|
+
/**
|
|
158
|
+
* Register the JS side as the recipient of gate presentation dispatches for the
|
|
159
|
+
* given `baseUrl`. The native side wires the gate; JS receives each dispatch via
|
|
160
|
+
* the `onCampaignPresent` event and replies through `resolveCampaign`.
|
|
161
|
+
* @param baseUrl The gate action base URL this presenter handles.
|
|
162
|
+
* @param onAbort Abort policy: 'cancel' (user dismiss cancels) or 'proceed'.
|
|
163
|
+
* @param timeoutMs Max time the gate waits for a presenter result before failing open.
|
|
164
|
+
*/
|
|
165
|
+
registerGate(baseUrl: string, onAbort: string, timeoutMs: number): void;
|
|
85
166
|
getRecentEvents(limit: number): Promise<EventRecord[]>;
|
|
86
167
|
getDataSetSnapshot(type: DataSetType): Promise<DataSetSnapshot>;
|
|
87
168
|
registerDeepLinkListener(): void;
|
|
@@ -122,6 +203,7 @@ export interface Spec extends TurboModule {
|
|
|
122
203
|
clearCustomProperties(): void;
|
|
123
204
|
readonly onSystemEvent: EventEmitter<SystemEventPayload>;
|
|
124
205
|
readonly onDeepLink: EventEmitter<DeepLinkEvent>;
|
|
206
|
+
readonly onCampaignPresent: EventEmitter<CampaignPresentEvent>;
|
|
125
207
|
addListener(eventName: string): void;
|
|
126
208
|
removeListeners(count: number): void;
|
|
127
209
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAmplyModule.d.ts","sourceRoot":"","sources":["../../../src/nativeSpecs/NativeAmplyModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2CAA2C,CAAC;AAE5E,KAAK,OAAO,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpE,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAA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