-
Notifications
You must be signed in to change notification settings - Fork 42
[MOB-12268] Add click handling and tracking #747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
00506f0
45ef4eb
9d60963
5c2bc6d
974e9b2
40f496f
6c418c3
ecb2204
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,11 @@ export interface Spec extends TurboModule { | |
| getEmbeddedMessages( | ||
| placementIds: number[] | null | ||
| ): Promise<EmbeddedMessage[]>; | ||
| trackEmbeddedClick( | ||
| message: EmbeddedMessage, | ||
| buttonId: string | null, | ||
| clickedUrl: string | null | ||
| ): void; | ||
|
Comment on lines
+158
to
+162
|
||
|
|
||
| // Wake app -- android only | ||
| wakeApp(): void; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||
| /** | ||||||
| * Enum representing the prefix of build-in custom action URL. | ||||||
|
||||||
| * Enum representing the prefix of build-in custom action URL. | |
| * Enum representing the prefix of built-in custom action URL. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ export * from './IterableEventName'; | |
| export * from './IterableLogLevel'; | ||
| export * from './IterablePushPlatform'; | ||
| export * from './IterableRetryBackoff'; | ||
| export * from './IterableCustomActionPrefix'; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about the custom prefix idea. Can DM you regarding this for clarification |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { Linking } from 'react-native'; | ||
| import type { IterableActionContext } from '../classes/IterableActionContext'; | ||
| import { IterableLogger } from '../classes/IterableLogger'; | ||
| import type { IterableConfig } from '../classes/IterableConfig'; | ||
|
|
||
| /** | ||
| * Calls the URL handler and attempts to open the URL if the handler returns false. | ||
| * | ||
| * @param config - The config to use. | ||
| * @param url - The URL to call. | ||
| * @param context - The context to use. | ||
| */ | ||
| export function callUrlHandler( | ||
| config: IterableConfig, | ||
| url: string, | ||
| context: IterableActionContext | ||
| ) { | ||
| if (!config.urlHandler?.(url, context)) { | ||
| Linking.canOpenURL(url) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be tested thoroughly to see its behavior. |
||
| .then((canOpen) => { | ||
| if (canOpen) { | ||
| Linking.openURL(url); | ||
| } else { | ||
| IterableLogger?.log('Url cannot be opened: ' + url); | ||
| } | ||
| }) | ||
| .catch((reason) => { | ||
| IterableLogger?.log('Error opening url: ' + reason); | ||
| }); | ||
| } | ||
qltysh[bot] marked this conversation as resolved.
Show resolved
Hide resolved
qltysh[bot] marked this conversation as resolved.
Show resolved
Hide resolved
qltysh[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annotation like @nullable here will future proof for kotlin conversion if it ever happens and also for test frameworks