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

feat: Web Vitals support for FCP, FID, TTFB #28

Merged
merged 4 commits into from Jan 10, 2023
Merged

feat: Web Vitals support for FCP, FID, TTFB #28

merged 4 commits into from Jan 10, 2023

Conversation

carlpoole
Copy link
Member

Adds Web Vitals support for FCP, FID, and TTFB to Android Portals

Kotlin Usage

portalFragment = PortalFragment(checkoutPortal, (metric, time) -> {
    Log.d("VITALS", "$metric: ${time}ms"
});

Java Usage

portalFragment = new PortalFragment(checkoutPortal, (metric, time) -> {
    Log.d("VITALS", metric.name() + ": " + time+ "ms");
    return null;
});

Jetpack Compose example usage

@Composable
fun loadPortal(portalId: String) {
    AndroidView(factory = {
        PortalView(it, portalId) { metric, time -> Log.d("VITALS", "$metric: ${time}ms") }
    })
}

@carlpoole carlpoole merged commit b805b2f into main Jan 10, 2023
@carlpoole carlpoole deleted the webvitals branch January 10, 2023 22:13
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.

None yet

2 participants