Skip to content

Commit 62c6bfb

Browse files
authored
feat(isQualtricsInterceptAvailableForUser): return surveyUrl (#228)
WEB-2289 closes #227
1 parent e01a6cd commit 62c6bfb

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,13 +1615,15 @@ setQualtricsProperties: ({
16151615
16161616
### isQualtricsInterceptAvailableForUser
16171617
1618-
<kbd>App version >=24.12 (iOS only)</kbd>
1618+
<kbd>App version >=24.12 (iOS only)</kbd> <kbd>App version >=25.10:
1619+
surveyUrl</kbd>
16191620
16201621
Check if a Qualtrics intercept is available for the user, performing its
1621-
evaluation.
1622+
evaluation. When available, a `surveyUrl` with the generated survey url is
1623+
returned (only in App version >=25.10).
16221624
16231625
```ts
1624-
isQualtricsInterceptAvailableForUser: ({interceptId: string}) => Promise<{isAvailable: boolean}>;
1626+
isQualtricsInterceptAvailableForUser: ({interceptId: string}) => Promise<{isAvailable: boolean; surveyUrl?: string | null}>;
16251627
```
16261628
16271629
#### Error cases

src/post-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ export type ResponsesFromNativeApp = {
445445
IS_QUALTRICS_INTERCEPT_AVAILABLE_FOR_USER: {
446446
type: 'IS_QUALTRICS_INTERCEPT_AVAILABLE_FOR_USER';
447447
id: string;
448-
payload: {isAvailable: boolean};
448+
payload: {isAvailable: boolean; surveyUrl?: string | null};
449449
};
450450
REFRESH_NAV_BAR: {
451451
type: 'REFRESH_NAV_BAR';

src/qualtrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const isQualtricsInterceptAvailableForUser = ({
2828
interceptId,
2929
}: {
3030
interceptId: string;
31-
}): Promise<{isAvailable: boolean}> =>
31+
}): Promise<{isAvailable: boolean; surveyUrl?: string | null}> =>
3232
postMessageToNativeApp({
3333
type: 'IS_QUALTRICS_INTERCEPT_AVAILABLE_FOR_USER',
3434
payload: {interceptId},

0 commit comments

Comments
 (0)