Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
PravinPK committed Nov 1, 2024
1 parent bf21c51 commit 189f9a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Called when the content card appears on the screen. Implementation of this metho

- _card_ - The [ContentCardUI](./contentcardui.md) that is displayed.

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Swift" />

#### Swift
Expand All @@ -55,6 +57,8 @@ Called when the content card is dismissed. Implementation of this method is opti

- _card_ - The [ContentCardUI](./contentcardui.md) that is dismissed.

#### Syntax

<CodeBlock slots="heading, code" repeat="1" languages="Swift" />

#### Swift
Expand All @@ -77,6 +81,8 @@ Called when the user interacts with the content card. Implementation of this met

A boolean value indicating whether the interaction event was handled. Return `true` if the client app has handled the `actionURL` associated with the interaction. Return `false` if the SDK should handle the `actionURL`.

#### Syntax

<CodeBlock slots="heading, code, content" repeat="1" languages="Swift" />

#### Swift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Messaging extension provides a way to customize content cards based on the templ

Perform the following steps to customize content card templates:

1. Conform to the [ContentCardCustomizing](../public-classes/contentcardcustomizing.md) protocol in your class or struct.
2. Implement the desired methods of the [ContentCardCustomizing](../public-classes/contentcardcustomizing.md) protocol.
1. Conform to the ContentCardCustomizing protocol in your class or struct.
2. Implement the desired methods of the ContentCardCustomizing protocol.

Below is an example implementation of `ContentCardCustomizing`. In this example, the `HomePageCardCustomizer` class conforms to the `ContentCardCustomizing` protocol and customizes the `SmallImageTemplate` content card template:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ struct HomePage: View, ContentCardUIEventListening {

## Handling actionable URLs

The `onInteract` method provides an optional `actionURL` parameter associated with the interaction event. To handle this URL in your application, return true from the `onInteract` method:
The `onInteract` method provides an optional `actionURL` parameter associated with the interaction event. The return value of this method determines how the URL is handled.

- Return `true` if your application has successfully handled the URL. This indicates to the SDK that no further action is needed.

- Return `false` to allow the SDK to process the URL.

<CodeBlock slots="heading, code" repeat="1" languages="Swift" />

Expand All @@ -93,7 +97,9 @@ The `onInteract` method provides an optional `actionURL` parameter associated wi
func onInteract(_ card: ContentCardUI, _ interactionId: String, actionURL: URL?) -> Bool {
guard let url = actionURL else { return false }

// Handle the actionable URL in your application
// Your application handles the actionable URL here

// Return true to indicate that the SDK need not process the URL
return true
}
```
Expand Down

0 comments on commit 189f9a6

Please sign in to comment.