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

whalecloud-dxp-nudges-react-native

v1.2.0

Published

whalecloud-nudges

Downloads

650

Readme

whalecloud-dxp-nudges-react-native

whalecloud-Nudges

Installation

npm install whalecloud-dxp-nudges-react-native

目前还没发布npm所以 yarn add file:../whalecloud-dxp-ads-react-native

Usage

1 Android项目里面需要再 app 文件夹下面的build.gradle 加入implementation project(':whalecloud-dxp-nudges-react-native')

2 先在Android 工程的 Application 里调用 init如下 并且配置url以及config如下
//Nudges
 WhalecloudDxpAdsReactNativeModule.initAds(this,"http://172.16.22.5:9110");
//        DXP  NUDGES 后端服务地址

String DXP_NUDGES_BASE_URL = "http://172.16.22.5:9110/portal-web/dmc/mccm-outer/";
DxpNudgesUtil.setNudgesBaseUrl(DXP_NUDGES_BASE_URL);

//DXP  NUDGES CEG 后web Socket地址
String DXP_NUDGES_CEG_BASE_URL = "http://10.10.177.38/ceg/ceg/";
String DXP_NUDGES_CEG_WS_URL = "ws://10.10.177.38/ceg/ceg/nudges/socket";

DxpNudgesUtil.setCegNudgesBaseUrl(DXP_NUDGES_CEG_BASE_URL);
DxpNudgesUtil.setCegNudgesWsBaseUrl(DXP_NUDGES_CEG_WS_URL);
//Nudges
WhalecloudDxpNudgesReactNativeModule.init(this);//        默认设置
WhalecloudDxpNudgesReactNativeModule.initNudgesConfig("ditoapp","MzUzOWQ2YzY4NjJmYWMzOWQ5ZGIxMjFm");

3 在MainActivity 上 实现 IRouteName
重写
 @Override
  public String getRouterName() {
    return WhalecloudDxpNudgesReactNativeModule.currentPage;
  }
import { DXPNudges } from './whalecloud-dxp-nudges-react-native';

DXPNudges.setOnNudgesShowListener();
DXPNudges.setOnNudgesButtonClickListener();

调用好后在NavigationContainer 里面加入 onStateChange 监听页面变化调用DXPNudges.startNudges(url)
例子:
    <NavigationContainer
        onStateChange={state => {
        const currentRoute = state.routes[state.index];
        console.log('Current route:', currentRoute.name);
        DXPNudges.startNudges(currentRoute.name)
        }}>