Integrate your Windows Phone 7 app with Localytics.
-
In your Localytics
Dashboard, create a new
application and copy the application key.
-
Download the Windows
Phone 7 client class, which is distributed as source code.
-
Add the class to your project.
-
Add the Localytics object to
the Application class in App.xaml.cs.
public LocalyticsSession appSession;
-
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();
-
In both Application_Closing and
Application_Deactivated, close the application.
You can’t upload here.
appSession.close();
-
Add the identify device capability to the WMManifest file by adding this line
of code.
<Capability Name="ID_CAP_IDENTITY_DEVICE"/>
-
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.