Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When developing an application to run on top of the Pulsar Platform, developers have the freedom to use the wealth of web technology available in the mobile app environment. Pulsar has been successfully used with several popular web frameworks, allowing developers to use some of the same code and techniques they have used in more traditional web development. However, there are a few technologies and methodologies that can be used to improve the developer experience while building a Pulsar-based app.

General Recommendations

  1. Start working with the simple examples on GitHub
  2. Use Promises for continuations
  3. Keep things modular -- build one library of API calls in the resources
  4. Use global resources amapas much as possible. This means sharing common functions in common javascript files.
  5. In code, use 18 character Ids
  6. Date format should be a valid Salesforce date format
  7. When building custom HTML pages, be mindful that using a "Submit" button will generally reload the page by default. This may trigger some of your initialization and setup methods to fire an additional time and prevent some asynchronous calls from completing. 
  8. When working with API responses and Salesforce data, always check types and handle errors.
  9. When working with data expected to contain JSON, be sure to check whether that JSON has already been parsed. Remember that the data you receive has traversed many layers before your code receives it.

Testing/Test Data

We encourage the use of a Salesforce Sandbox to test your code in the Pulsar environment. 

...

One of the first obstacles most developers run into is the difficulty of debugging their code in-place while it is running within the Pulsar app.

Coming in Spring 2020 Pulsar release Beginning with Pulsar 3.8 for Android and Windows, you will be able to use can set up a local development server running on your development machine to rapidly iterate on your code.

Viewing Pulsar Logs

You can add extra email addresses to receive logs from users by adding to the pulsar.logs.email.cc Pulsar Setting

On the Windows platform, you can directly view Pulsar logs at the following directory (e.g., from Windows Explorer):

  • %HOMEDRIVE%%HOMEPATH%\AppData\Local\Packages\E3D1A000.PulsarforSalesforce_ta6n8xy84gcpg\LocalState\Library\Application Support\
  • Note that the AppData directory may itself be hidden from Windows Explorer

Mobile Safari Tips

  • In order to have smooth scrolling on iOS Safari, any time you would use CSS  overflow: scroll; -- 
    Make sure to include: -webkit-overflow-scrolling: touch; This will ensure that your scrolling performance is smooth.

...

Some developers don't want to see the default Done button and the navigation elements and want to control this themselves. Pulsar provides configuration settings to achieve this. Use the following settings for this purpose. 




NameHide the Done button on the custom HTML Page

Key

pulsar.docs.hideDoneButton

Value

TRUE / FALSE

Default Value (if any)

FALSE
Compatibility
  •  iOS
  •  Windows
  •  Android

Description

By default, a user can click on the Done button to close the custom HTML page and get back to Pulsar Home Page or a Pulsar record screen. In some cases, customers would like to hide the done button on that page. This setting will let enable that behavior. 
Notes/Comments





NameHide HTML Navigation Buttons (Back, Forward, Refresh)

Key

pulsar.docs.hideNavigation

pulsar.docs.<docID>.hideNavigation

Value

TRUE / FALSE

Default Value (if any)

FALSE
Compatibility
  •  iOS
  •  Windows
  •  Android

Description

This setting will hide the back, forward, and refresh buttons if this setting is specified and set to TRUE.
Notes/Comments

Generating PDF files offline - Some best practices

...

If you need to generate a PDF offline from your HTML/JS app, we've determined that the best approach is to avoid the use of <table> elements and instead build the page structure with <div> elements.  It's been noted (https://stackoverflow.com/questions/9288802/avoid-page-break-inside-row-of-table/27209406) that <tr> elements do not appear to respect the break-inside/page-break-inside CSS attributes. 
Note: If you are building your app to run within Pulsar FSLapp:  Pulsar FSL app  is utilizing Bootstrap 4. In the discussions around page breaks and <table> elements, it's been suggested that Bootstrap may impact this. 

...

Using images, canvas elements and fonts will work in your custom HTML implementations, but it is possible to run into issues when attempting to generate PDF files, due to CORS rules or similar access restrictions imposed by the webview environment. Our recommendation is to convert each of these resources to a 'data URI' format with Base64 encoding.  
Canvas elements can be converted at runtime (prior to calling print/PDF APIs), using the convenient toDataURL() javascript API. For Images, the same thing can be done by drawing the image in a canvas element and using the toDataURL() API. Note: This particular method assumes a canvas element is available in your HTML page. Prior to generating the PDF or printing the HTML, we recommend removing the canvas from the DOM using jQuery or similar libraries, as we cannot guarantee the PDF engine will render canvas elements properly at this time.

...