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

@pushprotocol/reactnative

v0.2.0

Published

Package for React Native Views for React Native based mobile apps.

Downloads

10

Readme

reactnative

Package for React Native Views for React Native based mobile apps.

How to use in your Mobile app?

Installation

  yarn add @pushprotocol/reactnative

or

  npm install @pushprotocol/reactnative  

Please read this carefullly

We need to install peer dependencies for @pushprotocol/reactnative in your mobile app. And have it set up as below to make it run.

yarn add @react-native-masked-view/masked-view react-native-svg react-native-video react-native-youtube

Then for different types of react native apps use the below instructions.

FOR EXPO APPS

expo install expo-file-system
expo install expo-linear-gradient

Running IOS

cd ios && pod install
yarn ios

ViewPropTypes Error -

If only you get below error

Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'

ViewPropTypes Error Fix

  1. In node_modules/react-native/index.js Replace the below code
// Deprecated Prop Types
get ColorPropType(): $FlowFixMe {
  invariant(
    false,
    "ColorPropType has been removed from React Native. Migrate to " +
      "ColorPropType exported from 'deprecated-react-native-prop-types'.",
 );
},
get EdgeInsetsPropType(): $FlowFixMe {
  invariant(
    false,
    "EdgeInsetsPropType has been removed from React Native. Migrate to " +
      "EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
  );
},
get PointPropType(): $FlowFixMe {
  invariant(
    false,
    "PointPropType has been removed from React Native. Migrate to " +
     "PointPropType exported from 'deprecated-react-native-prop-types'.",
 );
},
get ViewPropTypes(): $FlowFixMe {
 invariant(
   false,
   "ViewPropTypes has been removed from React Native. Migrate to " +
     "ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
 );
},

with below snippet

// Deprecated Prop Types
get ColorPropType(): $FlowFixMe {
  return require("deprecated-react-native-prop-types").ColorPropType
},
get EdgeInsetsPropType(): $FlowFixMe {
  return require("deprecated-react-native-prop-types").EdgeInsetsPropType
},
get PointPropType(): $FlowFixMe {
  return require("deprecated-react-native-prop-types").PointPropType
},
get ViewPropTypes(): $FlowFixMe {
  return require("deprecated-react-native-prop-types").ViewPropTypes
},
  1. yarn add -D patch-package
  2. yarn patch-package react-native
  3. cd ios && pod install
  4. yarn ios

Image.propTypes.resizeMode error

ERROR TypeError: undefined is not an object (evaluating '_reactNative.Image.propTypes.resizeMode')

then use this

Image.propTypes fix

After that,

yarn patch-package react-native-video
cd ios && pod install
yarn ios

Running Android

If you get this Error

Could not find com.yqritc:android-scalablevideoview:1.0.4.
		 Required by:
		         project :react-native-video

add this in android/build.gradle

jcenter() {
  content {
		includeModule("com.yqritc", "android-scalablevideoview")
	}
}

Run yarn android

FOR REACT NATIVE CLI GENERATED APPS

npx install-expo-modules
expo install expo-file-system
expo install expo-linear-gradient
cd iOS && pod install
yarn iOS

Similarly, if you get this ViewPropTypes error then use this fix

and ImagePropTypes error then use this fix

Notification Item View

Import in your file

import { Notification } from "@pushprotocol/reactnative";

Inside JSX,

After you get the Notification data from the API

const [notifData, setNotifData] = React.useState([]);

// fetch data, parse and set it in state
import * as PushAPI from '@pushprotocol/restapi';


const notifications = await PushAPI.user.getFeeds({
  user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681',
  env: 'dev',
  limit: parseInt(pageSize, 10)
});
setNotifData(notifications);
   <View style={styles.list}>
        {notifData.map((oneNotification: any, idx: number) => {
        const {cta, title, message, app, icon, image, blockchain, appbot } = oneNotification;
            return (
            <Notification
                key={idx}
                notificationTitle={title}
                notificationBody={message}
                cta={cta}
                app={app}
                icon={icon}
                image={image}
                chainName={blockchain}
                appbot={appbot}
                youTubeAPIKey={config.YOUTUBE_API_KEY} // pass your YOUTUBE_API_KEY here
            />
            );
        })}
    </View>

where

| Prop | Type | Remarks | |----------|--------|--------------------------------------------| | notificationTitle | string | Title of the notification (given during notification creation) | | notificationBody | number | Message body of the notification (given during notification creation) | | icon | string | Channel Icon (IPFS url) (given during channel setup) | | app | string | Channel Name (given during channel setup) | | cta | string | Call To Action Link (given during notification creation) | | image | string | Any media link (given during notification creation) | | appbot | string | is the notification is from EPNS bot the value is "1" else "0" | | chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "THE_GRAPH" | | youTubeAPIKey | string | Your generated Youtube API key |