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

@dylmye/config-plugin-react-native-mparticle

v1.1.0

Published

Expo support plugin for react-native-mparticle

Downloads

141

Readme

mParticle Expo Config Plugin

Sets up mParticle native setup code so you can use react-native-mparticle in your Expo project. It's designed for you to adapt and add your specific functionality to.

Install

Install the package from mParticle and this config plugin:

yarn add react-native-mparticle @dylmye/config-plugin-react-native-mparticle

For iOS only: Run npx pod-install after installing this plugin.

Set up the plugin in your app.json:

{
  "expo": {
    "plugins": [
      [
        "@dylmye/config-plugin-react-native-mparticle",
        {
          "androidMparticleKey": "us1-YOUR_ANDROID_KEY_HERE",
          "androidMparticleSecret": "YOUR_ANDROID_SECRET_HERE",
          "iosMparticleKey": "us1-YOUR_IOS_KEY_HERE",
          "iosMparticleSecret": "YOUR_IOS_SECRET_HERE",
        }
      ]
    ]
  }
}

Here's all the possible values. They're all optional however you need both the key and secret for each platform to activate mParticle for that platform.

See how to get your Android and/or iOS keys in this help guide.

If you want to enforce a Data Plan, see how to grab its ID and version in this guide.

| Key | Value | | --------------------------------- | ------------------------ | | androidMparticleKey | Key for Android input | | androidMparticleSecret | Secret for Android input | | androidMparticleDataplanId | Data Plan 'Plan ID' | | androidMparticleDataplanVersion | Data Plan 'v' number | | iosMparticleKey | Key for iOS input | | iosMparticleSecret | Secret for iOS input | | iosMparticleDataplanId | Data Plan 'Plan ID' | | iosMparticleDataplanVersion | Data Plan 'v' number |

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Adding other native code - Kits, User Attributes, etc

The mParticle setup code is quite custom in nature. Identifying users/IDSync, event tracking and user attributes are bespoke to your system and not every use case can be captured in this plugin. This plugin is intended to act as a base, with the intention that you clone it and integrate it with your expo project. You can see in the app.json of the example project how it imports this plugin as a relative import instead of an npm module.

To modify this package:

  1. Clone it locally and put it in a folder within your Expo project, like plugins/mparticle. You can delete the .git & example folders
  2. Make your changes - the setup code is in ios/AppLifecycleDelegate.swift and android/src/main/java/expo/modules/mparticle/MparticlePluginApplicationLifecycleListener.kit (quite the mouthful!)
  3. If you need to add any additional variables, you can add them into the withApiKeys method in plugin/src/index.ts
  4. Run yarn plugin build
  5. Add your configuration to your Expo app app.json file as done in the example app

You don't need to rebuild the plugin every time you make changes to the Swift/Kotlin code, however you should do another prebuild.

The author of this plugin cannot provide any support for specific feature support. This library is also not officially supported by mParticle.

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.

Make sure to test your changes with the example app.

To create a release, bump the version number in package.json (in its own commit) then create a tag using git tag vx.x.x (where x.x.x is the semantic release version), then push it with git push && git push --tags.

Testing process

  1. Make changes to plugin
  2. Run yarn plugin build to build changes
  3. In example dir, run yarn expo prebuild --clean

Authors

Disclaimer

This plugin is not created by, nor associated with mParticle Inc, its subsidiaries or affiliates. mParticle is a registered trademark of mParticle, Inc.