Windows Phone 7 integration

Integrate your Windows Phone 7 app with Localytics.

  1. In your Localytics Dashboard, create a new application and copy the application key.
  2. Download the Windows Phone 7 client class, which is distributed as source code.
  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. Add the identify device capability to the WMManifest file by adding this line of code.
    <Capability Name="ID_CAP_IDENTITY_DEVICE"/>
  8. 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.