Skip to main content

Set Attribute

Set virtual attributes for a mobile view

To simplify management of privacy for mobile applications and to enable individuals who have worked with Fullstory for the web to have a more familiar experience, Fullstory for Mobile Apps instrumentation creates virtual HTML-like elements for native Android or iOS views for the purposes of privacy management, funnel definition, and searches. read more here

The FS.setAttribute() API method is available to create virtual attributes of any kind on native views, read more here.

Call FS.setAttribute to set a custom attribute as key-value pairs for a mobile view.

Additional Information

[FS setAttribute:(nonnull UIView *) attributeName:(nonnull NSString *) attributeValue:(nonnull NSString *)]
[view fsSetAttributeValue:(nonnull NSString *) forAttribute:(nonnull NSString *)]

Example Invocation

// .h file
@property (nonatomic, retain) IBOutlet UIButton *cartButton;

// .m file
- (void)viewDidLoad {
[super viewDidLoad];
[FS setAttribute:self.cartButton attributeName:@"theme-color" attributeValue:@"dark"];
}