0

https://github.com/AppsFlyerSDK/XamariniOSBinding

Is anyone able to get this repo running?

I am hitting an null reference exception on startup because the tracker object is null - although this is bound as a static in the API Definition

// +(AppsFlyerTracker *)sharedTracker;
        [Static, Export ("sharedTracker")]
        AppsFlyerTracker SharedTracker ();
Greg
  • 181
  • 3
  • 11

2 Answers2

1

Make sure you've added a reference to AppsFlyerXamarinBinding.dll in your project's references, under .Net Assembly. The dll file can be found in the project's Bin/Debug folder (you'll have to build the binding project first in order to generate an updated dll file).

Also, add "using AppsFlyerXamarinBinding" in your delegate.

  • The references are definitely setup correctly in the above repo. The issue is that there is a null reference exception. The project would not build if there were a missing reference. – Greg Feb 06 '17 at 12:39
1

I was having the exact same issue and I found out what the problem is. I was testing this using the simulator.

The AppsFlyer SDK returns null for the AppsFlyerTracker.SharedTracker() method if the app is running on the simulator. Make sure that you run the app on a real device, and that you check for a null before calling methods on SharedTracker() otherwise you'll get a NullPointerException from Xamarin.