Repository navigation
Managed Code
UberSnip Developers edited this page Apr 12, 2016
·
2 revisions
The managed code simplifies most commands to just 2-4 lines of code. Most HTTP, JSON, and KeenIO processing is done for you.
Class Interface
The Auth class stores authentication data.
//Master Key
property Platform::String^ MasterKey
//Events URL
property Platform::String^ EventsURL
//PROJECT ID
property Platform::String^ ID
//ORGANIZATION ID
property Platform::String^ OrganizationID
//PROJECT NAME
property Platform::String^ Name
//QUERIES URL
property Platform::String^ QueriesURL
//PARTNERS URL
property Platform::String^ PartnersURL
//PROJECT URL
property Platform::String^ URL
//MASTER KEY FOR AUTHENTICATION
property Platform::String^ MasterKey
//LIST OF COLLECTIONS
property Windows::UI::Xaml::Interop::IBindableObservableVector^ Events
//Send Data to KeenIO Project
void SendEvent(Platform::String^ collection, Platform::String^ event_name, Platform::String^ event_property)
//Load Project, it's collections, and their properties
void LoadProject()
Basically, a Collection
//AUTHENTICATION DATA
property KEENIO_AUTH^ Auth
//COLLECTION NAME
property Platform::String^ Name
//PROJECT OWNING COLLECTION
property Platform::String^ ProjectID
//COLLECTION URL
property Platform::String^ URL
//COLLECTION PROPERTIES
property Windows::UI::Xaml::Interop::IBindableObservableVector^ Properties
Property KeyPair. PropertyName, PropertyValue
JSON EQUIVALENT
{"app_name":"SocialMusicApp"}
//PROPERTY NAME
property Platform::String^ PropertyName
//PROPERT VALUE
property Platform::String^ PropertyValue
KeenIOAPI::KEENIO_PROJECT^ keen_project = ref new KeenIOAPI::KEENIO_PROJECT();
keen_project->ID = "";
keen_project->MasterKey = "";
keen_project->LoadProject();
//Sending an event to KeenIO
keen_project->SendEvent("COLLECTION_NAME", "EVENT_NAME", "EVENT_VALUE");
//Receive KeenIO API Request (JSON String)
keen_project->ReceiveData("api_url_with_parameters");
All variables are automatically set when LoadProject() is called from class KEENIO_PROJECT.