uniapp-native-plugin

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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
当用户有以下需求时,可使用本技能:
  • 开发Android原生插件
  • 开发iOS原生插件
  • 为uni-app集成原生功能
  • 创建自定义原生模块
  • 借助原生能力扩展uni-app
  • 处理原生插件通信
  • 打包并分发原生插件

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
开发原生插件的步骤:
  1. 根据用户需求确定平台
    • Android → 使用Android插件示例
    • iOS → 使用iOS插件示例
  2. examples/
    目录加载对应的示例文件
    • examples/guide/
      - 原生插件开发指南
    • examples/android-plugin/
      - Android插件示例
    • examples/ios-plugin/
      - iOS插件示例
  3. templates/
    目录加载对应的模板
    • templates/plugin-template.md
      - 插件开发模板
  4. 按照这些文件中的具体说明进行开发

Examples and Templates

示例与模板

Examples

示例

Located in
examples/
:
  • guide/ - Native plugin development guide
  • android-plugin/ - Android plugin development examples
  • ios-plugin/ - iOS plugin development examples
位于
examples/
目录下:
  • guide/ - 原生插件开发指南
  • android-plugin/ - Android插件开发示例
  • ios-plugin/ - iOS插件开发示例

Templates

模板

Located in
templates/
:
  • plugin-template.md - Plugin development templates
位于
templates/
目录下:
  • plugin-template.md - 插件开发模板

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
  1. 遵循平台规范:严格遵守Android和iOS的开发标准
  2. 错误处理:实现完善的错误处理与日志记录
  3. 文档编写:提供清晰的插件使用文档
  4. 测试环节:在真实设备上对插件进行全面测试

Resources

资源

Keywords

关键词

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