Skip to main content

promocode.core.PromoCode.Listener Interface

Receives the result of validating a promotional code. More...

Public Member Functions

void onValidateFailure (String jsonFailureResult)
 This is invoked asynchronously if the promo code is invalid or a network error occurred. More...
 
void onValidateSuccess (String jsonSuccessResult)
 This is invoked asynchronously when the promo code has been validated and a JSON payload is available. More...
 

Detailed Description

Receives the result of validating a promotional code. Is passed into the PromoCode.Validate method to receive either the payload associated with the promotional code, or a payload describing how the validation failed. The error payload includes the errorType which can be one of the following:
  • invalidPromo (The promotional code was null or empty)
  • notInit (The SDK wasn't finished initializing)
  • noConnection (There wasn't a connection before starting validation)
  • timeout (The validation timed out)
  • GP7011 (Access Denied)
  • GP7008 (Invalid Redmeption)
  • GP7004 (Non-Existent Promo Code)
  • GP3002 (Gametoken doesn't match any)
  • invHeaders (One or more validation headers is incorrect)
  • invSig (The validation response was edited)
  • misc (An unspecified problem occurred)

Member Function Documentation

◆ onValidateFailure()

void com.bigfishgames.bfglib.promocode.core.PromoCode.Listener.onValidateFailure (String jsonFailureResult)
This is invoked asynchronously if the promo code is invalid or a network error occurred.
Parameters
jsonFailureResultJSON representing what kind of error occurred. It will be in the format
{"errorCode": "abbreviated", "errorMessage": "Description here"}

◆ onValidateSuccess()

void com.bigfishgames.bfglib.promocode.core.PromoCode.Listener.onValidateSuccess (String jsonSuccessResult)
This is invoked asynchronously when the promo code has been validated and a JSON payload is available.
Parameters
jsonSuccessResultThe JSON payload from the service that the game should know how to parse since it was made by one of the game's producers.