Skip to content

Repository files navigation

React Native React Native LinkPresentation

React Native binding to Apple's LinkPresentation framework

Native LPLinkView rendering fetched Apple link metadata

iOS performs every fetch, redirect, metadata extraction, and item-provider load. The package performs no JavaScript networking or metadata parsing.

Requires iOS 15.1+ and React Native 0.76+. Both the legacy and new React Native architectures are supported.

Demo

Apple link metadata preview TikTok link metadata preview YouTube link metadata preview TikTok native long-press preview
Apple TikTok YouTube TikTok long press

Installation

npm install @andreywtf/react-native-link-presentation
cd ios && pod install

The package is iOS-only. It can be imported on other platforms, but functions reject with E_UNSUPPORTED_PLATFORM and LPLinkView renders nothing.

Quick start

import {
  getLinkMetadata,
  LPLinkView,
} from '@andreywtf/react-native-link-presentation';

const metadata = await getLinkMetadata('https://www.apple.com/iphone/');

<LPLinkView metadata={metadata} style={{ height: 180 }} />;

Documentation

Development

The LinkPresentation implementation and native view are written in Swift. Small Objective-C++ adapters remain where React Native's generated TurboModule and Fabric interfaces require C++/Objective-C++ entry points.

npm install
npm run lint
npm run typecheck
npm test
npm run build

cd example
npm install
cd ios && pod install
open LinkPresentationExample.xcworkspace

The example demonstrates native fetching, cancellation, custom metadata, placeholders, rich views, and lazy item-provider materialization.

About

React Native binding to Apple's LinkPresentation framework

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages