Type Function Return value none Revision 2017.3060 Keywords ads, advertising, Pollfish, setUserDetails See also pollfish.init() pollfish.*
Sets user details. Providing these details may help improve revenue with offers targeted for the user.
pollfish.setUserDetails( options )
Table. Table containing option values — see the next section for details.
The options table includes parameters for specifying user details.
String. User's age. Valid values are "12" up to "70", or "other".
String. User's gender. Valid values include "male", "female", and "other".
String. User's age group. Valid values include:
"12_17""18_24""25_34""35_44""45_54""55_64""65_plus""other"String. User's Facebook ID.
String. User's Twitter ID.
Table. User's location. The location table includes the following parameters for specifying user location:
longitude — Optional number representing longitude.latitude — Optional number representing latitude.horizontalAccuracy — Optional number representing horizontal accuracy.Note that this table is only used for iOS. For Android you can get automatic location retrieval by setting the "android.permission.ACCESS_FINE_LOCATION" and "android.permission.ACCESS_COARSE_LOCATION" permissions.
Table. Table with
String. A unique ID to identify a user. This ID is also passed through
local pollfish = require( "plugin.pollfish" )
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
print( event.provider )
end
end
-- Initialize the Pollfish plugin
pollfish.init( adListener, { apiKey="YOUR_API_KEY" } )
-- Set user details
pollfish.setUserDetails( { gender="female", ageGroup="25_34" } )