Giter Site home page Giter Site logo

mixpanel / mixpanel-react-native Goto Github PK

View Code? Open in Web Editor NEW
95.0 37.0 39.0 9.67 MB

Official React Native Tracking Library for Mixpanel Analytics

Home Page: https://mixpanel.com

License: Apache License 2.0

JavaScript 64.32% Java 18.43% Swift 11.59% Objective-C 4.15% Ruby 0.42% Shell 0.02% Python 1.07%
react native react-native tracking sdk analytics analytics-tracking mixpanel-sdk mixpanel android ios

mixpanel-react-native's Introduction

Mixpanel React Native Library

Table of Contents

Introduction

Welcome to the official Mixpanel React Native library. The Mixpanel React Native library is an open-source project, and we'd love to see your contributions! We'd also love for you to come and work with us! Check out Jobs for details.

Quick Start Guide

Mixpanel's React Native SDK is a wrapper around Mixpanel’s native iOS and Android SDKs and it supports offline tracking. Check out our official documentation for more in depth information on installing and using Mixpanel on React Native.

1. Install Mixpanel

Prerequisites

Steps

  1. Under your app's root directory, install Mixpanel React Native SDK.
npm install mixpanel-react-native
  1. Under your application's ios folder, run
pod install

Please note: You do not need to update your Podfile to add Mixpanel.

  1. Since Xcode 12.5, there is a known swift compile issue, please refer to this workaround. However the compile issue has been resolved in Xcode 13.2.1+, there is no extra step required as long as you upgrade to Xcode 13.2.1+.

2. Initialize Mixpanel

To start tracking with the library you must first initialize with your project token. You can get your project token from project settings.

import { Mixpanel } from 'mixpanel-react-native';

const trackAutomaticEvents = false;
const mixpanel = new Mixpanel("Your Project Token", trackAutomaticEvents);
mixpanel.init();

Once you've called this method once, you can access mixpanel throughout the rest of your application.

3. Send Data

Let's get started by sending event data. You can send an event from anywhere in your application. Better understand user behavior by storing details that are specific to the event (properties). After initializing the library, Mixpanel will automatically track some properties by default. learn more

// Track with event-name
mixpanel.track('Sent Message');
// Track with event-name and property
mixpanel.track('Plan Selected', {'Plan': 'Premium'});

In addition to event data, you can also send user profile data. We recommend this after completing the quickstart guide.

4. Check for Success

Open up Events in Mixpanel to view incoming events. Once data hits our API, it generally takes ~60 seconds for it to be processed, stored, and queryable in your project.

Complete Code Example

import React from 'react';
import { Button, SafeAreaView } from "react-native";
import { Mixpanel } from 'mixpanel-react-native';

const trackAutomaticEvents = false;
const mixpanel = new Mixpanel("Your Project Token", trackAutomaticEvents);
mixpanel.init();

const SampleApp = () => {
  return (
    <SafeAreaView>
      <Button
        title="Select Premium Plan"
        onPress={() => mixpanel.track("Plan Selected", {"Plan": "Premium"})}
      />
    </SafeAreaView>
  );
}

export default SampleApp;

Expo and React Native for Web support (3.0.2 and above)

Starting from version 3.0.2, we have introduced support for Expo, React Native for Web, and other platforms utilizing React Native that do not support iOS and Android directly. To enable this feature,
Step 1:

npm install @react-native-async-storage/async-storage

When JavaScript mode is enabled, Mixpanel utilizes AsyncStorage to persist data. If you prefer not to use it, or if AsyncStorage is unavailable in your target environment, you can import or define a different storage class. However, it must follow a subset (see: MixpanelAsyncStorage) of the same interface as AsyncStorage The following example demonstrates how to use a custom storage solution:

// Optional: if you do not want to use the default AsyncStorage
const MyAsyncStorage = require("@my-org/<library-path>/AsyncStorage"); 
const trackAutomaticEvents = false;
const useNative = false;
const mixpanel = new Mixpanel('YOUR_TOKEN', trackAutomaticEvents, useNative, MyAsyncStorage);
mixpanel.init();


Step 2: Initialize Mixpanel with an additional parameter, useNative, set to false.

const trackAutomaticEvents = false;
const useNative = false;
const mixpanel = new Mixpanel(
    "YOUR_MIXPANEL_TOKEN",
    trackAutomaticEvents,
    useNative
  );

This will activate JavaScript mode.

👋 👋 Tell us about the Mixpanel developer experience! https://www.mixpanel.com/devnps 👍 👎

FAQ

I want to stop tracking an event/event property in Mixpanel. Is that possible?
Yes, in Lexicon, you can intercept and drop incoming events or properties. Mixpanel won’t store any new data for the event or property you select to drop. See this article for more information.

I have a test user I would like to opt out of tracking. How do I do that?
Mixpanel’s client-side tracking library contains the optOutTracking() method, which will set the user’s local opt-out state to “true” and will prevent data from being sent from a user’s device. More detailed instructions can be found in the section, Opting users out of tracking.

Why aren't my events showing up?
First, make sure your test device has internet access. To preserve battery life and customer bandwidth, the Mixpanel library doesn't send the events you record immediately. Instead, it sends batches to the Mixpanel servers every 60 seconds while your application is running, as well as when the application transitions to the background. You can call flush() manually if you want to force a flush at a particular moment.

mixpanel.flush();

If your events are still not showing up after 60 seconds, check if you have opted out of tracking. You can also enable Mixpanel debugging and logging, it allows you to see the debug output from the Mixpanel library. To enable it, call setLoggingEnabled with true, then run your iOS project with Xcode or android project with Android Studio. The logs should be available in the console.

mixpanel.setLoggingEnabled(true);

Starting with iOS 14.5, do I need to request the user’s permission through the AppTrackingTransparency framework to use Mixpanel?
No, Mixpanel does not use IDFA so it does not require user permission through the AppTrackingTransparency(ATT) framework.

If I use Mixpanel, how do I answer app privacy questions for the App Store?
Please refer to our Apple App Developer Privacy Guidance

I want to know more!

No worries, here are some links that you will find useful:

Have any questions? Reach out to Mixpanel Support to speak to someone smart, quickly.

mixpanel-react-native's People

Contributors

austinpray-mixpanel avatar byeokim avatar dabrowne avatar dependabot[bot] avatar iamandiradu avatar jad-jbara avatar jakecronin avatar jaredmixpanel avatar linmic avatar m0rl avatar sidferreira avatar sranthony avatar torufuruya avatar viljark avatar yonom avatar zihejia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mixpanel-react-native's Issues

React native Mixpanel-react-native errors

With the last update of macOS 11.3.1 and Xcode 12.5 me and my Colleagues are not able to run our react native apps with mixpanel-react-native dependency. Each time we try to compile and run the app it gives us an error like this:

** BUILD FAILED **

The following build commands failed:
Ld /Users/armandasastrauskas/Library/Developer/Xcode/DerivedData/AwesomeProject-dyoeqkcqjyqzweaytzdetoekvcmk/Build/Products/Debug-iphonesimulator/AwesomeProject.app/AwesomeProject normal
(1 failure)

Since xcode 12.5, project can't run with debug build configuration with mixpanel. Workaround does not work

Dear Mixpanel

I am contacting you because since the last xcode update (12.5), our project can't run in debug mode on iOS because of mixpanel.

To be sure the issue is not within our project, i created a fresh react-native project and installed ONLY mixpanel, nothing else and we are still getting the same issue. Steps to reproduce

  1. npx react-native init mixpanelCrashTesting
  2. cd mixpanelCrashTesting
  3. yarn start
  4. npx react-native run-ios (to verify that it runs without any problem, yet, it does)
  5. npm install mixpanel-react-native
  6. cd ios && pod install
  7. cd .. && npx react-native run-ios

result is -> ** BUILD FAILED **

if i try to run from xcode, i get more info but that's still not enough to find out
how to fix this.

Undefined symbols for architecture x86_64:
"Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer) -> (Swift.IndexingIterator<Swift._ArrayBuffer>, Swift.Int)", referenced from:
generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray(A) -> Swift.ContiguousArray<A.Element> in libMixpanel-swift.a(AutomaticProperties.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If i change the build confguration to RELEASE, no problem. But we can't develop effectively like
that, we need a DEBUG config. And to remove & add mixpanel every time we need to debug or release
that's a real pain as a workaround. Every help is appreciated. Thank you in advance

We also tried the workaround you suggested:
-remove $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

  • add empty swift like and accept to create bridging header

still did not solve the issue

Getting error while Pod Install: None of your spec sources contain a spec satisfying the dependency: `Mixpanel-swift (= 2.9.3)`.

[!] CocoaPods could not find compatible versions for pod "Mixpanel-swift":
In Podfile:
MixpanelReactNative (from ../node_modules/mixpanel-react-native) was resolved to 1.2.2, which depends on
Mixpanel-swift (= 2.9.3)

None of your spec sources contain a spec satisfying the dependency: Mixpanel-swift (= 2.9.3).

You have either:

  • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

Are the documented initializations correct?

I'm not positive that the readme or the demo application are initializing the Mixpanel instance safely.

For example, in the readme, this is the intended approach for initializing the Mixpanel instance:

import { Mixpanel } from 'mixpanel-react-native';
...
class YourClass extends React.Component {
    constructor(props) {
        super(props);
        this.configMixpanel();
    }

    configMixpanel = async () => {
        this.mixpanel = await Mixpanel.init("Your mixpanel token");
    }
...

I think that async initialization is generally frowned upon in constructors because you can't reasonably make predictions about the behavior. In this case, it's possible that someone could try to access this.mixpanel before it has been assigned, right?

Often, if something has to be done asynchronously in React, it'll be handled in componentDidMount rather than in the constructor. I know this isn't "loading" or "initializing" really, but it smells kind of funny.

I think that's probably partially why the MixpanelManager class was created in the demo project. But, this also has async work in the constructor:

export default class MixpanelManager {
    static sharedInstance = MixpanelManager.sharedInstance || new MixpanelManager();

    constructor() {
        this.configMixpanel();
    }
    
    configMixpanel = async () => {
        this.mixpanel = await Mixpanel.init(MixpanelToken);
    }
}

It seems like there are two potential issues with this. One of them is that it hides the fact that there's async work being done from the consumer. The other is that there's not a good way for the consumer to wait for initialization before continuing.

Indeed, this code results in an error:

import { MixpanelManager } from './MixpanelManager';

MixpanelManager.sharedInstance.mixpanel.track("Race lost. :(");  // undefined is not an object

It totally makes sense that this kind of thing would pop up. A lot of analytics libraries manage their own singletons. They have an async init method you can await, but the singleton is always accessible. In this case, we manage our own Mixpanel instance and we have to get it asynchronously because it constructs and initializes at the same time.

I guess, all of this is to say, are these examples appropriate as the canonical examples of how to consume this library?

In iOS I cannot initialize the library

RN version: 0.60.5
Mixpanel RN library: 1.0.1

Hi there! In Android I could do the implementation well everything worked for me following the documentation but in iOS I cannot initialize the library with the function
configMixpanel = async () => { this.mixpanel = await Mixpanel.init("Your mixpanel token"); }
in the debug I see that this function returns it undefined
Captura de Pantalla 2021-02-01 a la(s) 2 03 57 p  m  (1)
what can it be?

I'll appreciate your help
Regards

Initial registration / identity of Mixpanel user

Good afternoon,

I've been following the progress of the library from Beta, so first and foremost congratulations on making the push to live!

Quick disclosure - I haven't cut over from the use of the beta bundle (i.e. mixpanel-react-native-1.0.0-beta.5.tgz) as of yet - this could potentially be part of the issue, but the code doesn't seem to have changed in the time this has gone live.

I made a post concerning the use of identify and alias recently, and am now currently following the documentation in hopes of locking down a clean implementation across the board. It seems like per the formal docs, there's an extra step from that thread reply.

So, after our first-time login (following a welcome email, temp password, etc.), I am attempting to follow verbatim the snippet provided:

// This makes the current ID (by default an auto-generated GUID)
// and '13793' interchangeable distinct ids (but not retroactively).
mixpanel.alias("13793", null);
// To create a user profile, you must call identify()
mixpanel.identify(mixpanel.getDistinctId());

However, I'm getting an error following this example. The caveat here is that I'm attempting a new user on the same device (emulator) so there might be a snag in the issue I'm experiencing.

image

It looks like even though I made a call to reset() during the logout (followed by a flush() to ensure this is prioritized) I am either caching or hanging onto the former login of kkelley rather than the expected GUID-style unique_ID that Mixpanel typically generates.

Have I missed a step in registration setup following these best practices? I'm very plausibly creating a niche scenario trying to attempt this back to back on the device, but I suppose this could be replicated if two users shared a device as well, which is a bit more likely. Let me know if I've left any info out as well, and thank you for your time.

Cheers

library not found for -lMixpanelReactNative for iOS

Hi,
I'm getting error 'directory not found for option /project path/MixpanelReactNative' iOS.

ld: warning: directory not found for option '-L-L/Users/mac/Library/Developer/Xcode/DerivedData/project name/Build/Products/Debug-iphonesimulator/MixpanelReactNative'
ld: library not found for -lMixpanelReactNative
clang: error: linker command failed with exit code 1 (use -v to see invocation).

I've done proper setup(node module and pods installation).

Can someone plz help me on this?

Thanks!

Permission READ_PHONE_STATE not granted

Hello,

Is giving me the following error with the library:

W/MixpanelAPI.SysInfo: Permission READ_PHONE_STATE not granted. Property $radio will not be available.
V/FA: Inactivity, disconnecting from the service
W/MixpanelAPI.SysInfo: Permission READ_PHONE_STATE not granted. Property $radio will not be available.
I/System.out: [okhttp]:check permission begin!

what does it mean? because according to the documentation it only ask for permission from the internet

Regards

Can't see events on Mixpanel Interface

Hello,

I have been trying to implement this module with no success...

For example, I would like to track a event of Home Screen View every time the user reaches to the Home Screen. The code I am using for example is this
`
import React from 'react';
import { View, Text, StyleSheet, TouchableOpacity, ScrollView } from 'react-native';
import { Mixpanel } from 'mixpanel-react-native';

const HomeScreen = props => {

useEffect( () => {
	const connectAndTrack = async () => {
		const mixpanel = await Mixpanel.init('MIXPANEL_TOKEN');
		mixpanel.track("Home Screen View");
	};
	
	connectAndTrack();
	return () => {}
}, [])

return (
	<View>
		<Text>Mixpanel React Native Test </Text>
	</View>
)

}

export default HomeScreen;
`

The code is running with no error but the event never gets to the Mixpanel dashboard / interface. I am currntly running on iOS only.

How can I further investigate it?

Are the types correct on the latest version?

I've changed my initialisation for the latest version:

const mixpanel = new _Mixpanel(config.MIXPANEL_TOKEN)
mixpanel.init()

But now I'm getting a Typescript error on the first line

Expected 0 arguments, but got 1.

24         const mixpanel = new _Mixpanel(config.MIXPANEL_TOKEN)
                                          ~~~~~~~~~~~~~~~~~~~~
Found 1 error.

Is there a workaround/fix for this? Or am I doing something wrong?

Manual setup

Please can you provide manual setup steps - we aren't using pods for our ReactNative app

MixpanelReactNative is null

I'm getting this error when trying to run the app on an android emulator.

This issue has been opened a few times before but it was closed every time for some reason.

I'm using new instance method init and it's stil not working.

I'm creating the instance in a file src/utils/mixpanel

import Config from 'react-native-config';
import { Mixpanel } from 'mixpanel-react-native';

// @ts-ignore
export default new Mixpanel(Config.MIXPANEL_TOKEN);

and somewhere in the app

import mixpanel from '../utils/mixpanel';

mixpanel.init().then(() => {});

Here's the error from the terminal:

Error: mixpanel-react-native: MixpanelReactNative is null. 
    Please follow the guide on the Github repository: https://github.com/mixpanel/mixpanel-react-native

Tracking and Identifying Oh My!

I am confused!
I have read this: https://help.mixpanel.com/hc/en-us/articles/115004497803-Identity-Management-Best-Practices
And I'm trying to understand something:
I have a user that is using the app for the first time(or logged out)
I'm assuming from the docs that when they started the app, they receive a uniques identifier that is being used to send events

  1. If they tap login- easy peasy I'm login them in and call identify -done we know who the user is
  2. If they register, I should call mixpanel.alias("some_user", user.id). Why not call here identify?
  3. Then upon login after register i need to call identify? What if on my app upon registration completion, the user is logged in? Should the process then be: alias() ------> and then identify() immediately? This is not coherent from the docs

Thanks in a advance

App Session events don't seem to be logged after v1.2.4

Since upgrading mixpanel-react-native from v1.1.1 to v1.3.1 we've noticed that 'App Session' events seem to no longer be logged in MixPanel. I tried downgrading through some of the recent versions, and noticed that on v1.2.4 the 'App Session' events still seem to be logged. But on v1.3.0 and upwards they no longer seem to show up.

As part of the upgrade we changed how we initialise MixPanel, so we now use the instance method. All other events seem to be coming through to the dashboard just fine.

Any ideas what might be causing this?

iOS Simulator: sync not working as expected

Just installed the package in our app, running in simulator with logging enabled.
The docs state that the data is flushed every 60 seconds, but at least in Simulator nothing happens - no timer or so. But when I send the app to background, the data is eventually flushed and visible in Mixpanel's dashboard.

It looks like the app has to be sent to background at least once to start the timer for flushing the data

Notification Support

I can't seem to find notification support anywhere in your documentation - is this feature available yet? Or is it slated for a later release?

If it is available, can we get the API documentation updated to reflect how to use it?

Mixpanel.addPushDeviceToken ?

The migration from https://github.com/davodesign84/react-native-mixpanel is not so intuitive, and I have hard time making it with the current documentation to be honest

I struggle with the push tokens, I know Mixpanel eventually will stop the notifications service, but meanwhile, we still need it.

Is there an equivalent of Mixpanel.addPushDeviceToken ?

  saveToken = (pushToken) => {
    if (Platform.OS === 'ios') {
      Mixpanel.addPushDeviceToken(pushToken);
    }
    if (Platform.OS === 'android') {
      Mixpanel.initPushHandling('An Id Number');
      Mixpanel.setPushRegistrationId(pushToken);
    }
  };

App build fails on iOS 14.5

I'm having an issue after upgrading to Xcode 12.5 and iOS 14.5, build is failing with error:

Undefined symbols for architecture x86_64:
"Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer) -> (Swift.IndexingIterator<Swift._ArrayBuffer>, Swift.Int)", referenced from:
generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray(A) -> Swift.ContiguousArray<A.Element> in libMixpanel-swift.a(AutomaticProperties.o)
ld: symbol(s) not found for architecture x86_64

Crash between older setups and this lib because of swift.

I have been in contact with customer support, and community regarding this error. See following communication for details.
Here is my comment on the initial community error: https://community.mixpanel.com/strategy-and-planning-9/swift-errors-in-react-native-library-5071?postid=7616#post7616

And here is the email with support: Diwala Mail - [Mixpanel] Re_ React native library does not work on iOS.pdf

What basically lead me to fixing this, was this comment: facebookarchive/react-native-fbsdk#755 (comment)

I dont know why it is happening on this lib? Guess it is in swift and there is a crash there?
Maybe its worth documenting?

I just atleast wanted to highlight this and showcase the fix that worked for me.

[Feature Request] Add support for Expo Config Plugins

I am on a team that's fixin to start work on a cross-platform Expo app, intended to replace our three legacy clients. Wanted to inquire whether y'all would consider adding support for Config Plugins, so this library can be used with the Expo Managed Workflow (i.e. without ejecting)

Thanks for your consideration!

Feature Context

Over the past several months Expo has introduced features which enable apps to use external native modules, without ejecting Expo's managed workflow.

The customizations to the iOS and Android code that are required by a given native module are automated, using an AST-based API that Expo provides through "Config Plugins" feature.

These automations (called "mods") are executed during a new "Prebuild" phase, in which boilerplate ios and android directories are created — and then their respective files are altered, based on the instructions in a given modules config plugin. The end result is essentially the same as if you ejected and manually changed the ios/android files.

Here's the Expo blog post announcing Config Plugins and the associated feature-set.

Overview of Proposed Implementation

The process for creating a Config Plugin is detailed here:
https://docs.expo.io/guides/config-plugins/#creating-a-plugin

There are a few different "recipes" for how to implement — but the gist of it is:

  • Create the app.plugin.js file, at the project root — which serves as a standard entrypoint where expo can resolve the plugin code. [ex: expo-camera]
  • Export a function prefixed using "with" (eg withFeature) which accepts a config object that can be used, along with @expo/config-plugins methods, to implement mods for each platform's native code. [ex: withCamera]
  • Add mods corresponding to the setup steps in your README.md
  • Celebrate!

ANDROID_NDK_HOME error when building Android with version 1.3.3

We have just upgraded to v1.3.3, and now our Android build is failing when running :app:assembleRelease :app:bundleRelease:

> Task :app:stripReleaseDebugSymbols FAILED
Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

We're on react-native 0.63.4 and our default gradle config is:

 defaultConfig {
        applicationId "com.blah.blah"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60"
        versionCode 5
        versionName "2.0.1"
        ndk {
            abiFilters "armeabi-v7a", 'arm64-v8a', "x86", 'x86_64'
        }
        renderscriptTargetApi 23
        renderscriptSupportModeEnabled true
        multiDexEnabled true
        resValue "string", "build_config_package", "com.blah.blah"
        resConfigs "en", "US"
    }

Do we need to change anything in our settings?

Xcode 12.5.1 linking issue

After updating Xcode to latest version, project is unable to build there is some issue in this file libMixpanel-swift.a.

generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray(A) -> Swift.ContiguousArray<A.Element> in libMixpanel-swift.a(AutomaticProperties.o)

Getting "MixpanelReactNative is null" on fresh install

I just tried adding this module to a project and am getting this error when calling Mixpanel.init() with my key. The error says "Please follow the guide on Github" but the only thing I see is in the README calling for adding the module and running pod install, the usual procedure. I have done that, and can confirm my Podfile.lock contains the appropriate modules (pod install also reported installing them):

...
  - Mixpanel-swift (2.9.3):
    - Mixpanel-swift/Complete (= 2.9.3)
  - Mixpanel-swift/Complete (2.9.3)
  - MixpanelReactNative (1.2.0):
    - Mixpanel-swift (= 2.9.3)
    - React
...

Any thoughts?

"TS2554: Expected 1 arguments, but got 0." error when implementing Samples/ContextAPIMixpanel/Analytics.js

Invoking createContext without passing defaultValue argument results in TypeScript error:

// Samples/ContextAPIMixpanel/Analytics.js
import React from 'react';
import { Mixpanel } from 'mixpanel-react-native';

const MixpanelContext = React.createContext(); // TS2554: Expected 1 arguments, but got 0.

export const useMixpanel = () => React.useContext(MixpanelContext);

export const MixpanelProvider = ({children}) => {
  const [mixpanel, setMixpanel] = React.useState(null);

  React.useEffect(() => {
    const mixpanelInstance = new Mixpanel(`Your Project Token`);
    mixpanelInstance.init();
    setMixpanel(mixpanelInstance); // TS2345: Argument of type 'Mixpanel' is not assignable to parameter of type 'SetStateAction<null>'.
  }, []);

  return <MixpanelContext.Provider value={mixpanel}>{children}</MixpanelContext.Provider>;
};

I found creating Mixpanel instance and passing it to createContext resolves the error. Is it ok to implement like this?

import React from 'react';
import { Mixpanel } from 'mixpanel-react-native';

const mixpanelInstance = new Mixpanel(`Your Project Token`);
mixpanelInstance.init();

const MixpanelContext = React.createContext(mixpanelInstance);

export const useMixpanel = () => React.useContext(MixpanelContext);

export const MixpanelProvider = ({children}: {children: React.ReactNode}) => (
  <MixpanelContext.Provider value={mixpanelInstance}>{children}</MixpanelContext.Provider>
);

[Android] Mixpanel not working after upgrading React Native to 0.65.0

We can't build the project for android.

A problem occurred configuring project ':mixpanel-react-native'.
> Could not resolve all artifacts for configuration ':mixpanel-react-native:classpath'.
   > Could not resolve com.android.tools.build:builder-model:3.4.1.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.lint:lint-gradle-api:26.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:gradle-api:3.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools:sdk-common:26.4.1
      > Could not resolve com.android.tools.build:builder-model:3.4.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/builder-model/3.4.1/builder-model-3.4.1.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/builder-model/3.4.1/builder-model-3.4.1.pom'.
               > Read timed out
   > Could not resolve com.android.tools.build:manifest-merger:26.4.1.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1
      > Could not resolve com.android.tools.build:manifest-merger:26.4.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.4.1/manifest-merger-26.4.1.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.4.1/manifest-merger-26.4.1.pom'.
               > Read timed out
   > Could not resolve com.android.tools.ddms:ddmlib:26.4.1.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools.build:builder-test-api:3.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools:sdk-common:26.4.1
      > Could not resolve com.android.tools.ddms:ddmlib:26.4.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.4.1/ddmlib-26.4.1.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.4.1/ddmlib-26.4.1.pom'.
               > Read timed out
   > Could not resolve com.google.guava:guava:26.0-jre.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.analytics-library:shared:26.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.analytics-library:crash:26.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.lint:lint-gradle-api:26.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:gradle-api:3.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > androidx.databinding:databinding-compiler-common:3.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:bundletool:0.7.2
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools:common:26.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools.analytics-library:tracker:26.4.1
      > Skipped due to earlier error
   > Could not resolve com.google.code.gson:gson:2.8.0.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.analytics-library:shared:26.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > androidx.databinding:databinding-compiler-common:3.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build.jetifier:jetifier-core:1.0.0-beta04
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools:sdklib:26.4.1
      > Skipped due to earlier error
   > Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.3.31.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.lint:lint-gradle-api:26.4.1
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools:sdk-common:26.4.1
      > Skipped due to earlier error
   > Could not resolve com.squareup:javapoet:1.8.0.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > androidx.databinding:databinding-compiler-common:3.4.1
      > Skipped due to earlier error
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.3.31.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31
      > Skipped due to earlier error
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.31.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31
      > Skipped due to earlier error
   > Could not resolve com.google.auto.value:auto-value:1.5.2.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:bundletool:0.7.2
      > Skipped due to earlier error
   > Could not resolve com.google.errorprone:error_prone_annotations:2.2.0.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:bundletool:0.7.2
      > Skipped due to earlier error
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.3.31.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build.jetifier:jetifier-core:1.0.0-beta04
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04
      > Skipped due to earlier error
   > Could not resolve com.google.guava:guava:26.0-jre.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.google.protobuf:protobuf-java-util:3.4.0
      > Skipped due to earlier error
   > Could not resolve com.google.code.gson:gson:2.8.0.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.google.protobuf:protobuf-java-util:3.4.0
      > Skipped due to earlier error
   > Could not resolve com.google.guava:guava:26.0-jre.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools.build:apkzlib:3.4.1
      > Skipped due to earlier error
   > Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools:sdklib:26.4.1 > com.android.tools:repository:26.4.1
      > Skipped due to earlier error
   > Could not resolve com.google.guava:guava:26.0-jre.
     Required by:
         project :mixpanel-react-native > com.android.tools.build:gradle:3.4.1 > com.android.tools.build:builder:3.4.1 > com.android.tools:sdklib:26.4.1 > com.android.tools:repository:26.4.1 > com.google.jimfs:jimfs:1.1
      > Skipped due to earlier error

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 3m 1s

Issue with addGroup/setGroup on both platforms

I've run into problem with addGroup/setGroup

On android mixpanel is unable to set proper distinct id
mixpanel issue 0
Zrzut ekranu 2021-01-15 o 15 34 26

on the iOS problem is not that big because it's only lacking some less valuable data like region etc
Zrzut ekranu 2021-01-15 o 16 01 33

On my side i've check if all of those values are defined and they are. Also some of those values are collected under User and they look fine there.

It only track on iOS in Android nothing at all

Hello,

I installed your library in two projects following your doc and does not work in android in ios work well. And I just tried a third project a new React Native project from scratch, with nothing at all, we just installed your library and put a basic track to try to see and nothing that works in android, I leave below what exactly I did with this last case of RN project from scratch:

First try like this as you have on your demo:

import {Mixpanel} from 'mixpanel-react-native';
import {token as MixpanelToken} from './app.json';

export default class MixpanelManager {
 static sharedInstance = MixpanelManager.sharedInstance || new MixpanelManager(); constructor() {
 this.configMixpanel();
 } configMixpanel = async () => {
 this.mixpanel = await Mixpanel.init(MixpanelToken);
 };
} 

The following was done in the Component:

constructor(props) {
 super(props);
 this.mixpanel = MixpanelManager.sharedInstance.mixpanel;
 }

then the method is called

track = () => {
 this.mixpanel.track('Track Event!');
 };

It does not show any Error but does not mark any Track on the Live View

I also tried as you said in your doc

export default class App extends Component {
 constructor(props) {
 super(props);
 this.configMixpanel();
 } configMixpanel = async () => {
 this.mixpanel = await Mixpanel.init('my_token');
 };

This causes a Warning
Capture 1

then when mixpanel.track ('someEvent') is called; causes the following Error
Capture 2

then what happen in android? because in ios it works...

Regards

Mixpanel React Native is null

I have followed your nice and simple installation steps and this works great on iOS. However on Android it doesn't and I get the following error:

image

I deleted node_modules and the issue persisted.

package.json:
"mixpanel-react-native": "^1.2.4",

Typescript support

Amazing we have the official RN library out - just in time for our integration!

However, as per convention I've tried installing @types/mixpanel-react-native to get the types right but this package does not seem to exist. Is there a way to get the TypeScript types for the library?

iOS Project Doesnt Build after including the mixpanel package.

Hi All,

I have followed all the instructions provided in the document. We were previously using https://github.com/davodesign84/react-native-mixpanel for tracking events from our react native application.

Now that we have official support from Mixpanel, we have decided to update our application to use this package. However we ran into the following issues after including it on the app.

iOS app build fails with the following errors,

`❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▸ Compiling AnyTweak.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ApplicationStateSerializer.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling AutomaticEvents.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling AutomaticProperties.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling BaseNotificationViewController.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling BaseWebSocketMessage.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling BindingMessage.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling CGAffineTransformToNSDictionary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling CGPointToNSDictionary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling CGRectToNSDictionary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling CGSizeToNSDictionary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ChangeMessage.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ClearMessage.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Clip.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Codeless.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling CodelessBinding.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ConnectIntegrations.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Constants.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Decide.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling DecideRequest.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling DeviceInfoMessage.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling DisconnectMessage.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling DisplayTrigger.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Error.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling FileLogging.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Flush.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling FlushRequest.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Group.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling IdentityTransformer.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling InAppButton.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling InAppNotification.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling InAppNotifications.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling JSONHandler.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Logger.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling MD5.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling MiniNotification.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling MiniNotificationViewController.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Mixpanel.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling MixpanelInstance.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling MixpanelNotificationServiceExtension.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling MixpanelType.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Network.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling NSAttributedStringToNSDictionary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ObjectFilter.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ObjectIdentityProvider.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ObjectSelector.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ObjectSerializer.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ObjectSerializerConfig.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ObjectSerializerContext.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling People.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Persistence.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling PrintLogging.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling PushNotifications.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling ReadWriteLock.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling SelectorEvaluator.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling SessionMetadata.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling SHA256.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling SnapshotMessage.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling SSLSecurity.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Swizzle.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TakeoverNotification.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TakeoverNotificationViewController.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Track.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Tweak.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakableType.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakBinding.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakClusterType.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakCollection.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakGroup.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakLibrary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakMessage.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakPersistency.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakStore.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling TweakViewData.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling UIColorToNSString.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling UIControlBinding.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling UIEdgeInsetsToNSDictionary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling UIFontToNSDictionary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling UIImageToNSDictionary.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling UITableViewBinding.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling UIViewSelectors.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling Variant.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling VariantAction.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling VariantTweak.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling WebSocket.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
^

▸ Compiling WebSocketWrapper.swift

❌ /Users<>/ios/Pods/Headers/Public/Mixpanel/Mixpanel-swift.modulemap:1:8: redefinition of module 'Mixpanel'

module Mixpanel {
`

A lot of "undefined symbol" errors happening with the latest version

Hello, I have just integrated the latest version of this library into our RN app (0.63.4) and this keeps happening (all installation and pod install steps were taken properly):
Screen Shot 2021-06-17 at 05 05 04

I don't know if this issue is related to the one mentioned in the workaround or not, but I have tried that one regardless (removed Swift 5 line and added the bridging header) but the same errors persisted, any help would be very much appreciated!

JSON value '<null>' of type NSNull cannot be converted to NSString

Hi there!

I am using the latest version of mixpanel-react-native "^1.1.0" using react "16.13.1" and react-native "0.61.5"
and when I try to initialize the Mixpanel library using the following code

this.mixpanel = await Mixpanel.init("*************");

I received the following error screen on iOS devices:
__

It only track on Android in iOS nothing at all

Hello,

I track event and it works fine for android
and do not work for ios,
without any error

this.mixpanel = await Mixpanel.init(APP_TOKEN)

this.mixpanel.track(event)

"react-native": "0.61.5",
"mixpanel-react-native": "^1.2.4",

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.