home / skills / partme-ai / full-stack-skills / uniapp-native-plugin

uniapp-native-plugin skill

/skills/uniapp-native-plugin

This skill helps you develop native Android and iOS plugins for uni-app, guiding integration, packaging, and distribution with official docs.

npx playbooks add skill partme-ai/full-stack-skills --skill uniapp-native-plugin

Review the files below or copy the command above to add this skill to your agents.

Files (10)
SKILL.md
2.0 KB
---
name: uniapp-native-plugin
description: A comprehensive skill for developing native plugins for uni-app. Use this skill when building Android/iOS native plugins, integrating native capabilities, or publishing plugins based on official native plugin docs.
license: Complete terms in LICENSE.txt
---

## When to use this skill

Use this skill whenever the user wants to:
- Develop native Android plugins
- Develop native iOS plugins
- Integrate native functionality into uni-app
- Create custom native modules
- Extend uni-app with native capabilities
- Handle native plugin communication
- Package and distribute native plugins

## How to use this skill

To develop native plugins:

1. **Identify the platform** from the user's request:
   - Android → Use Android plugin examples
   - iOS → Use iOS plugin examples

2. **Load the appropriate example file** from the `examples/` directory:
   - `examples/guide/` - Native plugin development guide
   - `examples/android-plugin/` - Android plugin examples
   - `examples/ios-plugin/` - iOS plugin examples

3. **Load the appropriate template** from the `templates/` directory:
   - `templates/plugin-template.md` - Plugin development templates

4. **Follow the specific instructions** in those files for development

## Examples and Templates

### Examples

Located in `examples/`:

- **guide/** - Native plugin development guide
- **android-plugin/** - Android plugin development examples
- **ios-plugin/** - iOS plugin development examples

### Templates

Located in `templates/`:

- **plugin-template.md** - Plugin development templates

## Best Practices

1. **Follow platform guidelines**: Adhere to Android and iOS development standards
2. **Error handling**: Implement proper error handling and logging
3. **Documentation**: Provide clear documentation for plugin usage
4. **Testing**: Test plugins thoroughly on real devices

## Resources

- **Official Documentation**: https://nativesupport.dcloud.net.cn/NativePlugin/

## Keywords

native plugin, 原生插件, Android插件, iOS插件, plugin development, native module

Overview

This skill helps developers create, integrate, and publish native plugins for uni-app on Android and iOS. It bundles platform-specific examples, templates, and a guided workflow so you can implement native capabilities, handle cross-layer communication, and prepare plugins for distribution. Use it to accelerate reliable native module development aligned with official native plugin guidance.

How this skill works

The skill detects the target platform (Android or iOS) and surfaces the matching examples and templates from the examples/ and templates/ directories. It provides a step-by-step development flow: choose platform, load example code, apply the plugin template, implement native APIs, and wire JS-to-native communication. The skill also highlights testing, error handling, and packaging steps needed to publish a plugin.

When to use it

  • Building a new Android or iOS native plugin for uni-app
  • Exposing device APIs or native libraries to uni-app applications
  • Creating custom native modules to extend uni-app features
  • Implementing reliable JS-to-native communication and callbacks
  • Packaging and preparing plugins for distribution or marketplace

Best practices

  • Follow Android and iOS platform guidelines and coding conventions
  • Design clear, minimal JS APIs that map cleanly to native calls
  • Implement robust error handling, logging, and fail-safes
  • Test thoroughly on real devices and with common OS versions
  • Document setup, usage examples, and permission requirements

Example use cases

  • Add a native camera filter engine on Android using the android-plugin examples
  • Expose iOS-specific biometrics or secure storage through an iOS plugin example
  • Wrap a platform-only SDK so web UI can call native features via JS bridge
  • Create a cross-platform plugin template and reuse it for multiple projects
  • Prepare a plugin package with manifest and publishing metadata

FAQ

Which platform should I start with?

Start with the platform your target users primarily use; use the provided examples to get a working prototype quickly and then port patterns to the other platform.

How do I test native plugin behavior?

Test on real devices and across OS versions. Use the examples for setup, add detailed logging on both JS and native sides, and validate permission and lifecycle handling.