Topic preferences
BatchProfile.editor { editor in
try? editor.setTopicPreferences(["technology", "finance"]) // Null to erase
// Alternatively, partially update them with:
try? editor.addToTopicPreferences(["investing"])
try? editor.removeFromTopicPreferences(["travel"])
// If you prefer to use BatchProfile.editor() with local variable instead of using a closure,
// remember to use editor.save() afterwards so that the changes are taken into account.
}// This requires to have a custom user ID registered by calling the `identify` method beforehand.
[BatchProfile editWithBlock:^(BatchProfileEditor * _Nonnull editor) {
NSError *error = nil;
[editor setTopicPreferences:@[@"technology", @"finance"] error:&error];
// Alternatively, partially update them with:
[editor addToTopicPreferences:@[@"investing"] error:&error];
[editor removeFromTopicPreferences:@[@"travel"] error:&error];
// If you prefer to use [BatchProfile editor] instead of `editWithBlock`,
// remember to use [editor save] afterwards so that the changes are taken into account.
}];Last updated

