메인 콘텐츠로 건너뛰기
@capgo/capacitor-native-loader UI & 시스템 오픈 소스

네이티브 로더 Capacitor 플러그인

Show native animated loaders, transparent overlays, Lottie assets, and WebView-resizing loading states from JavaScript or native code

설치

bun add @capgo/capacitor-native-loader bunx cap sync
npm, pnpm 또는 yarn
  • npm install @capgo/capacitor-native-loader
  • pnpm add @capgo/capacitor-native-loader
  • yarn add @capgo/capacitor-native-loader

설명서

Capacitor에서 Native Loader를 사용하는 방법

장치에서 테스트

Capgo 앱을 다운로드한 후 QR code를 스캔하세요.

자연 로더 플러그인 미리보기 QR code

@ capgo capacitor-자연 로더'를 사용합니다.

@capgo/capacitor-native-loader 자연 iOS 및 Android 뷰를 통해 로딩 상태를 렌더링합니다. WebView가 바쁠 때 로더가 smooth하게 유지되도록 하거나, transparent fullscreen 효과가 CSS에서 비싼 경우, 또는 JavaScript가 준비되기 전에 다른 자연 플러그인이 로딩 UI를 표시해야 할 때 사용하세요.

설치

npm install @capgo/capacitor-native-loader
npx cap sync

전체 화면 자연 로더

import { NativeLoader } from '@capgo/capacitor-native-loader';

const { id } = await NativeLoader.show({
  style: 'siri',
  placement: 'fullscreen',
  message: 'Preparing your session',
  colors: ['#71f6ff', '#8b5cf6', '#ff4ecd', '#fff7ad'],
  scrimColor: 'rgba(3, 7, 18, 0.42)',
  interactionMode: 'block',
});

await initializeAppData();
await NativeLoader.hide({ id });

EDGE 로더 WebView 리사이즈

await NativeLoader.setWebViewLayout({
  mode: 'inset',
  insets: { top: 96 },
  animated: true,
});

await NativeLoader.show({
  style: 'wave',
  placement: 'top',
  message: 'Syncing changes',
  interactionMode: 'passThrough',
});

로딩이 끝나면 WebView를 복원하세요:

await NativeLoader.hideAll({ restoreWebView: true });

Chrome-Style 상단 진행

자연 상단 진행 로더를 사용하여 WebView 위에 브라우저와 같은 로딩 바를 표시하고 싶을 때 CSS가 중량 작업 중인 동안 애니메이션을 요청하지 않으려면 사용하세요.

const { id } = await NativeLoader.show({
  style: 'chrome',
  placement: 'top',
  colors: ['#4285f4', '#34a853', '#fbbc05', '#ea4335'],
  thickness: 4,
  interactionMode: 'passThrough',
  webView: {
    mode: 'resize',
    insets: { top: 12 },
    restoreOnHide: true,
  },
});

await NativeLoader.hide({ id, restoreWebView: true });

시리 V2 EDGE 로더

Use siri-v2 웹뷰가 보이는 동안 화면의 테두리에서 색상을 움직이는 네이티브 풀 스크린 로더를 사용하세요.

const { id } = await NativeLoader.show({
  style: 'siri-v2',
  placement: 'fullscreen',
  colors: ['#71f6ff', '#8b5cf6', '#ff4ecd', '#fff7ad'],
  thickness: 10,
  scrimColor: 'rgba(3, 7, 18, 0.10)',
  interactionMode: 'passThrough',
});

await NativeLoader.hide({ id });

Lottie 로더

await NativeLoader.show({
  style: 'lottie',
  placement: 'center',
  asset: {
    type: 'lottie',
    source: 'loader.json',
    loop: true,
  },
});

번들된 자산은 네트워크 요청과 자바스크립트 초기화 이전에 사용할 수 있기 때문에 시작 로더에 가장 적합합니다.

네이티브 플러그인 호출

이 플러그인은 공개 네이티브 API를 노출하여 다른 플러그인이 로더를 직접 표시하거나 숨길 수 있도록 합니다.

Swift:

import CapgoCapacitorNativeLoader

let id = NativeLoader.shared.show(options: [
  "style": "orbit",
  "placement": "fullscreen",
  "message": "Opening secure session"
])

NativeLoader.shared.hide(id: id)

Kotlin:

import app.capgo.nativeloader.NativeLoader

val id = NativeLoader.show(
  activity = activity,
  options = mapOf(
    "style" to "orbit",
    "placement" to "fullscreen",
    "message" to "Loading profile",
  ),
  webView = bridge.webView,
)

NativeLoader.hide(id)

capgo/capacitor-native-loader를 계속 사용하세요.

만약 __CAPGO_KEEP_0__/__CAPGO_KEEP_1__-native-loader를 사용 중이라면 capgo/capacitor-native-loader를 사용하여 자연적인 미디어 및 인터페이스 동작을 계획하고 싶다면 __CAPGO_KEEP_0__/__CAPGO_KEEP_1__-native-loader와 연결하세요. capgo/capacitor-native-loader 구현에 대한 자세한 내용은 Getting Started 설정에 대한 자세한 내용은 설치에 사용합니다. @capgo/capacitor-native-네비게이션 __CAPGO_KEEP_0__/__CAPGO_KEEP_1__-transitions를 사용하여 @capgo/capacitor-전환 사용 __CAPGO_KEEP_0__/__CAPGO_KEEP_1__-native-loader를 계속 사용하세요.

FAQ

Native Loader 플러그인 FAQ

Native Loader 플러그인을 Capacitor 앱에 설치하는 방법은?

Run "bun add @capgo/capacitor-native-loader" (or "npm install @capgo/capacitor-native-loader"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-native-loader" in your app code.

리액트, 뷰, 앵귤러와 함께 @capgo/capacitor-native-loader가 작동합니까?

React, Vue 및 Angular과 함께 @Capacitor/Capacitor-native-loader가 작동하나요?

Which Capacitor version does @capgo/capacitor-native-loader support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

@capgo/capacitor-native-loader는 무료이며 오픈 소스인가요?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-native-loader/ and the package is free to install from npm. Bug reports and pull requests are welcome.

애플리케이션 스토어 리뷰 없이 Native Loader를 사용하는 code를 업데이트 할 수 있나요?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

앱 리뷰 대기 없이 네이티브 로더 변경을 배포합니다.

플러그인은 스토어 빌드에 포함된 후, Capgo 라이브 업데이트가 사용자에게 몇 분 만에 자바스크립트, HTML 및 CSS 변경 사항을 푸시합니다.

Capgo