Parse Arduino Yun SDK
1
Parse Arduino Yun SDK
|
Class responsible for Parse connection. More...
#include <ParseClient.h>
Public Member Functions | |
ParseClient () | |
Constructor of ParseClient object. | |
void | begin (const char *applicationId, const char *clientKey) |
Initialize the Parse client and user session. More... | |
void | setInstallationId (const char *installationId) |
Set the installation object id for this client. More... | |
const char * | getInstallationId () |
Return the client installation id. More... | |
void | setSessionToken (const char *sessionToken) |
Set the session token for the Parse client. More... | |
void | clearSessionToken () |
Clear the session token. More... | |
const char * | getSessionToken () |
Return the client session token. More... | |
ParseResponse | sendRequest (const char *httpVerb, const char *httpPath, const char *requestBody, const char *urlParams) |
Directly call REST API in Parse. More... | |
ParseResponse | sendRequest (const String &httpVerb, const String &httpPath, const String &requestBody, const String &urlParams) |
Directly call REST API in Parse. More... | |
bool | startPushService () |
Start the push notifications service. More... | |
void | stopPushService () |
Stop the push notifications service. More... | |
bool | pushAvailable () |
Check if there is any new push message. More... | |
ParsePush | nextPush () |
Get next push message. More... | |
void | end () |
Release resource. | |
Friends | |
class | ParseResponse |
class | ParsePush |
Class responsible for Parse connection.
ParseClient::begin | ( | const char * | applicationId, |
const char * | clientKey | ||
) |
Initialize the Parse client and user session.
This method only initializes the Parse client, used for subsequent API requests. It does not start the push service, and does not create or load the installation object for the client.
applicationId | The application id for the Parse application. (required) |
clientKey | The client API key for the Parse application. (required) |
void ParseClient::clearSessionToken | ( | ) |
Clear the session token.
Same as setSessionToken(NULL);
const char * ParseClient::getInstallationId | ( | ) |
Return the client installation id.
Return the installation id for the client. If called before the installation id for the client was set, this method will NOT create a new installation object. The typical usage scenario is:
const char * ParseClient::getSessionToken | ( | ) |
Return the client session token.
Return the session token for the client, or NULL if there isn't one.
ParsePush ParseClient::nextPush | ( | ) |
Get next push message.
NOTE: use only when pushAvailable() is TRUE
bool ParseClient::pushAvailable | ( | ) |
Check if there is any new push message.
use only after startPushService()
ParseResponse ParseClient::sendRequest | ( | const char * | httpVerb, |
const char * | httpPath, | ||
const char * | requestBody, | ||
const char * | urlParams | ||
) |
Directly call REST API in Parse.
httpVerb | - GET/DELETE/PUT/POST |
httpPath | - the endpoint of REST API e.g. /1/installations |
requestBody | - http request body in json format, leave it as "" for DELTE/GET requests |
urlParams | - leave it as "" unless to perform a Parse query, use it to specify query condition e.g. where={"KEY1"":VALUE1}&limit=10&keys=KEY1,KEY2 |
ParseResponse ParseClient::sendRequest | ( | const String & | httpVerb, |
const String & | httpPath, | ||
const String & | requestBody, | ||
const String & | urlParams | ||
) |
Directly call REST API in Parse.
httpVerb | - GET/DELETE/PUT/POST |
httpPath | - the endpoint of REST API e.g. /1/installations |
requestBody | - http request body in json format, leave it as "" for DELTE/GET requests |
urlParams | - leave it as "" unless to perform a Parse query, use it to specify query condition e.g. where={"KEY1"":VALUE1}&limit=10&keys=KEY1,KEY2 |
void ParseClient::setInstallationId | ( | const char * | installationId | ) |
Set the installation object id for this client.
Set the installation object id for this client. If this is not called before making an API request or starting push service, the SDK will create a new installation object for the client.
installationId | The installation id to be used by the client. |
void ParseClient::setSessionToken | ( | const char * | sessionToken | ) |
Set the session token for the Parse client.
sessionToken | The new session token. All subsequent API calls will use this token for authentication and authorization. If this is NULL, the client will be unauthenticated. |
int ParseClient::startPushService | ( | ) |
Start the push notifications service.
This method will start the push notification service and will listen for incoming push notifications. If the push service is already started, this will do nothing. To actually process incoming push notifications, it is still necessary to repeatedly call
void ParseClient::stopPushService | ( | ) |
Stop the push notifications service.
This method will stop the push notification service. If the push service is not started, this will do nothing.