Code Monkey home page Code Monkey logo

react-native-mixpanel's People

Contributors

aakashsigdel avatar acmeyer avatar anback avatar davide-scalzo avatar hfossli avatar hiddentao avatar jastanton avatar jeanregisser avatar jefftrudeau avatar jtcarder avatar kabangi avatar kerumen avatar kevinejohn avatar kyleclegg avatar lorenc-tomasz avatar lunarmayor avatar mikelambert avatar mr-ryan-james avatar nevir avatar ninjz avatar philipshurpik avatar raburski avatar raubas avatar sachingadagi avatar stevepotter avatar sunweiyang avatar terran42 avatar vpavlenko avatar wkoutre avatar zoontek 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  avatar  avatar  avatar  avatar  avatar

Watchers

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

react-native-mixpanel's Issues

I get an error when building after following the install steps

Hi, I'm pretty new to iOS and developing with cocoapod, so I apologise in advance if this is a rookie mistake.

I get a build error after following installation step 5 (Add libRNMixpanel.a to your project's Build Phases).

This is the the error:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_Mixpanel", referenced from:
     objc-class-ref in libRNMixpanel.a(RNMixpanel.o)

(I get the same error when building for simulator, but with x86_64)

I'm pretty sure I'm doing step 5 correctly, but I am wondering if I'm not following step 6 correctly?
I go to the RNMixpanel.xcodeproj in my Project/Libraries folder, then edit the Header Search Paths like this -

$(inherited)
/Applications/Xcode.app/Contents/Developer/Toolchains/........
$(SRCROOT)/../../React
$(SRCROOT)/../../node_modules/react-native/React
$(SRCROOT)/../react-native/React

All recursive except inherited.

I also think it could be another issue with the installation of the cocoapod having to be for a specific version of ios, or not having copied some files across. Do you have any idea why I would be getting this problem?

Thanks

Sync or async?

I suppose that the calls to Mixpanel are asynchronous. Is it safe to just call the functions and let them take care of themselves? Or are there any initializations that needs to be awaited on?

I'm thinking that sharedInstanceWithToken() might need to be awaited on to ensure everything is initialized before calling track() etc.

Are any of the functions blocking? It would be great to have some more knowledge of this.

Thank you for a great library.

Error installing mixpanel

I get the following error when I added mixpanel to my existing project. I installed the SDK and linked the appropriate files as documented.

Undefined symbols for architecture x86_64:
  "_utf8_nextCharSafeBody", referenced from:
      _validate_dispatch_data_partial_string in libMixpanel.a(MPWebSocket.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Error installing library

I followed the instruction from documentation. have installed SDK and trying to link library to my project. And I get following error while building my project.

/Users/.../node_modules/react-native-mixpanel/RNMixpanel/RNMixpanel.m:12:9: Module 'React' not found

header search path is as follows

$(inherited) => non-recursive
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include => recursive
$(SRCROOT)/../../React => recursive
$(SRCROOT)/../../node_modules/react-native/React => recursive

Am I missing something? I am using react-native 0.25.1

Error IOS: Undefined symbols for architecture x86_64

Hi guys I'm getting this on a fresh react native project when i include this component. PS -> I first fixed the duplicate method issue manually from the master by replacing RNMixpanel.m

Full error:
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_Mixpanel", referenced from:
objc-class-ref in libRNMixpanel.a(RNMixpanel.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Current react versions:
"react": "15.4.1",
"react-native": "0.39.2",
"react-native-mixpanel": "0.0.11"

Hope you can help.

Ambiguous Android installation instructions

The section of the installation entitled On newer versions of React Native (0.18+): is ambiguous.

Does the package not support React Native below 0.18?
Do those using React Native below 0.18 have to follow some alternative instructions?
How does this relate to the steps prior to this section? Must it be completed instead of, or in addition to?
Or is none of the above true?

I think the installation instructions should be updated to be more clear about what installation path a user must follow, depending on the version of React Native that they are using.

Events not being sent to mixpanel

I used cocoapods to install mixpanel, and I tried calling sharedInstanceWithToken in both the AppDelegate and in my index.ios.js. I also tried calling flush explicitly after calling track, but I never see any network requests going out.

People properties?

Hi, thanks for the great package. Do you have plans to add people properties?

Passing NSData to addPushDeviceToken

Hey,

Is there an implementation example for the addPushDeviceToken method that takes NSData and not NSString?
Can't really figure out how can I encode the plain token string I'm getting in RN, so the token will passed to the native side as NSData.

Thanks!
Guy

Outdated version in npm?

I just installed react-native-mixpanel via npm and the version that gets installed is 0.0.10, but it seems to have a different version of the code than found here. Most notably the Mixpanel.set method has a different signature than here on GitHub:

    @ReactMethod
    public void set(final String key, final String value) {
        mixpanel.getPeople().set(key, value);
    }

The generated package.json shows me that this is the file that it's fetching:
https://registry.npmjs.org/react-native-mixpanel/-/react-native-mixpanel-0.0.10.tgz, and I have fetched it manually untarred it and found the same offending code. It seems to me that the version on npm is before this commit:
06f0fd1

Duplicate method Error on RNMixpanel.m file

Xcode is complaining about duplicate methods:

RCT_EXPORT_METHOD(addPushDeviceToken:(NSData *)deviceToken) {
    [mixpanel.people addPushDeviceToken:deviceToken];
}

and

// addPushDeviceToken
RCT_EXPORT_METHOD(addPushDeviceToken:(NSString *)pushDeviceToken) {
  [mixpanel.people addPushDeviceToken:pushDeviceToken];
}

which one should we keep?

Doesn't work unless also initialized in objc

Following the instructions, I wasn't able to track events or identify users until I called [Mixpanel sharedInstanceWithToken:MIXPANEL_TOKEN]; from objc. I didn't get any errors...I just didn't see any of the events in my mixpanel dashboard.

(I needed to call sharedInstanceWithToken in JS and in objc)

Note: mixpanel library was installed manually, not from cocoapods.

Events not being fired to Mixpanel

@davodesign84
I am using the following snipped to trigger check_in event to mixpanel. I am unable to see the event in Live View on Mixpanel Dashboard.

const Mixpanel = require('react-native-mixpanel')
Mixpanel.sharedInstanceWithToken(config.mixpanel.token)

Mixpanel.trackWithProperties('check_in', {
        type: type,
        user_id: user.id.toString(),
        status: 'success',
        table_id: table_id.toString(),
        restaurant_id: restaurant_id.toString(),
        admin_user_id: admin_user_id.toString(),
        waiter_user_id: waiter_user_id.toString(),
        event_timestamp: (new Date().getTime()).toString()
      })

Android Build Failure after getDistinctID update: Missing Callback Class

/Users/dwilt/Projects/GJS/gjs-app/node_modules/react-native-mixpanel/android/src/main/java/com/kevinejohn/RNMixpanel/RNMixpanelModule.java:263: error: cannot find symbol
    public void getDistinctId(Callback callback) {
                              ^
  symbol:   class Callback
  location: class RNMixpanelModule
1 error
:react-native-mixpanel:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

After this merge, I'm getting this error on an Android build. I think we're missing a Class reference?

library support

Hi @davodesign84, thank you for making this library! We have been using it in our organization to show in-app notifications. It works really well on iOS. We are having some troubles with Android where the in-app notification is not shown.

With all the new react-native releases, are you still planning on maintaining this library? Do you need help in maintaining?

I see that @kevinejohn has worked on most of the android part. Are you still using this library and maintaining a fork of it @kevinejohn?

I am curious!

Flushing most events

I'm curious why you're explicitly flushing on most calls? Seems like that's going to consume a fair bit of bandwidth for common uses

RNMixpanel.trackCharge was called with 2 arguments but expects 1

Hey there,

So as per the docs I tried calling track charge with a few props but ran into the error mentioned above.
This is my call:

Mixpanel.trackCharge(this.props.variant.price, {'variant id':this.props.variant.id,'variant name':this.props.variant.title});

I am on version 0.0.10 of the package. Any advice would be appreciated :)

Undefined symbols for architecture x86_64

I'm getting the same error as in #6 . Tried setting the Other Linker Flags with no results. Any tips?

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_Mixpanel", referenced from: objc-class-ref in libRNMixpanel.a(RNMixpanel.o)

Error message in XCode

survey support

Hi,

I am using react-native-mixpanel in an app I am working on and the features it is supporting are all working great. I noticed you do not have a wrapper around:

[mixpanel showSurveyWithID:CALL_QUALITY_SURVEY_ID]

Which is used to show a survey when the default behavior ( show the survey on load ) is not enabled. Is there a reason this was not implemented? If there isn't then I can go ahead and try adding the functionality and push it back to you, just wanted to see if there is some large difficulty you ran into that caused you to leave this out.

React natives packager crashes with naming collision

Seems to due to the Podfile dependency on React.

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: react-native-packager
  Paths: /project/node_modules/react-native/packager/package.json collides with /project/ios/Pods/React/packager/package.json

This error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
  Duplicate module name: react-native-packager
  Paths: /project/node_modules/react-native/packager/package.json collides with /project/ios/Pods/React/packager/package.json

Also when doing pod install I get a warning:
[!] React has been deprecated

I've tested this on react-native 0.38 and 0.39.

This is my Podfile in react-native ios-directory:

use_frameworks!

target 'project' do
  pod 'react-native-mixpanel', :path => '../node_modules/react-native-mixpanel/react-native-mixpanel.podspec'
end

Simple removing the s.dependency 'React' from the Podfile creates other problems:

/project/node_modules/react-native-mixpanel/RNMixpanel/RNMixpanel.h:9:9: 'RCTBridgeModule.h' file not found

/project/node_modules/react-native-mixpanel/RNMixpanel/RNMixpanel.m:10:9: In file included from /project/node_modules/react-native-mixpanel/RNMixpanel/RNMixpanel.m:10:

And no matter what I add to react-native-mixpanels xcode Build Settings when it comes to Header/Library/Framework search paths I can't get RNMixpanel.m to find RCTBridgeModule.h... (even though it resides in /project/node_modules/react-native/React/Base)

Crashed without internet

My app crashed if I turned off the internet.

2016-07-26 17:55:53.311 [warn][tid:com.facebook.react.JavaScript] Error: TypeError: Network request failed
2016-07-26 17:55:53.317 [error][tid:com.facebook.react.RNMixpanelQueue][RCTModuleMethod.m:470] RNMixpanel.track was called with 2 arguments, but expects 1.                   If you haven't changed this method yourself, this usually means that                   your versions of the native code and JavaScript code are out of sync.                   Updating both should make this error go away.
2016-07-26 17:55:53.336 [error][tid:com.facebook.react.JavaScript] Module RCTLog is not a registered callable module.
2016-07-26 17:55:53.339 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Module RCTLog is not a registered callable module.

Linker command failed error when trying to build

I keep getting this error when following your tutorial or using rnpm.

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Mixpanel", referenced from:
      objc-class-ref in libRNMixpanel.a(RNMixpanel.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Cocoapods name doesn't match spec file

I'm not sure if this is an error, or just a misunderstanding on my behalf about how cocoapods works - but if I try to run pod update in my project, with the line:

pod 'RNMixpanel', :path => 'node_modules/react-native-mixpanel'

It complains with The name of the given podspec 'react-native-mixpanel' doesn't match the expected one 'RNMixpanel'. Because the podspec file is RNMixpanel.podspec, but in the spec it has s.name = "react-native-mixpanel".

I think it should be either s.name = "RNMixpanel" it works if I do this), or the other way around (react-native-mixpanel.podspec).

Issue when calling reset

This does not fire session end

mixpanel.track('session_end')
mixpanel.reset()

this does

mixpanel.reset()

Maybe the docs should be updated to point out that you should do something like this instead

Promise.resolve(mixpanel.track('session_end'))
.then(mixpanel.reset)

Happy to make a PR if you all think it makes sense.

Support for codeless tracking?

Is it even possible to take advantage of Mixpanel's codeless tracking feature (supported by the native iOS SDK) in a react native app? Currently if you navigate to the wysiwyg editor in Mixpanel you can get the app to render but it shows that there are no trackable elements on the screen.

Did I set it up wrong or is this not a supported feature?

Mixpanel not found

library not found for -lMixpanel

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Mixpanel"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Mixpanel"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Mixpanel"
OTHER_LDFLAGS = $(inherited) -ObjC -l"Mixpanel" -l"icucore" -framework "Accelerate" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Foundation" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

that is my generated pods.. I have Mixpanel directory on my project I already add the inherited paths on the links all the configuration was done.. But still the Mixpanel is missing. Please help thanks

Support get distinct id

It would be nice to support getting the Mixpanel function "get distinct id". For instance if you want to store the identity in a database to reuse it on the web for the same user

where to add mixpanel token ?

I have followed the steps for manual installation and followed the following link https://blog.mixpanel.com/2014/09/30/integrating-the-mixpanel-ios-sdk-without-cocoapods/
In the 4th step of this link, we have to add this line
[Mixpanel sharedInstanceWithToken:MIXPANEL_TOKEN]; in launchOptions function of appDelegate.m.

However, when i add this line it shows error : use of undeclared identifier 'MIXPANEL_TOKEN'.
and if I remove [Mixpanel sharedInstanceWithToken:MIXPANEL_TOKEN]; and the #import "Mixpanel.h" from appDelegate.m , the build succeeds.
What should I do ?

Export is undefined

Hello!

I'm having an issue with the exports, I did :

const Mixpanel = require('react-native-mixpanel');

console.info(Mixpanel); // undefined

Mixpanel.sharedInstanceWithToken(TOKEN); // cannot read property 'sharedInstanceWithToken' of undefined 

Using:

"react": "15.2.1",
"react-native": "0.31.0",
"react-native-mixpanel": "0.0.10"

Even though I linked the library using react-native link react-native-mixpanel
which was linked successfully.

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.