Skip to content

How to use action Items

o5faruk edited this page May 2, 2021 · 30 revisions

⚠️⚠️⚠️

This sdk documentation is deprecated and will not be updated. Check out our new docs at https://sdk.buildfire.com/docs/action-items/

⚠️⚠️⚠️

Action Items

Action Items is an object that represent an action to take. This could be a link to open in a browser, could be a telephone number to call or sms, and/or could be an address to navigate to. The details of these objects shouldn't concern you. All you need to do is save it in your datastore and when it's time to execute an item just call buildfire.actionItems.execute(actionItem,callback)


How to use an Action Item

buildfire.actionItems.showDialog (actionItem <optional> , options <optional> , callback)

This function will be used in the control. This will popup a dialog for the App Owner to create an Action Item. arguments

  • options
    • showIcon {bool}: Specifies if you want to show the "icon" (Default: false) and will return iconUrl in the callback
    • allowNoAction {bool}: Specifies if you want Allow no action as action type, this will be used in case you need the action Item to return the title and icon Url only, most probably you can use it for Carousel
    • actionTextLabel {string}: Custom label to show next to the action item display text field (Default: 'Action Button Text')
    • hideActionText {bool}: Does not ask the user to provide a display text value to the action item (Default: false)
  • actionItem this is an optional parameter that allows you to pass a previously saved actionItem that the user would like to edit
  • callback function that will be called when the action item dialog is completed Here are examples for each action item objects which returned after filling the dialog :
  • linkToWeb
title: "build fire",
url: "https://www.facebook.com/buildfireapps",
action: "linkToWeb",
openIn: "_blank" or "_system"
  • linkToApp
instanceId:"03dd5856-99ed-4950-ad40-6d95a29ef7f2-1449796387765"
action: "linkToApp"
  • sendEmail
title: "Send Email",
subject : "action Item Test"
body : "We are testing action Item send Email"
email: "support@buildfire.com",
action: "sendEmail"
  • callNumber
phoneNumber: "+1-541-754-3010",
action: "callNumber"
  • sendSMS
title: "Send SMS",
subject : "action Item SMS Example"
phoneNumber: "+1-541-754-3010",
action: "sendSMS"
  • navigateToAddress
title: "Navigate to address title",
lat: "37.7944988",
lng: "-122.3947446",
address :"1 Market Street, San Francisco, CA, United States"
action: "navigateToAddress"
  • navigateToAddress
title: "Navigate to address title",
lat: "37.7944988",
lng: "-122.3947446",
address :"1 Market Street, San Francisco, CA, United States"
action: "navigateToAddress"
  • linkToSocialGoogle
title: "Link to google",
url: "https://plus.google.com/+Buildfireapps"
action: "linkToSocialGoogle"
  • linkToSocialInstagram
title: "Link to instagram",
url:"https://instagram.com/google/?hl=en",
action: "linkToSocialInstagram"
  • linkToSocialLinkedIn
title: "Link to LinkedIn",
url:"https://www.linkedin.com/company/buildfire",
action: "linkToSocialLinkedIn"
  • linkToSocialFaceBook
title: "Link to Facebook",
url:"https://www.facebook.com/buildfireapps",
action: "linkToSocialFacebook"
  • linkToSocialTwitter
title: "Link to Twitter",
url:"https://twitter.com/buildfire",
action: "linkToSocialTwitter"

Deep Link

buildfire.actionItems.execute(actionItem,callback)

This is to be used on the widget side. It will take a previously saved actionItem and execute it. If its a link it will open in a browser, if its a telephone number it will call that phone number, etc ... arguments

  • actionItem previously saved action item you'd like to execute.
  • callback is a function that is called when the execution is complete.

buildfire.actionItems.list(actionItems,options,callback)

This is to be used on the widget side. It will take an array of previously saved actionItems and list them in a standard popup. arguments

  • actionItems array of previously saved action items you'd like to list.
  • options optional options object that allows you to change some behavior such as: executeItem default true that will automatically execute after user selects an item
    • callback is a function that is called when the list/execution is complete.
      • callback arguments
        • error if an error occurred .
        • actionItem the selected actionItem from the list.
Clone this wiki locally