I'd like to use mixpanel to track user events on Android and iOS but our mobile app is coded in Xamarin Forms. Is it possible to accomplish this?
We've been hard at work — check out our latest product updates.
@EZHIS Unfortunately, since we currently do not support Xamarin and it is out of our scope, you would need to consult with your developer team. Please let me know if you would like for me to log a product gap on your behalf for our Design and Developer Team to consider creating a direct SDK and providing support for it - glad to submit it on your behalf!
To get the not so great news out of the way, we do not have a direct Xamarin SDK; having said that. We certainly have customers who use Mixpanel with Xamarin. From researching their stories online, we have been able to gather the following regarding how these implementations work.
iOS: Binding iOS with Xamarin works well because you can use the native Mixpanel library. This means if you can compile the iOS Mixpanel code without encountering any fatal errors for usage in Xamarin. You can find some further information regarding how this was done by other users and some Github links with pre-configured implementations here.
Android: I did some research and found some articles (like the one http://forums.xamarin.com/discussion/16945/need-help-with-mixpanel-binding-errors-and-warnings) which show that some users have encountered some frustrations getting our native Android library to work with Xamarin. This is because of the display code within our native Android library which is used to display notifications such as in-app messages and in-app surveys. Due to the way we utilize the native Android API to display these notifications, you can only statically compile this library into a .aar and not a .jar file.
One way you could accomplish this is through our native Java library-- it's pretty bare bones and will only allow you track, meaning it will not allow you to use notifications. However, it looks like you can use this library to compile a .jar file which can be included within your Xamarin project.
One key thing you should consider in this implementation is that the Java library is so bare bones that do not support threading -- you will have to utilize your own thread management in order to use this library.