Skip to content

Latest commit

 

History

History
189 lines (144 loc) · 6.01 KB

api.md

File metadata and controls

189 lines (144 loc) · 6.01 KB

Constants

openNativeShareDialogPromise.<string>

Open a share dialog on native devices

Functions

deviceCanDownload()Promise.<boolean>

Check if device is able to perform a download.

isIosDevice()Promise.<boolean>

Check if device is using ios.

isAndroidDevice()Promise.<boolean>

Check if device is using android.

getAppVersion()Promise.<string>

Get the version of the Staffbase App.

isNativeApp()Promise.<boolean>

Check if app is native.

isMobileApp()Promise.<boolean>

Check if app is mobile.

openLink(url)Promise.<any>

Open a link through the app.

Where Staffbase decides which browser (External/Internal) should be used.

openLinkExternal(url)Promise.<any>

Open a link explicitly in the external browser.

openLinkInternal(url)Promise.<any>

Open a link explicitly in the internal browser.

getBranchLanguages()Promise.<any>

Get all enabled content languages configured in the app.

getBranchDefaultLanguage()Promise.<any>

Get the default content language configured in the app.

getContentLanguages()Promise.<any>

Get all content languages supported by the app.

getPreferredContentLocale(content)Promise.<string>

Gets the chosen language from a given content object

getUserContentLocale()Promise.<any>

Get the current user's content locale, fallback to branch default locale

openNativeShareDialog ⇒ Promise.<string>

Open a share dialog on native devices

Kind: global constant

Param Type Description
content object the content to share

Example

openNativeShareDialog({
     image: "https://example.com/test.png",
     subject: "The string you would like to use as a subject for the share",
     text: "This text is shared",
     url: "https://example.com"
  })

deviceCanDownload() ⇒ Promise.<boolean>

Check if device is able to perform a download.

Kind: global function

isIosDevice() ⇒ Promise.<boolean>

Check if device is using ios.

Kind: global function

isAndroidDevice() ⇒ Promise.<boolean>

Check if device is using android.

Kind: global function

getAppVersion() ⇒ Promise.<string>

Get the version of the Staffbase App.

Kind: global function

isNativeApp() ⇒ Promise.<boolean>

Check if app is native.

Kind: global function

isMobileApp() ⇒ Promise.<boolean>

Check if app is mobile.

Kind: global function

openLink(url) ⇒ Promise.<any>

Open a link through the app.

Where Staffbase decides which browser (External/Internal) should be used.

Kind: global function

Param Type Description
url string the url to open in the browser

openLinkExternal(url) ⇒ Promise.<any>

Open a link explicitly in the external browser.

Kind: global function

Param Type Description
url string the url to open in the browser

openLinkInternal(url) ⇒ Promise.<any>

Open a link explicitly in the internal browser.

Kind: global function

Param Type Description
url string the url to open in the browser

getBranchLanguages() ⇒ Promise.<any>

Get all enabled content languages configured in the app.

Kind: global function

getBranchDefaultLanguage() ⇒ Promise.<any>

Get the default content language configured in the app.

Kind: global function

getContentLanguages() ⇒ Promise.<any>

Get all content languages supported by the app.

Kind: global function

getPreferredContentLocale(content) ⇒ Promise.<string>

Gets the chosen language from a given content object

Kind: global function

Param Type Description
content object | array the content to choose the locale from

Example

getPreferredContentLocale(['de_DE', 'en_EN']) // => 'de_DE'
   getPreferredContentLocale({'de_DE': {1,'eins'}, 'en_EN': {1: 'one'}}) // => 'de_DE'

getUserContentLocale() ⇒ Promise.<any>

Get the current user's content locale, fallback to branch default locale

Kind: global function