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 🙏

© 2025 – Pkg Stats / Ryan Hefner

plotprojects-react-native-module

v1.0.16

Published

This module helps you to integrate PlotProjects plugin in react native mobile apps

Downloads

9

Readme

Quickstart

You can find PlotProjects official documentation here

You can also find an example ReactNative application with PlotProjects reactNative module integrated here

Step-1 Install PlotProjects ReactNative module

npm install plotprojects-react-native-module --save

Step-2 Add plotconfig.json file to both Android and iOS projects

Here you can find instruction for iOS and Android.

Step-3 Initialize PlotProjects SDK

In order to initialize PlotProjects plugin, you need add the following code to your App.js:

import { PermissionsAndroid } from 'react-native';

import Plot from 'plotprojects-react-native-module';

const requestLocationPermission = async () => {
    try {
      if(Platform.OS === "ios") {
        initializePlot();
      } else {
        const granted = await PermissionsAndroid.requestMultiple(
          ["android.permission.POST_NOTIFICATIONS",
          	PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
	          PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, 
              ]);
        if (granted['android.permission.ACCESS_COARSE_LOCATION'] === PermissionsAndroid.RESULTS.GRANTED
              || granted['android.permission.ACCESS_FINE_LOCATION'] === PermissionsAndroid.RESULTS.GRANTED
        ) {
			console.debug("Foreground location permission granted!");
			const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_BACKGROUND_LOCATION);
			if (granted['android.permission.ACCESS_BACKGROUND_LOCATION'] === PermissionsAndroid.RESULTS.GRANTED) {
				console.debug("Background location permission granted!");
			} else {
				console.debug("Background location permission denied!");
			}
          initializePlot();
        } else {
          console.debug("Location permission denied!. Not initializing PlotProjects SDK.");
        }
      }
    } catch (err) {
      console.warn(err);
    }
  };

requestLocationPermission();

The previous code requests location permission before enabling PlotProjects plugin. The actual code for initializing PlotProjects plugin is the Plot.initialize();. The rest if for requesting location permissions.

Advanced integration

This module supports the following methods:

  • Plot.initialize(); Used to initialize PlotProjects plugin.
  • Plot.setAdvertisingId('my_IDFA', limitTracking); Used to set the advertising identifier. First parameter is a string represents the value of the Advertising Identifier you want to set and the second is a boolean specifies if tracking is limited or not.
  • Plot.enable() Enables PlotProjects plugin after disabling it. When you initialize the plugin using Plot.initialize() it is enabled by default.
  • Plot.disable() Disables PlotProjects plugin.
  • Plot.isEnabled(callback); Checks if PlotProjects plugin is enabled. Callback will receive one boolean argument represents the result of this check.
  • plot.deviceId(callback); Retrieve a unique identifier assigned to this install by PlotProjects.
  • Plot.sendAttributionEvent("read_flyer", "discounts_week_12"); Sets an attribution event with key and value. It can be useful to tie some actions users take to events.
  • Plot.setStringSegmentationProperty("gender", "man"); Sets a string segmentation property.
  • Plot.setBooleanSegmentationProperty("is_true", true); Sets a boolean segmentation property.
  • Plot.setIntegerSegmentationProperty("count", 10); Sets an integer segmentation property.
  • Plot.setLongSegmentationProperty("count", 9999999999); Sets a long segmentation property.
  • Plot.setDoubleSegmentationProperty("avg", 5.5); Sets a double segmentation property.
  • Plot.setDateSegmentationProperty("today", date.getTime()); Sets a date/time segmentation property.
  • Plot.registerNotificationFilter(callback); Registers a notification filter so that you can filter notifications before they are sent to the user. An example of a call to that method is:
	Plot.registerNotificationFilter((batchId, notifications) => {
        notifications[0]['message'] = 'New message';
        Plot.filterNotifications(batchId, JSON.stringify(notifications));
    });

You need to call Plot.filterNotifications(batchId, JSON.stringify(notifications)); when you finish filtering with the filtered result. The batchId is important to identify which batch this result belongs to.

  • Plot.registerGeotriggerHandler(callback) register a geotrigger handler. An example of a call to this method is:
	Plot.registerGeotriggerHandler((batchId, geotriggers) => {
		Plot.handleGeotriggers(batchId, JSON.stringify(geotriggers));
	});

You need to call Plot.handleGeotriggers(batchId, JSON.stringify(geotriggers)); after you finish handling the geotriggers with the handled result. The batchId is important to identify which batch this result belongs to.

  • Plot.registerNotificationOpenHandler(callback); register a callback when user opens (tabs) a notification. Callback will have one parameter represents the opened notification.
  • Plot.getLoadedNotifications(callback); retrieve the nearest 200 loaded notifications. Callback will have one parameter contains an array of the loaded notifications.
  • Plot.getLoadedGeotriggers(callback); retrieve the nearest 200 loaded geotriggers. Callback will have one parameter contains an array of the loaded geotriggers.
  • Plot.deviceId(callback); retrieve PlotProjects specific device ID.