Mobile SDKs: Integrate Bazaarvoice into your native Android and iOS apps.
User Authentication Token
The Bazaarvoice Mobile SDKs provide access to most of the core products Bazaarvoice offers. To learn more, go to the Mobile SDK documentation home page.
Contents
This page explains how developers can authenticate authors with the Bazaarvoice Mobile SDK by submitting a user ID along with the consumer generated content.
Introduction
The Product Recommendations module of the Bazaarvoice Mobile SDKs support adding an authenticated user for shopper profile matching.
After a user is authenticated inside your user login workflow, use BVSDKManager#setUserWithAuthString()
to set up the user authentication token.
Adding user information
The user auth string is an encrypted query string, such as date=20070527&userid=ID12345
. This string is then encrypted/signed appropriately for security. Add information such as identity, demographics in this query string, for example:
date=20070527&userid=ID12345&facebookId=abc123&age=28&gender=female
Allowed keys such as userid, gender, and age are defined in BVAuthenticatedUser.h
. This information can then be safely passed, as shown in the following example auth string.
Refer to the Client-Mastered Authentication tutorial for detailed instructions on how to create the encrypted query string.
Setting the auth string
The example below demonstrates how to set the encrypted user auth string using the BVSDKManager
:
BVSDKManager.shared().setUserWithAuthString("0ce436b29697d6bc74f30f724b9b0bb6646174653d31323334267573657269643d5265636f6d6d656e646174696f6e7353646b54657374")
[[BVSDKManager sharedManager] setUserWithAuthString:@"0ce436b29697d6bc74f30f724b9b0bb6646174653d31323334267573657269643d5265636f6d6d656e646174696f6e7353646b54657374"];
After setAuthenticatedUser
has been called from the BVSDKManager
, Bazaarvoice will begin matching data to this user's profile. The process runs nearly in real-time, but is not instant. The Mobile SDK will poll to update the user profile and should reflect the user's interests within seconds.