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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-followanalytics

v4.0.0

Published

FollowAnalytics React Native SDK

Readme

FollowAnalytics React Native SDK

Getting started

Requirements

  • React Native >= 0.58.0
  • Reac Native cli >= 2.0.1
  • Cocoapods (iOS)
  • Gradle (Android)

Mostly automatic installation

$ npm install react-native-followanalytics --save

$ react-native link react-native-followanalytics

Manual installation

$ npm install PATH_FOR_THE_SDK --save $ react-native link react-native-followanalytics

iOS

If you're using Cocoapods add the following to your application target on the Podfile:

use_frameworks!
pod 'FollowAnalytics', path: '../node_modules/react-native-followanalytics/ios/Frameworks'

Run pod install to add the required dependencies.

If you use it manually follow the following steps:

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-followanalytics and add RNFollowanalytics.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNFollowanalytics.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)

You'll still need to integrate the FollowAnalytics iOS SDK. Please follow the Install using Cocoapods and Initialize with your API key from the FollowAnaltyics Dev Portal.

In your AppDelegate.h add the following lines:

#import <FollowAnalytics/FollowAnalytics.h>

In your AppDelegate.m add the following lines inside the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method

    FollowAnalyticsConfiguration* configuration = [FollowAnalyticsConfiguration
        configurationWith:^(FollowAnalyticsMutableConfiguration * _Nonnull c) {
            c.apiKey = @"YOUR_API_KEY_HERE";
            c.appGroup = @"YOUR_APP_GROUP_HERE";
            c.debug = true;
            c.isDataWalletEnabled = YES;
            c.onDataWalletPolicyChange = ^{
                [self policyDidChange];
            };
        }];
    [FollowAnalytics startWithConfiguration:configuration
        startupOptions:launchOptions];
    [FAFollowApps storeMessagesPush:YES inApp:YES];
    [FABadge enable];
    [FAFollowApps enableGeoffencing];

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.followanalytics.reactnative.sdk.RNFollowAnalyticsPackage; to the imports at the top of the file
  • Add new RNFollowAnalyticsPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-followanalytics'
    project(':react-native-followanalytics').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-followanalytics/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-followanalytics')
  • Add new RNFollowanalyticsReactNativeSdkPackage() to the List<IReactPackage> returned by the Packages method

You'll also need to integrate the FollowAnalytics Android SDK to the native part of the application. Please follow the Install using Gradle and Initialize with your API key from the FollowAnaltyics Dev Portal.

Available methods

The FollowAnalytics React Native SDK makes use of callbacks to get results from method calls, where it applies. Here+s a list of the available methods:

// all methods using callbacks follow the pattern:

functionName: function((error, result) => {
	if (error) {
		... treat error case here ...
	} else {
		... treat success case here ...
	}
});

getOptInAnalytics((error, result) => { ... }});
setOptInAnalytics(isOptIn);

requestNotificationAuthorization(); // iOS only
requestProvisionalNotificationAuthorization(); // iOS only

getUserId(error, result) => { ... }});
setUserId(user_id);

getDeviceId(error, result) => { ... }});

logEvent("anEventName", "anEventDetail");
logError("anErrorName", "anErrorDetail");
logLocationCoordinates(48.8410646, 2.3210844);
logLocationPosition(position); // Takes a Position object provided by the Geolocation API

Gender: {
	MALE: 1,
    FEMALE: 2,
    OTHER: 3
}

UserAttributes: {
	setFirstName("aFirstName");
	setLastName("aLastName");
	setEmail("[email protected]");
	setDateOfBirth("2020-02-28");  // Takes a string (yyyy-MM-dd)
	setGender(FollowAnalytics.Gender.MALE); // Also can use FEMALE || OTHER
	setCountry("France");
	setCity("Paris");
	setRegion("Île-de-France");
	setProfilePictureUrl("https://picture_url");
	setInteger("aKey", 100);
	setDouble("aKey", 10.5);
	setString("aKey", "aString");
	setBoolean("aKey", true); // Or false
	setDate("aKey", "2020-02-28");  // Takes a string (yyyy-MM-dd)
	setDateTime("aKey", "2020-02-28 18:46:19 +0200");  // Takes a string (yyyy-MM-dd HH:mm:ss Z)
	clear("aKey");
	addToSet("aKey", ...elements);
	removeFromSet("aKey", ...elements);
	clearSet("aKey");
}

Push: {
    getAll(error, result) => { ... }});
    get(id, (error, result) => { ... });
    markAsRead(...ids);
    markAsUnread(...ids);
    delete(...ids);
}

InApp: {
	pauseCampaignDisplay();
    resumeCampaignDisplay();
    getAll((error, result) => { ... });
    get(id, (error, result) => { ... });
    markAsRead(...ids);
    markAsUnread(...ids);
    delete(...ids);
}

DataWallet: {
	getPolicy((error, result) => { ... });
	isRead((error, result) => { ... });
	setIsRead(value);
}

GDPR: {
	requestToAccessMyData();
	requestToDeleteMyData();
}

Usage

At the top of your javascript files add:

import FollowAnalytics from "react-native-followanalytics";

You can now call the methods listed above using FollowAnalytics.method_name(arguments). Some examples:

FollowAnalytics.logEvent("Page view", "Homepage);
FollowAnalytics.UserAttributes.setFirstName("Michel");
FollowAnalytics.getDeviceId: function(error, result) => {
	if (error) {
		console.log("Error fetching deviceId");
		console.log(error);
	} else {
		console.log("Got me a deviceId, and it's: " + result.toString());
	}
}