Skip to content
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
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Add In-App Forms to README #199

wants to merge 4 commits into from

Conversation

belleklaviyo
Copy link
Contributor

@belleklaviyo belleklaviyo commented Mar 18, 2025

Description

https://klaviyo.atlassian.net/browse/CHNL-16763

Read the formatted README here

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[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.
[In-app forms](https://help.klaviyo.com/hc/en-us/articles/34567685177883) are popups 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.

@dan-peluso
Copy link
Contributor

I think we're going to need some sort of section on setup for Android - we need to let them know that they have to call

Applcation.onCreate() {
    Klaviyo.registerForLifecycleCallbacks(this)
}

in the native layer (unless they are initializing the Klaviyo SDK from the native layer in the Application onCreate) or else in app forms won't work. @evan-masseau any thoughts on that copy? Definitely want to make it obvious that this is required on Android.

// call this any time after initializing your public API key
Klaviyo.registerForInAppForms();
```

Copy link
Contributor

@evan-masseau evan-masseau Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this for android:

Suggested change
#### Android
In your Application class you **must** call `Klaviyo.registerForLifecycleCallbacks(applicationContext)`, due to timing issues, this cannot be achieved from the RN layer at this time.
```kotlin
// Application subclass
import android.app.Application
import com.klaviyo.analytics.Klaviyo
class YourApplication : Application() {
override fun onCreate() {
super.onCreate()
/* ... */
// Initialize is required before invoking any other Klaviyo SDK functionality
Klaviyo.initialize("KLAVIYO_PUBLIC_API_KEY", applicationContext)
// If unable to call initialize, you must at least register lifecycle listeners:
Klaviyo.registerForLifecycleCallbacks(applicationContext)
}

this suggestion block won't quite work because of nested back ticks :( ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants