npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-mopsdk

v2.0.7

Published

小程序React Native SDK

Downloads

14

Readme

官方网站 | 示例小程序 | 开发文档 | 部署指南 | SDK 集成指南 | API 列表 | 组件列表 | 隐私承诺


🤔 FinClip 是什么?

有没有想过,开发好的微信小程序能放在自己的 APP 里直接运行,只需要开发一次小程序,就能在不同的应用中打开它,是不是很不可思议?

有没有试过,在自己的 APP 中引入一个 SDK ,应用中不仅可以打开小程序,还能自定义小程序接口,修改小程序样式,是不是觉得更不可思议?

这就是 FinClip ,就是有这么多不可思议!

⚙️ 配置环境

$ npm install react-native-mopsdk --save

🖥 自动安装

$ react-native link react-native-mopsdk

🔨 使用方法

import MopSDK from 'react-native-mopsdk';
import { NativeModules, NativeEventEmitter } from 'react-native';

// 初始化
const eventEmitter = new NativeEventEmitter(NativeModules.FINMopSDK);
  MopSDK.initialize({
    appkey:
      'Ev7QHvml1UcW98Y1GaLfRz34ReffbDESaTXbCoFyKhEm0a3gam0elOOOdZ6Twpa3HkBzlvOwJ2cyhOrMVWuuGw==',
    secret: '16f2d2700453ae51',
    apiServer: 'https://api.finclip.com',
    apiPrefix: '/api/v1/mop/',
    nativeEventEmitter: eventEmitter,
    finMopSDK: NativeModules.FINMopSDK,
  }).then(res => {
    console.log('初始化成功')
  }).catch(err => {
    console.log('初始化失败')
  })

🔨 使用方法

import MopSDK from 'react-native-mopsdk';
import { NativeModules, NativeEventEmitter } from 'react-native';

/**
 * @description Initialize the SDK with specific configurations
 * @param {Object} params - Configuration parameters
 */
MopSDK.initSDK = function(params) {
  return new Promise((resolve, reject) => {
    // 这里假设 params 中已经包含了 config 和 uiConfig
    let { config, uiConfig } = params;

    // 确保 config 和 uiConfig 是有效的对象
    if (!config || typeof config !== 'object' || !uiConfig || typeof uiConfig !== 'object') {
      reject(new Error('Invalid config or uiConfig'));
      return;
    }

    // 调用原生模块的 initSDK 方法
    NativeModules.FINMopSDK.initSDK({ config, uiConfig }).then(res => {
      console.log('SDK 初始化成功');
      resolve(res);
    }).catch(err => {
      console.error('SDK 初始化失败', err);
      reject(err);
    });
  });
};

// 使用示例
const eventEmitter = new NativeEventEmitter(NativeModules.FINMopSDK);
MopSDK.initSDK({
  config: {
    appkey: '您的appkey',
    secret: '您的secret',
    apiServer: 'https://api.finclip.com',
    apiPrefix: '/api/v1/mop/',
    // 其他相关的配置项
  },
  uiConfig: {
    // UI 相关配置
  }
}).then(res => {
  console.log('初始化成功');
}).catch(err => {
  console.log('初始化失败', err);
});

📱 DEMO

点击这里 查看 React Native Demo

📋 接口文档

点击这里 查看 React Native 快速集成文档

🔗 常用链接

以下内容是您在 FinClip 进行开发与体验时,常见的问题与指引信息

☎️ 联系我们

微信扫描下面二维码,关注官方公众号 「凡泰极客」,获取更多精彩内容。

微信扫描下面二维码,加入官方微信交流群,获取更多精彩内容。