Publication

Commands

getDetails

Retrieves details of the flipbook.

instance.publication.getDetails((result) => {
    // YOUR CODE HERE
});

The command will return an object with the following properties:

Property
Type
Description

name

string

Name of the flipbook

seoTitle

string

SEO title of the flipbook

paperId

number

ID of the flipbook

isEmbedded

boolean

Is the flipbook embedded/iframed

Events

onSpreadChange

Note:

For new implementations, we reccommend you use the paging.onChange event instead of this event.

This subscription will trigger when the spread of the flipbook changes.

instance.publication.onSpreadChange((result) => {
    // YOUR CODE HERE
});

The callback contains a value/result with the following properties:

Property
Type
Description

currentSpreadPages

number[]

Page numbers that are in the current spread.

currentVisiblePages

number[]

Page number(s) that are currently in view. This array may contain one or two numbers, depending if the current view is page- (mobile/tablet in portrait) or spread-based (desktop, or mobile/tablet in landscape).

onPageElementClick

This subscription will trigger when a product/shop item action is clicked.

instance.publication.onPageElementClick((result) => {
    // YOUR CODE HERE
});

Note:

Current only shop items will fire this event. Click events on any other enrichments are not emitted.

The callback contains a value/result with the following properties:

Property
Type
Description

type

string

The page element type that was clicked on

data

{}

Data associated with the page element

data.title

string

Shop item title

data.description

string

Shop item description

data.productId

string

Shop item product ID

data.price

number

Shop item price

data.amountSelection

boolean

If users are allowed to manually specify an amount before adding to basket

data.packageSize

number

Number of items per package

event

{}

Event data associated with the click event

event.originPage

number

Page number on which the page element is located on

event.originSpreadPages

number[]

Page numbers on which the spread where the page element is located on

event.coordinates.pageX

number

Absolute x coordinate of the click event

event.coordinates.pageY

number

Absolute y coordinate of the click event

event.coordinates.bookX

number

Ratio of the x coordinate relative to book width

event.coordinates.bookY

number

Ratio of the y coordinate relative to book height

Last updated