houseninjadojo / capacitor-mixpanel Goto Github PK
View Code? Open in Web Editor NEWCapacitor plugin for Mixpanel
Home Page: https://www.npmjs.com/package/@houseninja/capacitor-mixpanel
Capacitor plugin for Mixpanel
Home Page: https://www.npmjs.com/package/@houseninja/capacitor-mixpanel
Hey everyone :)
I'm having some trouble when building the app in Xcode for iOS using Ionic and Capacitor.
This is my Podfile:
platform :ios, '13.0'
use_frameworks!
# workaround to avoid Xcode caching of Pods that requires
# Product -> Clean Build Folder after new Cordova plugins installed
# Requires CocoaPods 1.6 or newer
install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCommunityFirebaseAnalytics', :path => '../../node_modules/@capacitor-community/firebase-analytics'
pod 'CapacitorCommunityFirebaseCrashlytics', :path => '../../node_modules/@capacitor-community/firebase-crashlytics'
pod 'CapacitorCommunityKeepAwake', :path => '../../node_modules/@capacitor-community/keep-awake'
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser'
pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device'
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
pod 'HouseninjaCapacitorMixpanel', :path => '../../node_modules/@houseninja/capacitor-mixpanel'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
end
target 'uugot.it' do
capacitor_pods
# Add your Pods here
end
Any thoughts? I'm kind of new around here. If you need further information let me know and I'll be happy to share with you!
Thanks
Hi, I noticed that Mixpanel.track() won't send the event and sometimes crashes my Ionic 6 app if the properties object contains non-string values. So for example this works fine:
Mixpanel.track({
event: 'my event',
properties: {
test: '1' // string works fine
}
});
But this doesn't:
Mixpanel.track({
event: 'my event',
properties: {
test: 1 // number, boolean, or object won't work
}
});
Here's some info from my package.json. Let me know if you need any more info.
"dependencies": {
"@capacitor/app": "^1.0.2",
"@capacitor/core": "^3.1.2",
"@capacitor/ios": "^3.1.2",
"@houseninja/capacitor-mixpanel": "^0.0.12",
"@ionic/core": "^6.0.1",
"@ionic/vue": "^6.0.1",
"@ionic/vue-router": "^6.0.1",
"vue": "^3.2.26",
"vue-router": "^4.0.12"
},
Thanks for making and sharing this btw, I was super stoked to find it!
There was a breaking change in 4.0.0 of Mixpanel-swift
which breaks the plugin.
https://github.com/mixpanel/mixpanel-swift/releases
I am able to force version 3.5.1 but would be nice to specify and maybe make plugin compatible with 4.0
pod 'Mixpanel-swift', '~> 3.5'
Can you update the dependencies from Capacitor v4 to v5?
Also might be a good idea to set the plugin version to 5 to match the Capacitor version.
Hi, I'm trying to build for Android using Ionic 6 and getting this error from line 17 of src/main/java/co/houseninja/plugins/mixpanel/MixpanelPlugin.java:
Cannot resolve symbol 'CapConfig'
Here's the output from info info in case it helps:
Ionic:
Ionic CLI : 6.18.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 6.0.10
Capacitor:
Capacitor CLI : 3.4.2
@capacitor/android : 3.4.2
@capacitor/core : 3.4.2
@capacitor/ios : 3.4.2
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v16.1.0 (/usr/local/bin/node)
npm : 7.24.1
OS : macOS Big Sur
Thanks!
I'm getting build errors related to capacitor-mixpanel after updating Capacitor to version 4. Should package.json be updated to play nice with Capacitor 4?
Hi Everyone,
Seem to have gotten the plugin to work on iOS, but it is causing some runtime errors on the android side.
It is stating: Activity class {com.app.mobile/com.app.mobile.MainActivity} does not exist.
Has anyone had time to look into this yet to find out what the issue is?
(anonymised bundle ID)
07/16 11:58:47: Launching 'app' on Pixel 6 Pro API 33.
Install successfully finished in 75 ms.
$ adb shell am start -n "com.app.mobile/com.app.mobile.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while executing: am start -n "com.app.mobile/com.app.mobile.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.app.mobile/.MainActivity }
Error type 3
Error: Activity class {com.app.mobile/com.app.mobile.MainActivity} does not exist.
Error while Launching activity
Failed to launch an application on all devices
Hi everyone, the plugin does not work with Ionic 7, Angular 16 and Capacitor 5
Allow Mixpanel to be initialized at runtime instead of on app startup. This woudl allow more flexibility in getting the configuration from the environment or other sources.
The token, server URL, and other options may need to be passed to the initialize() method instead of being hardcoded in capacitor.conf.ts
.
There should be some information in the README about how to import and use the plugin in an Angular Ionic application for example. See for example: https://capacitorjs.com/docs/apis/device#example
e.g.
I keep getting the error "iOS extra argument 'serverURL' error" when trying to build for iOS, even using v1.0.0-beta.2.
The issue appears to be that installing the capacitor-mixpanel plugin and then building my Ionic project for iOS installs v3.1.5 of Mixpanel-swift as a dependency, instead of the current v4. I've tried reinstalling capacitor-mixpanel and cleaned the build folder in Xcode and still no luck. Any thoughts?
Here's part of the app's ios/App/Podfile.lock file for reference:
PODS:
- Capacitor (4.3.0):
- CapacitorCordova
...
- HouseninjaCapacitorMixpanel (1.0.0-beta.2):
- Capacitor
- Mixpanel-swift
- Mixpanel-swift (3.1.5):
- Mixpanel-swift/Complete (= 3.1.5)
- Mixpanel-swift/Complete (3.1.5)
Mixpanel's developer docs provide a guide on setting up your own proxy and sending traffic to it. In order to set up the client tho, you are required to set the exposed server's URL when loading the client.
See here: https://developer.mixpanel.com/docs/collection-via-a-proxy#full-example
Is it possible to set your own proxy with this plugin, if so how ๐ค
Hi!, first of all, thanks for this amazing plugin.
Do you have any plan for updating it to support Capacitor 5?
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.