Windows 8 C# integration

Integrate your Windows 8 C# app with Localytics.

  1. In your Localytics Dashboard, create a new application and copy the application key.
  2. Download the Windows 8 C# client class, which is distributed as source code.
    Please contact support if you'd prefer a binary.
  3. Add the class to your project.
  4. Add the Localytics object to the Application class in App.xaml.cs.
    public LocalyticsSession appSession;
  5. In both Application_Launching and Application_Activated, create a new instance of Localytics. Then, open and upload it.
    Once a session is opened, subsequent calls to open are ignored, so this won't result in multiple sessions.
    appSession = new LocalyticsSession("app key");
    appSession.Open();
    appSession.Upload();
  6. In both Application_Closing and Application_Deactivated, close the application.
    You can’t upload here.
    appSession.Close();
  7. If needed, access the session object from other pages.
    ((App)Application.Current).appSession.tagEvent("Event Name");
Congratulations! You're integrated. Check out the data in your Dashboard or get even more insights when you start tagging events. Don't forget to test your app. Run it in an emulator, or on a real device if possible.