Skip to content

Claim Promo Code

A user can claim each Promo Code only once. If Promo Code was successfully claimed, you will receive successful callback with all its data. Also you can get the Promo Code info without claiming, if you have only a code. Callback returns an error in case when Promo Code:

  • had been already claimed by current user;
  • is disabled on the Dashboard;
  • is not yet active;
  • is expired;
  • has reached its max claim count.

To claim Promo Code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
String code = ... ; // Promo code to claim
GetSocial.claimPromoCode(code, new Callback<PromoCode>() {

    @Override
    public void onSuccess(final PromoCode result) {
        Log.d("Promo Code successfully claimed");
        // Reward user based on promo code info
    }

    @Override
    public void onFailure(GetSocialException exception) {
        Log.d("Failed to claim Promo Code, error: " + exception.getMessage());
    }
});
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
val code: String = ... // Promo code to claim
GetSocial.claimPromoCode(code, object : Callback<PromoCode> {
    override fun onSuccess(promoCode: PromoCode) {
        println("Promo Code successfully claimed")
        // Reward user based on promo code info
    }

    override fun onFailure(exception: GetSocialException) {
        println("Failed to claim Promo Code, error: ${exception.message}")
    }
})
1
2
3
4
5
6
7
8
9
NSString *code = ... ; // Promo code to claim
[GetSocial claimPromoCode:code
    success:^(GetSocialPromoCode *_Nonnull promoCode) {
        NSLog(@"Promo Code successfully claimed");
        // Reward user based on promo code info
    }
    failure:^(NSError *_Nonnull error) {
        NSLog(@"Failed to claim Promo Code, error: %@", error);
    }];
1
2
3
4
5
6
7
let code: String = ... // Promo code to claim
GetSocial.claimPromoCode(code, success: { promoCode in
    print("Promo Code successfully claimed")
    // Reward user based on promo code info
}) { error in
    print("Failed to claim Promo Code, error: \(error)")
}
1
2
3
4
5
6
7
8
9
string code = ... ; // Promo code to claim
GetSocial.ClaimPromoCode(code, promoCode =>
{
    Debug.Log("Promo Code claimed successfully");
    // Reward user based on promo code info
}, error =>
{
    Debug.Log("Failed to claim Promo Code, error: " + error);
});

Get Promo Code info

You may want to show some Promo Code data to user before claiming it, you can load it with next code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
String code = ... ; // Promo code
GetSocial.getPromoCode(code, new Callback<PromoCode>() {

    @Override
    public void onSuccess(final PromoCode promoCode) {
        Log.d("Promo Code: " + promoCode);
    }

    @Override
    public void onFailure(GetSocialException exception) {
        Log.d("Failed to get Promo Code, error: " + exception.getMessage());
    }
});
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
val code: String = ... // Promo code
GetSocial.getPromoCode(code, object : Callback<PromoCode> {
    override fun onSuccess(promoCode: PromoCode) {
        println("Promo Code: ${promoCode}")
    }

    override fun onFailure(exception: GetSocialException) {
        println("Failed to get Promo Code, error: ${exception.message}")
    }
})
1
2
3
4
5
6
7
8
NSString *code = ... ; // Promo code
[GetSocial getPromoCode:code
    success:^(GetSocialPromoCode *_Nonnull promoCode) {
        NSLog(@"Promo Code: %@", promoCode);
    }
    failure:^(NSError *_Nonnull error) {
        NSLog(@"Failed to get Promo Code, error: %@", error);
    }];
1
2
3
4
5
6
let code: String = ... // Promo code
GetSocial.getPromoCode(code, success: { promoCode in
    print("Promo Code: \(promoCode)")
}) { error in
    print("Failed to get Promo Code, error: \(error)")
}
1
2
3
4
5
6
7
8
string code = ... ; // Promo code
GetSocial.GetPromoCode(code, promoCode =>
{
    Debug.Log("Promo Code: " + promoCode);
}, error =>
{
    Debug.Log("Failed to get Promo Code, error: " + error);
});

Give us your feedback! Was this article helpful?

😀 🙁