Manual Reference Source Test
import AdvertisementService from 'clinical6/src/services/AdvertisementService.js'
public class | source

AdvertisementService

this class was deprecated.

Service handling Advertisements (images).

Administrators can configure your app's carousel content on your Clinical6 dashboard under CMS > Image Carousel. These advertisements consist of a title, an image, an action to be taken when the image is tapped, and detailed action information.

Your advertisements can also be tagged to help organize your content.

Method Summary

Public Methods
public

get(imageVersions: String, tagNames: String[]): Promise<Advertisement>

Retrieves the list of images in a advertisement with their corresponding attributes and actions given a advertisement

public

Retrieves advertisement settings.

Public Methods

public get(imageVersions: String, tagNames: String[]): Promise<Advertisement> source

Retrieves the list of images in a advertisement with their corresponding attributes and actions given a advertisement

Once your carousel images are ready, you can access them through the get method. We highly recommend including device-optimized images. You can filter your images by device-specific versions and tags.

Params:

NameTypeAttributeDescription
imageVersions String
  • optional
  • default:

Versions of images that will be returned with ads

tagNames String[]
  • optional

Tag names that will be used for filtering

Return:

Promise<Advertisement>

Promise object that returns success or failure

Throw:

Clinical6Error

If missing token

Decorators:

  • deprecate

Example:

import { advertisementService } from 'clinical6';

let imageVersion = 'galaxy_s4';
let tags = ['government','capital','DC'];

advertisementService.get(imageVersion, tags).then((data) => {
  // display carousel
});
advertisementService.get();

Test:

public getSettings(): Promise source

Retrieves advertisement settings.

Return:

Promise

Promise object that returns success or failure

Decorators:

  • deprecate

Example:

import { advertisementService } from 'clinical6';
advertisementService.getSettings().then(settings => console.log(settings));

Test: