Show:

Users.Device.Safari Class

Device adapter class for safari platform

Constructor

Users.Device.Safari

(
  • fields
)

Parameters:

  • fields Object

    The fields values to initialize table row as an associative array of {column: value} pairs

Methods

handlePushNotification

(
  • notification
  • [options]
  • [callback]
)

Parameters:

  • notification Object
    • [alert] String | Object optional

      Either the text of an alert to show, or an object with the following fields:

    • [alert] String | Array optional

      Either the text of an alert to show, or an object with the following fields:

      • [title] String optional
        The title of the notification
      • [body] String optional
        The body of the notification
      • [titleLocKey] String optional
        Apple-only
      • [titleLocArgs] String optional
        Apple-only
      • [actionLocKey] String optional
        Apple-only
      • [locKey] String optional
        Apple-only
      • [locArgs] String optional
        Apple-only
      • [launchImage] String optional
        Apple-only
    • [url] String optional

      The url of the notification

    • [badge] String optional

      The badge

    • [sound] String optional

      The name of the sound file in the app bundle or Library/Sounds folder

    • [icon] String optional

      The icon

    • [actions] Array optional

      Array of up to two arrays with keys 'action' and 'title'.

    • [category] String optional

      Apple-only. The name of the category for actions registered on the client side.

    • [payload] Object optional

      Put all your custom notification fields here

  • [options] Object optional
    • [view] String optional

      Optionally set a view to render for the alert body

    • [isSource] Boolean optional

      If true, uses Q.Handlebars.renderSource instead of render

    • [expiry] Timestamp optional

      A UNIX timestamp for when the notification expires

    • [priority="high"] String optional

      Can be set to "normal" to make it lower priority

    • [collapseId] String optional

      A string under 64 bytes for collapsing notifications

    • [id] String optional

      You can provide your own uuid for the notification

    • [silent=false] Boolean optional

      Deliver a silent notification, may throw an exception

  • [callback] Function optional

    This is called after the notification was sent. The first parameter might contain any errors. The "this" object is the Users.Device

pushNotification

(
  • notification
  • [options]
  • [callback]
)

Parameters:

  • notification Object
    • [alert] String | Object optional

      Either the text of an alert to show, or an object with the following fields:

    • [alert] String | Array optional

      Either the text of an alert to show, or an object with the following fields:

      • [title] String optional
        The title of the notification
      • [body] String optional
        The body of the notification
      • [titleLocKey] String optional
        Apple-only
      • [titleLocArgs] String optional
        Apple-only
      • [actionLocKey] String optional
        Apple-only
      • [locKey] String optional
        Apple-only
      • [locArgs] String optional
        Apple-only
      • [launchImage] String optional
        Apple-only
    • [badge] String optional

      The badge

    • [sound] String optional

      The name of the sound file in the app bundle or Library/Sounds folder

    • [icon] String optional

      Url of icon, can be png any square size

    • [url] String optional

      Url to which the notifiation will be linked

    • [actions] Array optional

      Array of up to two arrays with keys 'action' and 'title'.

    • [category] String optional

      Apple-only. The name of the category for actions registered on the client side.

    • [payload] Object optional

      Put all your custom notification fields here

  • [options] Object optional
    • [view] String optional

      Optionally set a view to render for the alert body

    • [isSource] Boolean optional

      If true, uses Q.Handlebars.renderSource instead of render

    • [expiry] Timestamp optional

      A UNIX timestamp for when the notification expires

    • [priority="high"] String optional

      Can be set to "normal" to make it lower priority

    • [collapseId] String optional

      A string under 64 bytes for collapsing notifications

    • [id] String optional

      You can provide your own uuid for the notification

    • [silent=false] Boolean optional

      Deliver a silent notification, may throw an exception

  • [callback] Function optional

    This is called after the notification was sent. The first parameter might contain any errors. The "this" object is the Users.Device

setUp

()

The setUp() method is called the first time an object of this class is constructed.