Appearance
User Badges
The User Badges provides app developers with comprehensive badge data to build custom achievement systems in their iOS applications. Upshot.ai provides a user-specific list of all earned and yet-to-be-earned badges data. Using this data, you can implement a comprehensive Badges section in your application to showcase user achievements and motivate continued engagement.
Overview
The User Badges API provides developers with:
- Earned Badges Data - Complete collection of badges the user has successfully earned
- Available Badges Data - Badges that are available but not yet earned (with progress tracking)
How to Fetch User Badges
Request user badges data:
objective-c
@import Upshot;
// Fetch user badges
[[BrandKinesis sharedInstance] getUserBadges];
swift
import Upshot
// Fetch user badges
BrandKinesis.sharedInstance(). getUserBadges()
Response Structure
The user badges response contains two main arrays:
Active List (Earned Badges)
Badges that the user has already earned:
json
{
"active_list": [
{
"achivedTime": 1493892162263,
"activityName": "Badge1",
"badge": "590c28142b2f15cf1b7b23d3590c39c12b2f15a7517b23c9",
"badgeDesc": "YOU HAVE WON A FREE PIZZA FROM US :)",
"badgeImage": "{128, 128}",
"campaignName": "Campaign1",
"status": 1,
"tags": ["Welcome"],
"title": "CONGRATULATIONS!!!"
}
]
}
Inactive List (Available Badges)
Badges that are available but not yet earned:
json
{
"inactive_list": [
{
"activityName": "Badge2",
"badge": "590c397c2b2f15a9517b23c6590c3e5a2b2f152b5a7b23cc",
"badgeDesc": "You have received two free movie tickets! To accept them, please click the okay button.",
"badgeImage": "{128, 128}",
"campaignName": "Campaign2",
"status": 2,
"tags": ["Welcome"],
"title": "Dear Customer!!!"
}
]
}
Response Field Descriptions
Field | Description |
---|---|
active_list | Array of badges the user has earned |
inactive_list | Array of badges available but not yet earned |
achivedTime | Timestamp when badge was earned (only in active_list) |
activityName | Internal name of the badge activity |
badge | Unique badge identifier |
badgeDesc | Description text for the badge |
badgeImage | Badge image dimensions/reference |
campaignName | Campaign this badge belongs to |
status | Badge status (1 = earned, 2 = available) |
tags | Array of tags associated with the badge |
title | Display title for the badge |