Skip to content

Managed Code

UberSnip Developers edited this page Apr 12, 2016 · 2 revisions

Managed C++ Version

The managed code simplifies most commands to just 2-4 lines of code. Most HTTP, JSON, and KeenIO processing is done for you.

Classes

Class Interface

KEENIO_AUTH

The Auth class stores authentication data.

//Master Key
property Platform::String^ MasterKey 
KEENIO_PROJECT
//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()
KEENIO_EVENT

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
KEENIO_GENERIC_PROPERTY

Property KeyPair. PropertyName, PropertyValue

JSON EQUIVALENT

{"app_name":"SocialMusicApp"}

//PROPERTY NAME
property Platform::String^ PropertyName 

//PROPERT VALUE
property Platform::String^ PropertyValue 

Example Usage

Load a project, it's collections, and their properties

KeenIOAPI::KEENIO_PROJECT^ keen_project = ref new KeenIOAPI::KEENIO_PROJECT();
keen_project->ID = "";
keen_project->MasterKey = "";
keen_project->LoadProject();

Send/Receive an event to/from the project

//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.

Clone this wiki locally