/**
 Events*/

Go back to React Native Getting Started Guide

Pyze React Native App SDK - Events

See a detailed Events Overview at api & events.

Curated Event Handling

You can call events in index.android.js or index.ios.js depending on the platform you choose.

Add the following import statements

import {
  PyzeEvents
} from 'pyze-sdk-react-native';

Add the events of your choice in your code.

PyzeEvents.postCustomEvent("Custom Event"); 

Pyze has made it easy for you to capture events. We support many built-in events (see api).

For example, to send an Ad requested event, import the curated event class and use it as shown in example below:

import {PyzeAd} from 'pyze-sdk-react-native'; //Import PyzeAd class from the PyzeReact Native package
    ...
    ...
var customAttributes = {};
customAttributes["First Name"] = "John";
customAttributes["Last Name"] = "Smith";
customAttributes["Age"] = 25;
PyzeAd.PostAdRequested(
    "AdMob",            // AdNetwork
    "Settings",            // App Screen
    "300x50",            // Ad SIze
    "Banner",            // Type 
    customAttributes
);

Custom Event Handling

We also support custom events in addition to built in events. See custom events class api for React Native.

For example, to send a custom "Game End event" use:

import {PyzeEvents} from 'pyze-sdk-react-native'; //Import PyzeEvents class from the PyzeReact Native package

    ...
    ...
var customAttributes = {};
customAttributes["Seconds Played"] = 33.33;
customAttributes["Bulletes Fired"] = 300;
customAttributes["Enemy Killed"] = 25;
PyzeEvents.postCustomEventWithAttributes("Game End", customAttributes);

Go back to React Native Developer Center to follow the next steps.


About Pyze

Pyze Growth Intelligence® is a transformative SaaS platform that enables mobile and web app businesses to automate engagement, retention and growth of their users. Signup at Pyze, install and initialize the Pyze SDK and watch your app grow.