Git Product home page Git Product logo

mixpanel-xamarin's Introduction

Mixpanel bindings for Xamarin

iOS v2.9.1 (armv7, arm64) Android 4.7

#Status iOS: working OK on device only. It seems it requires the ALT key not the Option key though.
Android: OK.

Usage

To connect to the webinterface, open the webinterface in a browser, then on the device press 4 fingers for 5 seconds, or in the simulator press the option (or alt?) key + click and hold both key and clic in the simulator for 5 seconds. The app's window should be rendered in the webinterface.

#Important On iOS: you need to have a non null Window property in your AppDelegate file. Otherwise Mixpanel throws an exception.

[Register("AppDelegate")]
public class AppDelegate : MvxApplicationDelegate
{
    UIWindow window;

    /// <summary>
    /// Required for MixPanel
    /// </summary>
    [Preserve]
    public override UIWindow Window { get { return window; }}

    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        //Setup main window
        window = new UIWindow(UIScreen.MainScreen.Bounds);

         ...

        window.MakeKeyAndVisible();

        return false;
    }

Build android:

Using VS in release mode

  1. Download latest .aar file for mixpanel

  2. Replace it in the Jars folder. Make sure build action is LibraryProjectZip.

  3. Build in release mode

Build iOS (new):

On a mac, install objective sharpie from https://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/objective_sharpie/

Open a command line in the mixpanel-xamarin folder. Make sure cocoapod is installed:

sudo gem install cocoapods

Find which sdk is installed on the mac:

sharpie xcode -sdks

Create a new binding project with the correct sdk identifier:

sharpie pod init iphoneos9.1 Mixpanel
(things happens)
sharpie pod bind iphoneos9.1 Mixpanel
(project is build, .a and .cs files are generated)

Rebuild in release mode the libMixpanel.a file with support for ios 8.0:

xcodebuild build -project Pods/Pods.xcodeproj -scheme Mixpanel -configuration release VALID_ARCHS='arm64 armv7' ARCHS='arm64 armv7' IPHONEOS_DEPLOYMENT_TARGET=8.0
(project is build, .a file is generated)

It generates two .cs files (ApiDefinitions.cs and StructsAndEnums.cs), and the .a file containing the target architectures. The following command displays the architectures contained in the .a file.

cd ~/Library/Caches/Xamarin
lipo -info build/Release-iphoneos/libMixpanel.a

Open the solution in Xamarin Studio Mac, override the existing libMixpanel.a with the new one, compare/override the content of the .cs files, then build in release mode. The output is the DLL in the project's Release folder.

Create the nuget

Compile in release mode both libs using the help above. Make sure the DLL from the release folder of Android and iOS are up to date.

Open pack.bat, and update the version number. Open Vapolia.Mixpanel.nuspec then add release notes for this version. Then on an elevated command prompt:

pack.bat

mixpanel-xamarin's People

Contributors

ninzine avatar softlion avatar

Watchers

Seth Hochberg avatar James Cloos avatar

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.