C# Class Carrot, carrot-unity

Inheritance: Vegetable
Show file Open project: GoCarrotArchive/carrot-unity Class Usage Examples

Public Properties

Property Type Description
SDKVersion string

Public Methods

Method Description
authStatusString ( AuthStatus authStatus ) : string

Return the string value of an AuthStatus value.

popupFeedPost ( string objectInstanceId, object>.Dictionary objectProperties = null, CarrotRequestResponse callback = null ) : void
postAchievement ( string achievementId, CarrotRequestResponse callback = null ) : void

Post an achievement to Carrot.

postAction ( string actionId, IDictionary actionProperties, ViralObject viralObject, CarrotRequestResponse callback = null ) : void

Sends an Open Graph action which will create a new object.

postAction ( string actionId, IDictionary actionProperties, string objectInstanceId, CarrotRequestResponse callback = null ) : void

Sends an Open Graph action which will use an existing object.

postAction ( string actionId, ViralObject viralObject, CarrotRequestResponse callback = null ) : void

Sends an Open Graph action which will create a new object.

postAction ( string actionId, string objectInstanceId, CarrotRequestResponse callback = null ) : void

Sends an Open Graph action which will use an existing object.

postHighScore ( uint score, CarrotRequestResponse callback = null ) : void

Post a high score to Carrot.

postPremiumCurrencyPurchase ( float amount, string currency, CarrotRequestResponse callback = null ) : void

Inform Carrot about a purchase of premium currency for metrics tracking.

signParams ( string hostname, string endpoint, string secret, object>.Dictionary urlParams ) : string
validateUser ( string accessTokenOrFacebookId ) : void

Validate a Facebook user to allow posting of Carrot events.

This method will trigger notification of authentication status using the AuthenticationStatusChanged event.

Protected Methods

Method Description
feedPostCallbackHandler ( object>.Dictionary reply ) : void
javascriptSDKFeedPostCallback ( string message ) : void
unitySDKFeedPostCallback ( object fbResult ) : void

Private Methods

Method Description
Carrot ( ) : System
CarrotCertValidator ( object sender, X509Certificate, certificate, X509Chain, chain, SslPolicyErrors, sslPolicyErrors ) : bool
OnApplicationPause ( bool isPaused ) : void
OnApplicationQuit ( ) : void
Start ( ) : void
addCommonPayloadFields ( UnityEngine payload, object>.Dictionary urlParams ) : void
assignUnityObject2Instance ( string message ) : void
cachedRequestCoroutine ( ServiceType, serviceType, string endpoint, object>.Dictionary parameters, CarrotRequestResponse callback = null ) : IEnumerator
cachedRequestHandler ( CarrotCache, cachedRequest, CarrotRequestResponse callback ) : CarrotRequestResponse
hostForServiceType ( ServiceType, type ) : string
postAction ( string actionId, IDictionary actionProperties, string objectId, IDictionary objectProperties, string objectInstanceId = null, CarrotRequestResponse callback = null ) : void
postAction ( string actionId, string objectId, IDictionary objectProperties, string objectInstanceId = null, CarrotRequestResponse callback = null ) : void
sendAppOpenedEvent ( ) : IEnumerator
sendInstallMetricIfNeeded ( ) : IEnumerator
servicesDiscoveryCoroutine ( ) : IEnumerator
signedRequestCoroutine ( Request, carrotRequest, CarrotRequestResponse callback = null ) : IEnumerator
validateUserCoroutine ( string accessTokenOrFacebookId ) : IEnumerator

Method Details

authStatusString() public static method

Return the string value of an AuthStatus value.
public static authStatusString ( AuthStatus authStatus ) : string
authStatus AuthStatus
return string

feedPostCallbackHandler() protected method

protected feedPostCallbackHandler ( object>.Dictionary reply ) : void
reply object>.Dictionary
return void

javascriptSDKFeedPostCallback() protected method

protected javascriptSDKFeedPostCallback ( string message ) : void
message string
return void

popupFeedPost() public method

public popupFeedPost ( string objectInstanceId, object>.Dictionary objectProperties = null, CarrotRequestResponse callback = null ) : void
objectInstanceId string
objectProperties object>.Dictionary
callback CarrotRequestResponse
return void

postAchievement() public method

Post an achievement to Carrot.
public postAchievement ( string achievementId, CarrotRequestResponse callback = null ) : void
achievementId string Carrot achievement id.
callback CarrotRequestResponse Optional which will be used to deliver the reply.
return void

postAction() public method

Sends an Open Graph action which will create a new object.
public postAction ( string actionId, IDictionary actionProperties, ViralObject viralObject, CarrotRequestResponse callback = null ) : void
actionId string Carrot action id.
actionProperties IDictionary Parameters to be submitted with the action.
viralObject ViralObject A describing the object to be created.
callback CarrotRequestResponse Optional which will be used to deliver the reply.
return void

postAction() public method

Sends an Open Graph action which will use an existing object.
public postAction ( string actionId, IDictionary actionProperties, string objectInstanceId, CarrotRequestResponse callback = null ) : void
actionId string Carrot action id.
actionProperties IDictionary Parameters to be submitted with the action.
objectInstanceId string Carrot object instance id.
callback CarrotRequestResponse Optional which will be used to deliver the reply.
return void

postAction() public method

Sends an Open Graph action which will create a new object.
public postAction ( string actionId, ViralObject viralObject, CarrotRequestResponse callback = null ) : void
actionId string Carrot action id.
viralObject ViralObject A describing the object to be created.
callback CarrotRequestResponse Optional which will be used to deliver the reply.
return void

postAction() public method

Sends an Open Graph action which will use an existing object.
public postAction ( string actionId, string objectInstanceId, CarrotRequestResponse callback = null ) : void
actionId string Carrot action id.
objectInstanceId string Carrot object instance id.
callback CarrotRequestResponse Optional which will be used to deliver the reply.
return void

postHighScore() public method

Post a high score to Carrot.
public postHighScore ( uint score, CarrotRequestResponse callback = null ) : void
score uint Score.
callback CarrotRequestResponse Optional which will be used to deliver the reply.
return void

postPremiumCurrencyPurchase() public method

Inform Carrot about a purchase of premium currency for metrics tracking.
public postPremiumCurrencyPurchase ( float amount, string currency, CarrotRequestResponse callback = null ) : void
amount float The amount of real money spent.
currency string The type of real money spent (eg. USD).
callback CarrotRequestResponse Optional which will be used to deliver the reply.
return void

signParams() public static method

public static signParams ( string hostname, string endpoint, string secret, object>.Dictionary urlParams ) : string
hostname string
endpoint string
secret string
urlParams object>.Dictionary
return string

unitySDKFeedPostCallback() protected method

protected unitySDKFeedPostCallback ( object fbResult ) : void
fbResult object
return void

validateUser() public method

Validate a Facebook user to allow posting of Carrot events.
This method will trigger notification of authentication status using the AuthenticationStatusChanged event.
public validateUser ( string accessTokenOrFacebookId ) : void
accessTokenOrFacebookId string Facebook user access token or Facebook User Id.
return void

Property Details

SDKVersion public static property

Carrot SDK version.
public static string SDKVersion
return string