You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Bump plist, package.json, xml to 1.3.0
* Chore | Yarn lockfile (#223)
* Had to run a yarn install to update lockfile (and husky i guess... still don't really know what husky is other than a dog)
* Husky got removed from dev dependencies causing new setups to be unable to add pre-commit hooks
* Required now
---------
Co-authored-by: Evan Masseau <>
* IAF | Update to the pending native releases (#222)
* Get the code compiling
* Use configure-sdk script to set to latest native SDK commit hashes for pending releases.
* Fix the config script to add all three pods. Update again
* pods must be added inside this block, so i added a comment to target the command to.
with this, the ios sample compiles
---------
Co-authored-by: Evan Masseau <>
* Disable local copy on switch to remote!
* Fix configure local script for swift SDK (#226)
* Was too fixated on the git branch/commit path, didn't notice I hadn't fixed the local SDK script
* comments
---------
Co-authored-by: Evan Masseau <>
* IAF | Android pre-release updates (#228)
* Android cleanup
* forgot to switch to latest android sdk commit for compiling in CI
---------
Co-authored-by: Evan Masseau <>
* Bump example to the latest swift sdk.
* IAF | Android constants fix (#229)
ProfileKey class now has a companion object inside, which broke our constants extractor. This fixes it so that we're filtering down by type <ProfileKey>
Co-authored-by: Evan Masseau <>
* Export FormConfiguration type (#232)
* SDK Version bumps: React to 2.0.0, Android to 4.0.0, Swift to 5.0.0 (#231)
* bump to major versions
* add in ios, fix some script errors since I didn't fully test this one (oops)
* Update to use final release numbers
* Rerun with published pods
* use bundler
---------
Co-authored-by: Evan Masseau <>
Co-authored-by: Isobelle Lim <[email protected]>
* Update README and add MIGRATION_GUIDE (#230)
* Update README and add MIGRATION_GUIDE
* generalize useEffect callout
* Bump to major version
* Undo version bumps
* Update to match iOS/Android READMEs
---------
Co-authored-by: Evan C Masseau <[email protected]>
Co-authored-by: Evan Masseau <>
This guide outlines how developers can migrate from older versions of our SDK to newer ones.
4
+
5
+
## Migrating to v2.0.0
6
+
7
+
### In-App Forms
8
+
9
+
As a result of changes summarized below, you may wish to revisit the logic of when you call `registerForInAppForms()` when upgrading from 1.2.0, particularly if you were registering than once per application session. Consult the [README](./README.md#in-app-forms) for the latest integration instructions.
10
+
11
+
#### Updated behaviors
12
+
13
+
- In version 1.2.0, calling `registerForInAppForms()` functioned like a "fetch" that would check if a form was available and if yes, display it. Version 2.0.0 changes this behavior so that `registerForInAppForms()` sets up a persistent listener that will be ready to display a form if and when one is targeted to the current profile.
14
+
- A deep link from an In-App Form will now be issued _after_ the form has closed, instead of during the close animation in order to prevent a race condition if the host application expects the form to be closed before handling the deep link.
15
+
16
+
#### Configurable In-App Form session timeout
17
+
18
+
Introduced a configurable session timeout for In-App Forms, which defaults to 60 minutes, as an optional argument to `registerForInAppForms()`.
19
+
20
+
#### New `unregisterFromInAppForms()` method
21
+
22
+
Because the `registerForInAppForms()` method now functions as a persistent listener rather than a "fetch", we've introduced an [`unregisterFromInAppForms()` method](./README.md#unregister-from-in-app-forms) so you can stop listening for In-App Forms at appropriate times, such as when a user logs out.
Copy file name to clipboardExpand all lines: README.md
+37-12Lines changed: 37 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,8 @@
37
37
-[In-App Forms](#in-app-forms)
38
38
-[Prerequisites](#prerequisites-1)
39
39
-[Setup](#setup-1)
40
-
-[Behavior](#behavior)
40
+
-[In-App Forms Session Configuration](#in-app-forms-session-configuration)
41
+
-[Unregistering from In-App Forms](#unregistering-from-in-app-forms)
41
42
-[Troubleshooting](#troubleshooting)
42
43
-[Contributing](#contributing)
43
44
-[License](#license)
@@ -498,16 +499,28 @@ Klaviyo messages can also include key-value pairs (custom data) for both standar
498
499
499
500
## In-App Forms
500
501
501
-
[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.
502
+
[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.
503
+
504
+
Beginning with version 2.0.0, In-App Forms supports advanced targeting and segmentation. In your Klaviyo account, you can configure forms to target or exclude specific lists or segments, and the form will only be shown to users matching those criteria, based on their profile identifiers set via the Klaviyo SDK API.
502
505
503
506
### Prerequisites
504
507
505
508
- Using Version 1.2.0 and higher
506
509
- Import the Klaviyo module
510
+
- We strongly recommend using the latest version of the SDK to ensure compatibility with the latest In-App Forms features. The minimum SDK version supporting In-App Forms is 1.2.0, and a feature matrix is provided below. Forms that leverage unsupported features will not appear in your app until you update to a version that supports those features.
511
+
- Please read the [migration guide](MIGRATION_GUIDE.md) if you are upgrading from 1.2.0 to understanding changes to In-App Forms behavior.
512
+
513
+
| Feature | Minimum SDK Version |
514
+
| ------------------ | ------------------- |
515
+
| Basic In-App Forms | 1.2.0+ |
516
+
| Time Delay | 2.0.0 |
517
+
| Audience Targeting | 2.0.0 |
507
518
508
519
### Setup
509
520
510
-
To display in-app forms, add the following code to your application
521
+
To configure your app to display In-App Forms, call `Klaviyo.registerForInAppForms()` after initializing the SDK with your public API key. Once registered, the SDK may launch an overlay view at any time to present a form according to its targeting and behavior settings configured in your Klaviyo account.
522
+
523
+
For the best user experience, we recommend registering after any splash screen or loading animations have completed. Depending on your app's architecture, this might be in a particular Screen's useEffect.
511
524
512
525
```
513
526
import { Klaviyo } from "klaviyo-react-native-sdk";
@@ -517,20 +530,32 @@ import { Klaviyo } from "klaviyo-react-native-sdk";
517
530
Klaviyo.registerForInAppForms();
518
531
```
519
532
520
-
### Behavior
533
+
#### In-App Forms Session Configuration
534
+
535
+
A "session" is considered to be a logical unit of user engagement with the app, defined as a series of foreground interactions that occur within a continuous or near-continuous time window. This is an important concept for In-App Forms, as we want to ensure that a user will not see a form multiple times within a single session.
536
+
537
+
A session will time out after a specified period of inactivity. When a user launches the app, if the time between the previous interaction with the app and the current one exceeds the specified timeout, we will consider this a new session.
538
+
539
+
This timeout has a default value of 3600 seconds (1 hour), but it can be customized. To do so, pass an `FormConfiguration` object to the `registerForInAppForms()` method. For example, to set a session timeout of 30 minutes:
540
+
541
+
```
542
+
import { Klaviyo } from "klaviyo-react-native-sdk";
543
+
544
+
let config: FormConfiguration = { sessionTimeoutDuration: 1800 }
545
+
Klaviyo.registerForInAppForms(config);
546
+
```
521
547
522
-
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.
548
+
### Unregistering from In-App Forms
523
549
524
-
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.
550
+
If at any point you need to prevent the SDK from displaying In-App Forms, e.g. when the user logs out, you may call:
525
551
526
-
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.
552
+
```
553
+
import { Klaviyo } from "klaviyo-react-native-sdk";
|`const handleAppStateChange = async (nextAppState: string) => { Klaviyo.registerForInAppForms(); }`| Anytime the app is foregrounded, check for forms and show if available. |
531
-
|`function App(): JSX.Element { useEffect(() => { Klaviyo.registerForInAppForms(); }};`| Show a form upon initial app launch. |
555
+
Klaviyo.unregisterFromInAppForms(config);
556
+
```
532
557
533
-
**Note**: At this time, when device orientation changes any currently visible form is closed and will not be re-displayed automatically.
558
+
Note that after unregistering, the next call to `registerForInAppForms()` will be considered a new session by the SDK.
0 commit comments