TMBDiscoverParams
@interface TMBDiscoverParams : NSObject <TMBObjectEncodable>
An object representing parameters used to retrieve discoveries. Not all parameters are needed for all requests. - see: https://tamber.com/docs/api/#discover
-
The simplest way to get
TMBDiscoverParams
for user recommendations – only set the number of recommended items (TMBDiscovery
objects) you want to return.Declaration
Objective-C
+ (nullable instancetype)discoverRecommended:(nullable NSNumber *)number;
Swift
class func discoverRecommended(_ number: NSNumber?) -> Self?
Parameters
number
Number of recommendations to return.
-
Get
TMBDiscoverParams
for user recommendations with given number of recommended items (TMBDiscovery
objects) you want to return, andgetProperties
set to given value (set totrue
to include item properties in returnedTMBDiscovery
objects).Declaration
Objective-C
+ (nullable instancetype)discoverRecommended:(nullable NSNumber *)number getProperties:(BOOL)getProperties;
Swift
class func discoverRecommended(_ number: NSNumber?, getProperties: Bool) -> Self?
Parameters
number
Number of recommendations to return.
getProperties
Include items’ properties and tags in the discovery objects.
-
Expanded discover params for recommendations.
Declaration
Objective-C
+ (nullable instancetype)discoverRecommended:(nullable NSNumber *)number excludeItems:(nullable NSArray *)excludeItems variability:(nullable NSNumber *)variability filter:(nullable NSDictionary *)filter getProperties:(BOOL)getProperties continuation:(BOOL)continuation noCreate:(nullable NSString *)noCreate;
Swift
class func discoverRecommended(_ number: NSNumber?, excludeItems: [Any]?, variability: NSNumber?, filter: [AnyHashable : Any]?, getProperties: Bool, continuation: Bool, noCreate: String?) -> Self?
Parameters
number
Number of recommendations to return. Maximum of 200.
excludeItems
List of item ids to exclude from results. Useful for hiding items that are already being displayed to the user.
variability
Represents the degree of variability applied to the results. variability helps make results more dynamic, and is intelligently weighted to prioritize higher-scoring results (i.e. it does not just shuffle the results). Defaults to 0 if not supplied.
filter
The filter to apply on the discoveries. See https://tamber.com/docs/api/#filtering and our filtering guide at https://tamber.com/docs/guides/filtering.html for reference.
getProperties
Include items’ properties and tags in the discovery objects.
continuation
Auto-continue from last discover-next or discover-recommended request for the given user. Allows you to ‘show more’ or implement infinite scrolling.
noCreate
Disables automatic creation of novel users and/or items. Set to
user
to disable user creation,item
to disable item creation, oruser,item
to disable both user and item creation. -
The simplest way to get
TMBDiscoverParams
for up-next for a given item page. IfTMBClient
userId has been set, the results will be tuned for the user.Declaration
Objective-C
+ (nullable instancetype)discoverNext:(nullable NSString *)item number:(nullable NSNumber *)number;
Swift
class func discoverNext(_ item: String?, number: NSNumber?) -> Self?
Parameters
item
Item’s unique identifier.
number
Number of recommendations to return.
-
The simplest way to get
TMBDiscoverParams
for a given item. IfTMBClient
userId has been set, the results will be tuned for the user.Declaration
Objective-C
+ (nullable instancetype)discoverNext:(nullable NSString *)item number:(nullable NSNumber *)number getProperties:(BOOL)getProperties;
Swift
class func discoverNext(_ item: String?, number: NSNumber?, getProperties: Bool) -> Self?
Parameters
item
Item’s unique identifier.
number
Number of recommendations to return.
getProperties
Include items’ properties and tags in the discovery objects.
-
Expanded discover params for up-next suggestions.
Declaration
Objective-C
+ (nullable instancetype)discoverNext:(nullable NSString *)item number:(nullable NSNumber *)number excludeItems:(nullable NSArray *)excludeItems variability:(nullable NSNumber *)variability filter:(nullable NSDictionary *)filter getProperties:(BOOL)getProperties noCreate:(nullable NSString *)noCreate;
Swift
class func discoverNext(_ item: String?, number: NSNumber?, excludeItems: [Any]?, variability: NSNumber?, filter: [AnyHashable : Any]?, getProperties: Bool, noCreate: String?) -> Self?
Parameters
item
Item’s unique identifier.
number
Number of recommendations to return. Maximum of 200.
excludeItems
List of item ids to exclude from results. Useful for hiding items that are already being displayed to the user.
variability
Represents the degree of variability applied to the results. variability helps make results more dynamic, and is intelligently weighted to prioritize higher-scoring results (i.e. it does not just shuffle the results). Defaults to 0 if not supplied.
filter
The filter to apply on the discoveries. See https://tamber.com/docs/api/#filtering and our filtering guide at https://tamber.com/docs/guides/filtering.html for reference.
getProperties
Include items’ properties and tags in the discovery objects.
noCreate
Disables automatic creation of novel users and/or items. Set to
user
to disable user creation,item
to disable item creation, oruser,item
to disable both user and item creation. -
DiscoverNext params for user recommendations.
Declaration
Objective-C
+ (nullable instancetype)discoverNextParamsWithUser:(nullable NSString *)user number:(nullable NSNumber *)number;
Swift
class func discoverNextParams(withUser user: String?, number: NSNumber?) -> Self?
Parameters
user
User’s unique identifier.
number
Number of recommendations to return.
-
DiscoverNext params for user-item recommendations.
Declaration
Objective-C
+ (nullable instancetype)discoverNextParamsWithUser:(nullable NSString *)user item:(nullable NSString *)item number:(nullable NSNumber *)number;
Swift
class func discoverNextParams(withUser user: String?, item: String?, number: NSNumber?) -> Self?
Parameters
user
User’s unique identifier.
number
Number of recommendations to return.
-
Initialize discover params for user recommendations.
Declaration
Objective-C
- (nullable instancetype)initWithUser:(nullable NSString *)user item:(nullable NSString *)item number:(nullable NSNumber *)number excludeItems:(nullable NSArray *)excludeItems variability:(nullable NSNumber *)variability filter:(nullable NSDictionary *)filter getProperties:(BOOL)getProperties continuation:(BOOL)continuation noCreate:(nullable NSString *)noCreate;
Swift
init?(user: String?, item: String?, number: NSNumber?, excludeItems: [Any]?, variability: NSNumber?, filter: [AnyHashable : Any]?, getProperties: Bool, continuation: Bool, noCreate: String?)
Parameters
user
User’s unique identifier. Used for discover-recommended and discover-recommended_similar.
item
Item’s unique identifier. Used for discover-similar and discover-recommended_similar.
number
Number of recommendations to return. Maximum of 200.
excludeItems
List of item ids to exclude from results. Useful for hiding items that are already being displayed to the user.
variability
Represents the degree of variability applied to the results. Variability helps make results more dynamic, and is intelligently weighted to prioritize higher-scoring results (i.e. it does not just shuffle the results). Defaults to 0 if not supplied.
filter
The filter to apply on the discoveries. See https://tamber.com/docs/api/#filtering and our filtering guide at https://tamber.com/docs/guides/filtering.html for reference.
getProperties
Include items’ properties and tags in the discovery objects.
noCreate
Disables automatic creation of novel users and/or items. Set to
user
to disable user creation,item
to disable item creation, oruser,item
to disable both user and item creation. -
List of item ids to exclude from results. Useful for hiding items that are already being displayed to the user.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSArray *excludeItems;
Swift
var excludeItems: [Any]? { get }
-
Represents the degree of variability applied to the results. Variability helps make results more dynamic, and is intelligently weighted to prioritize higher-scoring results (i.e. it does not just shuffle the results). Defaults to 0 if not supplied.
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *variability;
Swift
var variability: NSNumber? { get set }