-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add In-App Forms to README #199
Draft
belleklaviyo
wants to merge
4
commits into
master
Choose a base branch
from
bl/IAF-readme
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -32,6 +32,10 @@ | |||||||||||||||||||||||||||||||||||||||||||||
- [Badge Count](#badge-count) | ||||||||||||||||||||||||||||||||||||||||||||||
- [Tracking Open Events](#tracking-open-events) | ||||||||||||||||||||||||||||||||||||||||||||||
- [Deep Linking](#deep-linking) | ||||||||||||||||||||||||||||||||||||||||||||||
- [In-App Forms](#in-app-forms) | ||||||||||||||||||||||||||||||||||||||||||||||
- [Prerequisites](#prerequisites-1) | ||||||||||||||||||||||||||||||||||||||||||||||
- [Setup](#setup-1) | ||||||||||||||||||||||||||||||||||||||||||||||
- [Behavior](#behavior) | ||||||||||||||||||||||||||||||||||||||||||||||
- [Troubleshooting](#troubleshooting) | ||||||||||||||||||||||||||||||||||||||||||||||
- [Contributing](#contributing) | ||||||||||||||||||||||||||||||||||||||||||||||
- [License](#license) | ||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -424,10 +428,11 @@ No additional setup is needed to support rich push on Android. | |||||||||||||||||||||||||||||||||||||||||||||
- [iOS](https://github.com/klaviyo/klaviyo-swift-sdk#Rich-Push) | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
#### Badge Count | ||||||||||||||||||||||||||||||||||||||||||||||
Klaviyo supports setting or incrementing the badge count on iOS when you send a push notification. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
Klaviyo supports setting or incrementing the badge count on iOS when you send a push notification. | ||||||||||||||||||||||||||||||||||||||||||||||
To enable this functionality, you will need to implement a notification service extension and app group | ||||||||||||||||||||||||||||||||||||||||||||||
as detailed in the [Swift SDK installation instructions](https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#installation). | ||||||||||||||||||||||||||||||||||||||||||||||
See the [badge count documentation](https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#badge-count) for more details. | ||||||||||||||||||||||||||||||||||||||||||||||
as detailed in the [Swift SDK installation instructions](https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#installation). | ||||||||||||||||||||||||||||||||||||||||||||||
See the [badge count documentation](https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#badge-count) for more details. | ||||||||||||||||||||||||||||||||||||||||||||||
Android automatically handles badge counts, and no additional setup is needed. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
#### Tracking Open Events | ||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -480,6 +485,42 @@ Linking.getInitialURL().then((url) => { | |||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
## In-App Forms | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
[In-app forms](https://help.klaviyo.com/hc/en-us/articles/34567685177883) are messages displayed to mobile app users while they are actively using an app. You can create new in-app forms in a drag-and-drop editor in the Sign-Up Forms tab in Klaviyo. Follow the instructions in this section to integrate forms with your app. The SDK will display forms according to their targeting and behavior settings and collect delivery and engagement analytics automatically. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
### Prerequisites | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
- Using Version 1.2.0 and higher | ||||||||||||||||||||||||||||||||||||||||||||||
- Import the Klaviyo module | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
### Setup | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
To display in-app forms, add the following code to your application | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||
import { Klaviyo } from "klaviyo-react-native-sdk"; | ||||||||||||||||||||||||||||||||||||||||||||||
... | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
// call this any time after initializing your public API key | ||||||||||||||||||||||||||||||||||||||||||||||
Klaviyo.registerForInAppForms(); | ||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
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. Something like this for android:
Suggested change
this suggestion block won't quite work because of nested back ticks :( ``` |
||||||||||||||||||||||||||||||||||||||||||||||
### Behavior | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
Once `registerForInAppForms()` is called, the SDK will load form data for your account and display no more than one form within 15 seconds, based on form targeting and behavior settings. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
You can call `registerForInAppForms()` any time after initializing with your public API key to control when and where in your app's UI a form can appear. It is safe to register multiple times per application session. The SDK will internally prevent multiple forms appearing at once. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
Consider how often you want to register for forms. For example, registering from a lifecycle event is advisable so that the user has multiple opportunities to see your messaging if they are browsing your app for a prolonged period. However, be advised the form will be shown as soon as it is ready, so you may still need to condition this based on the user's context within your application. Future versions of this product will provide more control in this regard. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| Callback | Description | | ||||||||||||||||||||||||||||||||||||||||||||||
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | | ||||||||||||||||||||||||||||||||||||||||||||||
| `const handleAppStateChange = async (nextAppState: string) => { Klaviyo.registerForInAppForms(); }` | Anytime the app is foregrounded, check for forms and show if available. | | ||||||||||||||||||||||||||||||||||||||||||||||
| `function App(): JSX.Element { useEffect(() => { Klaviyo.registerForInAppForms(); }};` | Show a form upon initial app launch. | | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
**Note**: At this time, when device orientation changes any currently visible form is closed and will not be re-displayed automatically. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
## Troubleshooting | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
Use the [troubleshooting guide](Troubleshooting.md) to resolve common issues with the Klaviyo React Native SDK. | ||||||||||||||||||||||||||||||||||||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.