Skip to main content

Add Class

Identify views and manage privacy

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

Call FS.addClass to add a class name, and FS.addClasses to add multiple class names for a mobile view. Read more about Fullstory for Mobile Apps Privacy Rules.

Pre-Configured Privacy Classes

Several pre-configured privacy classes are provided to manage privacy programmatically.

  • FSViewClassMask
  • FSViewClassMaskWithoutConsent
  • FSViewClassUnmask
  • FSViewClassUnmaskWithConsent
  • FSViewClassExclude
  • FSViewClassExcludeWithoutConsent

The behavior of the *Consent classes depends on FS.consent.

Convenience Methods

Several convenience methods are also provided to simplify adding the pre-configured classes to views. These methods are available in Fullstory for Mobile Apps version 1.22 and newer.

addClass invocationEquivalent convenience method
[FS addClass:view className:FSViewClassMask][FS mask:view]
[FS addClass:view className:FSViewClassMaskWithoutConsent][FS maskWithoutConsent:view]
[FS addClass:view className:FSViewClassUnmask][FS unmask:view]
[FS addClass:view className:FSViewClassUnmaskWithConsent][FS unmaskWithConsent:view]
[FS addClass:view className:FSViewClassExclude][FS exclude:view]
[FS addClass:view className:FSViewClassExcludeWithoutConsent][FS excludeWithoutConsent:view]
[view fsAddClass:FSViewClassMask][view fsMask]
[view fsAddClass:FSViewClassMaskWithoutConsent][view fsMaskWithoutConsent]
[view fsAddClass:FSViewClassUnmask][view fsUnmask]
[view fsAddClass:FSViewClassUnmaskWithConsent][view fsUnmaskWithConsent]
[view fsAddClass:FSViewClassExclude][view fsExclude]
[view fsAddClass:FSViewClassExcludeWithoutConsent][view fsExcludeWithoutConsent]

Additional Information

[FS addClass:(nonnull UIView *) className:(nonnull NSString *)]
[view fsAddClass:(nonnull NSString *)]
// add multiple classes
[FS addClasses:(nonnull UIView *) classNames:(nonnull NSArray<NSString *> *)]
[view fsAddClasses:(nonnull NSArray<NSString *> *)]

Example Invocation

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

// .m file
- (void)viewDidLoad {
[super viewDidLoad];
[FS addClass:self.cartButton className:@"fs-unmask"];

// or add multiple classes
[FS addClasses:self.cartButton classNames:@[@"fs-unmask",@"my-other-class"]];
}