Code Monkey home page Code Monkey logo

xam.plugin.mixpanel.ios's Introduction

Xam.Plugin.Mixpanel.iOS

Xamarin.iOS bindings for Mixpanel iOS v3.6.2.

Installation

Xam.Plugin.Mixpanel.iOS is available via NuGet. https://www.nuget.org/packages/Xam.Plugin.Mixpanel.iOS/

NuGet

Usage

Include Mixpanel

using Xam.Plugin.Mixpanel.iOS;

And then follow the docs provided at the Mixpanel Developer Documentation (https://developer.mixpanel.com/docs/ios)

Build

Visutal Studio for Mac

  1. Run FetchFramework.sh
    $ ./FetchFramework.sh
  2. Open Xam.Plugin.Mixpanel.iOS.sln
  3. Build and fetch your .dlls from the bin/ directory.

Building a .nupkg

  1. Run BuildNugetPackage.sh
    $ ./BuildNugetPackage.sh
  2. Fetch your Xam.Plugin.Mixpanel.iOS.x.y.z.nupkg and Xam.Plugin.Mixpanel.iOS.x.y.z.snupkg from the Binding directory.

Updating Mixpanel SDK

To update the Mixpanel SDK change the version within Binding/Cartfile to your desired SDK version and run the FetchFramework.sh script.

If there are API changes you will want to run SharpieBind.sh instead and examine code output in the newly generated NewBinding_ApiDefinition.cs and NewBinding_StructsAndEnums.cs files. Desired API changes should be then modified in the ApiDefinition.cs and StructsAndEnums.cs files. NOTE: The NewBinding_ files are not build ready and need to be modified manually.

Requirements

TODO

  • Verify the Verify statements work as expected.
  • Figure out how to handle MixpanelTypeCategory correctly.

Pull requests welcome!

xam.plugin.mixpanel.ios's People

Contributors

beeradmoore avatar luoyean avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

luoyean xleon

xam.plugin.mixpanel.ios's Issues

Crash reporting

Crash reporting

Maybe I have should turn to Mixpanel forum as well but I start here.
Im wondering how Mixpanel's crash reporting works. Im using AppCenter where many crashes are not shown but are reported by Mixpanel.

How are you handing Mixpanel crash reporting? And is there is some way I can use the bindings to throw exception so they end up in AppCenter?

Converting to NSDictionary

Converting to NSDictionary

Here is my current implementation

public static NSDictionary ToNSDictionary(this Dictionary<string, object> dict)
{
    var nsDict = NSDictionary.FromObjectsAndKeys(dict.Values?.ToArray()
                                               , dict.Keys.ToArray());
    return nsDict;
}

However I get into trouble when having a value in Dictionary of List<string> and therefore I am unable send lists as a event property to Mixpanel.
Do someone have a nice implementation that supports providing list as value to NSDictionary, so it can be sent to Mixpanel?

[Help wanted] Update to 3.6.3 and beyond (+xcframework)

I've hit a bit of a wall with v3.6.3 (also v3.6.4 and later).

This was about the time Xcode 11 came out and the code is now distributed as a .xcframework rather than a .framework (or something along these lines). This required some updates in carthage to get functional but it now appears it is.

I have put my work in progress code on the bugfix/xcframework repo. The main changes are updating build scripts to use Mixpanel v3.6.3 and FetchFrameworks.sh now calls carthage like this:

carthage update --use-xcframeworks --platform ios

The Mixpanel.xcframework appears to be copied into the build and appears to be in the nuget (based on the fact its filesize is now 10mb). But when you try run this in the example project you will get the following errors:

~/git/beeradmoore/Xam.Plugin.Mixpanel.iOS/Example/Main.cs(12,13,12,58): warning CS0618: 'UIApplication.Main(string[]?, string?, string?)' is obsolete: 'Use the overload with 'Type' instead of 'String' parameters for type safety.'
MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'System.Net.Security' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : error MT5214: Native linking failed, undefined symbol: _MPNotificationTypeMini. This symbol was referenced by the managed member Xam.Plugin.Mixpanel.iOS.Constants.MPNotificationTypeMini. Please verify that all the necessary frameworks have been referenced and native libraries linked.
MTOUCH : error MT5214: Native linking failed, undefined symbol: _MPNotificationTypeTakeover. This symbol was referenced by the managed member Xam.Plugin.Mixpanel.iOS.Constants.MPNotificationTypeTakeover. Please verify that all the necessary frameworks have been referenced and native libraries linked.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: MPTweak. The symbol '_OBJC_CLASS_$_MPTweak' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: MPTweakStore. The symbol '_OBJC_CLASS_$_MPTweakStore' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: Mixpanel. The symbol '_OBJC_CLASS_$_Mixpanel' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: MixpanelGroup. The symbol '_OBJC_CLASS_$_MixpanelGroup' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: MixpanelPeople. The symbol '_OBJC_CLASS_$_MixpanelPeople' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: _MPTweakBindObserver. The symbol '_OBJC_CLASS_$__MPTweakBindObserver' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5202: Native linking failed. Please review the build log.
clang : error : linker command failed with exit code 1 (use -v to see invocation)

There is also some unknowns about this that I am not sure of. If we use --platform ios then how do we build this for watchOS and tvOS? Can all these be bundled in the same nuget or do we now need a Xam.Plugin.Mixpanel.tvOS and Xam.Plugin.Mixpanel.watchOS as seperate bundles?

Compilation fails on Windows with VS 2019

First of all, thanks for this, that made it rather easy to get bindings for the latest MixPanel framework. But I do have a rather weird issue: My project compiles on Mac with VS 2019, and it compiles on Windows with VS 2017. But it fails on Windows with VS 2019 with the following:

The referenced component 'Mixpanel.framework' could not be found.

There's also this warning, which may or may not be relevant..

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets" cannot be imported again. It was already imported at "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.ObjCBinding.Common.After.props (19,2)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Code\CSBG_CommunityOfSpecialistsMobileApp\src\App\Bindings\Mixpanel.iOS\Mixpanel.iOS.csproj]	

Have you, by any chance, seen this error as well? It certainly does sound more like a VS/Xamarin bug though.

Not receiving any events at all from some geographical areas

First all, thank you for these bindings.

I am experiencing users in geographical areas outside US and Europe to not have their events received in Mixpanel. Among the number of app installers, only 40% of them send any events. All of these are American or European, none have been Asian.
I'ts a to big percentage that don't send events. I would find it hard to believe that such a big portion of people don't start an app they have installed?
Any tips on how I can dig into this further, and troubleshoot what could be the issue behind it?

The app is iOS only
It has had 48 downloads so far

I will also create a thread at Mixpanel

Threading and calling Xam.Plugin.Mixpanel.iOS

I wanted to ask to if there can be misbehaviour when threading. Do you know if all calls to Xam.Plugin.Mixpanel.iOS.Mixpanel should be preformed on the main thread - or does it now matter?
There is no problem that I have run into currently, in development. In production it can be hard to discover.

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.