# Basic Events

In this part, events from app.js file are documented.

# Ti.App.fireEvent('setSessionID')

fab fa-apple fab fa-android

Sets the sessionID for the active session.

Example:

Ti.App.fireEvent('setSessionID', { sessionID: mySessionID })
  • sessionID - sessionID value to be set

# Ti.App.fireEvent('getSessionID')

Retrieves the sessionID for the active session.

Example:

Ti.App.fireEvent('getSessionID', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view from which the sessionID will be gathered.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('setPropPitcher')

Sets a new value for a property.

Example:

Ti.App.fireEvent('setPropPitcher', {
  variableName: 'propName',
  value: data,
  resetParams: true | false
})
  • variableName - name of the selected property
  • value - new value of the property(Can be string, boolean or number). If value is not set, then the mentioned property will be removed.
  • resetParams - If this is set to true, then all of the properties will be reset.

# Ti.App.fireEvent('getPropPitcher')

Retrieves the value of the property.

Example:

Ti.App.fireEvent('getPropPitcher', {
  variableName: 'propName',
  callBackFunc: 'myCallBackFunc',
  typeP: 'type',
  source: 'mySource'
})
  • variableName - name of the selected property
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • typeP - type of the selected property
  • source - define the targeted webview.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('copyCallObjsToCB')

Copies the call objects to the clipboard.

Example:

Ti.App.fireEvent('copyCallObjsToCB', {
  appID: 'myAppID',
  scheme: 'myScheme'
})
  • appID - appID of the application
  • scheme - scheme of the ??? TO DO: Define

# Ti.App.fireEvent('startRecording')

Starts camera recording.

Example:

Ti.App.fireEvent('startRecording')

# Ti.App.fireEvent('stopRecording')

Stops camera recording.

Example:

Ti.App.fireEvent('stopRecording', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('loadNextInGuided')

On the help option, this event loads the next step in introduction guide steps.

Example:

Ti.App.fireEvent('loadNextInGuided')

# Ti.App.fireEvent('crashReport')

Shows an alert dialog with message.

TO DO: fix the example

Example:

Ti.App.fireEvent('crashReport', { 'My alert string' });

# Ti.App.fireEvent('renderTodos')

Shows To-Dos popover. Works only on instances with To-Do interactives. Also, appConfig should exists and appConfig.todosEnabled should be equal to true.

Example:

Ti.App.fireEvent('renderTodos', {
  x: myX,
  y: myY,
  source: mySource,
  accountID: myAccountID
})
  • x - x Coordinate of the To-Dos popover.
  • y - y Coordinate of the To-Dos popover.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • accountID - accountID of the user (can be blank).

NOTE

This event can be fired without any parameters. The important point here is the existance of To-Dos interactive within the instance.

# Ti.App.fireEvent('closeTodos')

Closes To-Dos popover. Works only on instances with To-Do interactives.

Example:

Ti.App.fireEvent('closeTodos')

# Ti.App.fireEvent('renderKeyInitiatives')

If appConfig exists and appConfig.taskWarning equals to true, then it calls renderTodos() (shows To-Dos popover). Else, it takes accountID and source, creates a new popover.

Example:

Ti.App.fireEvent('renderKeyInitiatives', {
  x: myX,
  y: myY,
  source: mySource,
  accountID: myAccountID
})
  • x - x Coordinate of the To-Dos popover.
  • y - y Coordinate of the To-Dos popover.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • accountID - accountID of the user (can be blank).

# Ti.App.fireEvent('closeRenderInitiatives')

Closes To-Dos popover if opened. Otherwise, closes the Key Initiatives popover.

Example:

Ti.App.fireEvent('closeRenderInitiatives')

# Ti.App.fireEvent('setContactIDs')

Sets contacts with contactIDs.

Example:

Ti.App.fireEvent('setContactIDs', {
  contactIDs: {}
})
  • contactIDs - List of contactIDs.

# Ti.App.fireEvent('addFavoriteItem')

Adds a file with fileID to the favorites.

Example:

Ti.App.fireEvent('addFavoriteItem', {
  fileID: myFileID
})
  • fileID - ID of the file that will be to the favorites.

# Ti.App.fireEvent('removeFavoriteItem')

Removes the file with fileID from the favorites.

Example:

Ti.App.fireEvent('removeFavoriteItem', {
  fileID: myFileID
})
  • fileID - ID of the file that will be removed from the favorites.

# Ti.App.fireEvent('copyToClipboard')

Copies contents to the clipboard.

Example:

Ti.App.fireEvent('copyToClipboard', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  contents: 'myContents'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • contents - contents which will be saved to the clipboard.

# Ti.App.fireEvent('getPushNotifications')

Retrieves push notifications to the current source.

Example:

Ti.App.fireEvent('getPushNotifications', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('getContacts')

fab fa-apple fab fa-android

Retrieves contacts to the current source.

Example:

Ti.App.fireEvent('getContacts', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

NOTE

Android: Only needs parameter callBack as callback function.

# Ti.App.fireEvent('getContentFilterInfo')

Retrieves content filter information to the current source.

Example:

Ti.App.fireEvent('getContentFilterInfo', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('getBookmarks')

Retrieves bookmarks of the current user. If there is no previously saved bookmarks, then an empty array will be created.

Example:

Ti.App.fireEvent('getBookmarks', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('getFavoriteItems')

Retrieves favorite items of the user. If there is no previously saved favorite item, then an empty array will be created.

Example:

Ti.App.fireEvent('getFavoriteItems', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('getLastLaunchedItems')

Retrieves recently opened items list of the user. If there exists no count parameter, then the default count is 10.

Example:

Ti.App.fireEvent('getLastLaunchedItems', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  count: 10
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • count - the count of the list. If no value is set, the count is set to its default value, 10.

# Ti.App.fireEvent('getNotes')

Retrieves user's notes.

Example:

Ti.App.fireEvent('getNotes', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  accountID: 'myAccountID'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • accountID - accountID of the user. If this is null, then currentAccountObject.Id is used instead.

# Ti.App.fireEvent('searchForTag')

Retrieves recently opened items list of the user. If there exists no count parameter, then the default count is 10.

Example:

Ti.App.fireEvent('searchForTag', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  keyword: 'myKeyword'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • keyword - the search keyword, namely tag. File search is done with respect to this keyword, fileIDs are found in return.

# Ti.App.fireEvent('getPitcherFile')

Retrieves Pitcher file using fileID and offline CMS data. If it cannot find the file with the fileID in the first place, then it uses target web view's URL to look up for the file.

Example:

Ti.App.fireEvent('getPitcherFile', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  fileID: 'myFileID'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • fileID - fileID of the Pitcher file. If fileID or callBackFunc is null, then this method searchs the file by looking up the default target web view's url.

# Ti.App.fireEvent('getPitcherFiles')

fab fa-apple fab fa-android

Retrieves all of the Pitcher files using offline CMS data.

Example:

Ti.App.fireEvent('getPitcherFiles', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view. Can be: 'modal', 'postcall', 'precall'(modalWebView), 'emailpopover'(if emailPopup is not null, then emailPopup.emailWebView), 'homescreen'(mainWebView), 'sfdcWebView'(sfdcWebView), 'popover'(initPopover.webview), ''(blank, currentPage's webview)

NOTE

Android: No need for source parameter.

# Ti.App.fireEvent('updateDB')

fab fa-apple fab fa-android

Updates database using custom caches from the app config. If app config file is not present or there are no custom cache object in the app config file, then this method does nothing.

Example:

Ti.App.fireEvent('updateDB', {
  objectType: 'myObjectType',
  updateObject: 'myUpdateObject',
  searchID: 'mySearchID'
})
  • objectType - if customCache.objectName equals to this, the get object with searchID from updateObject.
  • updateObject - Object to be updated.
  • searchID - ID of the to-be-updated object in updateObject

# Ti.App.fireEvent('removeContent')

Removes content with fileID, subID specifications from the database(namely, from table tbl_history_v2).

Example:

Ti.App.fireEvent('removeContent', {
  fileID: 'myFileID',
  subID: 'mySubID'
})
  • fileID - id of the to-be-deleted file.
  • subID - subID of the to-be-deleted file.

# Ti.App.fireEvent('updateRating')

Updates the rating of the content with fileID, subID specifications at the database(namely, from table tbl_history_v2).

Example:

Ti.App.fireEvent('updateRating', {
  rating: 'myRating',
  fileID: 'myFileID',
  subID: 'mySubID'
})
  • rating - new rating value of the content.
  • fileID - id of the to-be-updated file.
  • subID - subID of the to-be-updated file.

# Ti.App.fireEvent('getContentsOfSession')

Retrieves the contents of the mentioned session using history and offline CMS data.

If there is no sessionID, then this uses the active sessionID. It gets history as rowsToShow and for each row, it compares fileID from that row to the offlineCMSData files. The matching file of category presentation or pdf then is shown in a resultSet like { thumb, label, type(category), extraParams, fileID, subID, fileInfo, extraObject, eventTime }.

In case of custom decks, the response of getContentsOfSession contains the following set of fields: { Name, slideOrder, subID, timeValue }

The above operation is executed for each file in history.

Example:

Ti.App.fireEvent('getContentsOfSession', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  sessionID: 'mySessionID'
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • sessionID - specific sessionID. If null, then current sessionID will be used.

# Ti.App.fireEvent('planCall')

Plans a call. When this event is fired, account/contact selection screen opens and let's you choose. This does not start a call but let user plan the next call.

If the modal exists, this method first fires closeOpenModal event and after 500ms, it fires itself with same parameters. After it finds account and contact information using parameters, it fires a startDetailing event that creates selection window.

If no accountID given, this method will throw an alert and exit.

Example:

Ti.App.fireEvent('planCall', {
  contactIDs: 'myContactID',
  accountID: 'myAccountID',
  keepModalOpen: true
})
  • contactIDs - id numbers of the selected contacts.
  • accountID - accountID of the contacts.
  • keepModalOpen - true or false, default is false, it decides the keeping previous modal open or not when returned from the planning screen.

# Ti.App.fireEvent('startCall')

Starts a unplanned call with the history information retrieved with accountID.

If there is no current acoount object, then it retrieves account information from account info json file. Then it creates a fake event object with contactIDs and accountID and it starts a call with these object.

If any of the event parameters is null, this method will throw an alert and exit.

Example:

Ti.App.fireEvent('startCall', {
  contactIDs: 'myContactID',
  accountID: 'myAccountID'
})
  • contactIDs - id numbers of the selected contacts.
  • accountID - accountID of the contacts.

# Ti.App.fireEvent('startCallWithParameters')

This is a multi-option event: One can start a planned call, unplanned call with only accountID, only contactIDs or both.

Example:

Ti.App.fireEvent('startCallWithParameters', {
  contactIDs: 'myContactID',
  accountID: 'myAccountID',
  sessionID: 'mySessionID',
  loginURL: 'myLoginURL',
  eventID: 'myEventID',
  extraParams: '{extraParam1: "", extraParam2: "", ...}',
  index: 'myIndex',
  section: 'mySection'
})
  • contactIDs - id numbers of the selected contacts. If not null, it is used as targetP in event data; else, targetP is created from targetA.
  • accountID - accountID of the contacts. If not null, it is used as targetA in event data.
  • sessionID - id of this session. If authentication active, then it is used for processing authentication code. Currently not used.
  • loginURL - login url of the session. If authentication active, then its first part is used as authentication login url. Currently not used.
  • eventID - id of the event, used for get call information. If event data is still null, then this is used for retrieving the call by UUID. If event data is still null, then method throws and alert and exits.
  • extraParams - extra parameters. Used for setting event data object's extra parameters.
  • index - TO DO: Add description
  • section - TO DO: Add description

# Ti.App.fireEvent('getSlideDetails')

Retrieves the detailed information of the desired slide.

Example:

Ti.App.fireEvent('getSlideDetails', {
  callBack: 'myCallBackFunc',
  fileID: 'myFileID',
  subID: 'mySubID',
  source: 'mySource'
})
  • callBack - callBack function which is evaluated with targeted WebView
  • fileID - slide's ID number, used for getting slide tags.
  • subID - subID of the file.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('createCalendarEvent')

Creates calendar event with given parameters.

If there is no callID, then the rest of the parameters(except callback and source) is not used to create a calendar event.

If created event cannot be saved, then this method throws an alert.

Example:

Ti.App.fireEvent('createCalendarEvent', {
  callBack: 'myCallBackFunc',
  source: 'mySource',
  callID: 'myCallID',
  title: 'myTitle',
  startDate: 'myStartDate',
  endDate: 'myEndDate',
  notes: '{note1: "", note2: "", ...}',
  location: 'myLocation',
  isAllDay: true
})
  • callBack - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • callID - callID that will be used in retrieving event from calendar. If it is null, then a new calendar event will be created and saved.
  • title - title of the event.
  • startDate - start date of the event.
  • endDate - end date of the event.
  • notes - notes regarding to the event.
  • location - location of the event.
  • isAllDay - does the event last for the whole day?

# Ti.App.fireEvent('refreshPage')

fab fa-apple fab fa-android

Refreshes the current page.

Example:

Ti.App.fireEvent('refreshPage', {
  source: 'mySource'
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

NOTE

Android: Does not need any parameters.

# Ti.App.fireEvent('searchDB')

fab fa-apple fab fa-android

Searches database by generating and executing a SQL query. This function is a general purpose one, so it has a lot of parameters but basically, search query is created based on objectType parameter and query uses other parameters as well.

Example:

Ti.App.fireEvent('searchDB', {
  callBack: 'myCallBackFunc',
  source: 'mySource',
  isIDCheck: false,
  objectType: 'myObjectType',
  searchField: 'mySearchField',
  noLimit: false,
  limit: 'myLimit',
  keyword: 'myKeyword',
  onlyCurrentAccount: true,
  accountID: 'myAccountID',
  useStrictMainContactOnly: true,
  simpleObjects: true,
  skipCurrentAcoount: true,
  nonAffiliatedLimit: 'myNonAffiliatedLimit',
  contactID: 'myContactID',
  keepParam: 'myKeepParam',
  toCheckID: 'myToCheckID',
  relatedAsObjects: true,
  extraToGetBack: 'myExtraToGetBack',
  errorFunc: 'myErrorFunc'
})
  • callBack - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • isIDCheck - if true and no object type given, method will search ID in the cached table.
  • objectType - object type of the to be searched object. Can be Account (tbl_crm_contacts_m_v4, selects all), Contact (tbl_crm_contacts_m_v4, selects contactID), User (tbl_crm_users_m_v3). If nothing is given and appConfig has customCache object, then it will go default and search tableToCache in customCache.
  • searchField - can be Id or null. If the former, then id will be used in where clause in the query; else, it will execute query with name in where clause.
  • noLimit - is there any limit clause in query?
  • limit - if this is set, then it will be used in limit clause; else default value is 250.
  • keyword - if searchField is Id, this is used as ID; else, this will be used as name at comparisons in where clauses.
  • onlyCurrentAccount - search for only current account or use accountID in search query.
  • accountID - id of the account that will be subject to search query if it exists.
  • useStrictMainContactOnly - if true, then rows with main contact will be used.
  • simpleObjects - if true, then result contains only id and name.
  • skipCurrentAccount - search for the current account or not.
  • nonAffiliatedLimit - if hasAffiliations is true, then this will be used as contact parameter.
  • contactID - used in where clause.
  • keepParam - parameter that will be held in result object if not null.
  • toCheckID - if isIDCheck is true, then each of these IDs is used in customCache search query.
  • relatedAsObjects - if true and result key is not equal to extraField but contains value 111, then this value will be splitted and put into result object.
  • extraToGetBack - if not null, then it will added to the evalJS function as an addition to the result of the search.
  • errorFunc - function that is used in error handling.

TO DO: Changes per Platform will be added later

NOTE:

Android: There is no need for source and useStrictMainMainContactOnly parameters. For the former, see Notes section below. For the latter, it is commented out(10-12-2019). Moreover, for the objectType parameter, DB tables are: Account (tbl_crm_accounts), Contact (tbl_crm_contacts, selects all), User (tbl_crm_users, selects all).

# Ti.App.fireEvent('searchPitcherFile')

fab fa-apple fab fa-android

This event looks up for Pitcher file in offline CMS data files.

Example:

Ti.App.fireEvent('searchPitcherFile', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  extra: 'myExtra',
  body: 'body',
  keywords: 'myKeyword',
  rangeCheck: true
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • extra - searched file's extra attribute.
  • body - searched file's body attribute.
  • keywords - keywords of the searched file
  • rangeCheck - extra flag to make comparison by checking range.

NOTE:

Android: source parameter is not needed.

# Ti.App.fireEvent('getPitcherCode')

Retrieves platformID.

Example:

Ti.App.fireEvent('getPitcherCode', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('getPitcherFolder')

fab fa-apple fab fa-android

Retrieves the path from the direct getPitcherDirectory method.

Example:

Ti.App.fireEvent('getPitcherFolder', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

NOTE:

Android: Only needs parameter callBack as callback function.

# Ti.App.fireEvent('getPresentationContext')

Retrieves lastPresData as presentation context. If fullScreenSlidePreview is true, then a custom lastPresData is shown.

Example:

Ti.App.fireEvent('getPresentationContext', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('clearScreenshotCache')

Clears screenshot cache.

Example:

Ti.App.fireEvent('clearScreenshotCache')

# Ti.App.fireEvent('takeScreenshotFromSlide')

Takes screenshot from slide.

Example:

Ti.App.fireEvent('takeScreenshotFromSlide', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('takeScreenshotFromModal')

Takes screenshot from modal.

Example:

Ti.App.fireEvent('takeScreenshotFromModal', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)

# Ti.App.fireEvent('launchFileWithID')

fab fa-apple fab fa-android

Launches file with given ID.

Example:

Ti.App.fireEvent('launchFileWithID', {
  fileID: 'myFileID',
  subID: 'mySubID',
  source: 'mySource'
})
  • fileID - fileId of the file.
  • subID - if null, lasOpenFileID is used.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview). If it is homescreen, then information about the last file will be turned to null.

NOTE:

Android: There is no need for source parameter.

iOS: This can be used for a specific case such as:

  • When one wants to open a zip file within a zip file, this will open an interactive within interactive with Back button instead of Home button. If you want a behaviour like this, use this event rather than launchFileWithKeyword

We added the functionality to launch a custom deck from within a custom deck in Impact for iOS v2.85.30.

Example:

Ti.App.fireEvent('launchFileWithID', {
  fileID: '922155',
  dataOfPres: {
    "vNumber": 1,
    "presentationName": "A Custom Presentation",
    "slideOrder": "922155_1597049783|1",
    "isCustom": 1,
    "timeValue": "1617280528570.0",
    "editorValue": 2,
    "ID": "922155_1597049783|1",
    "containsMultiple": true,
    "vSubFolder": "922155_1597049783"
  },
  source: 'presentation',
  subID: '1',
})

# Ti.App.fireEvent('launchFileWithKeyword')

fab fa-apple fab fa-android

Launches file with given keyword by searching in the files of offline CMS data.

Example:

Ti.App.fireEvent('launchFileWithKeyword', {
  keyword: 'myKeyword'
})
  • keyword - keyword to be searched.

NOTE:

Android: There is no need for source parameter.

iOS: When one wants to open a zip file within a zip file, this won't open the expected behavior with Back button instead of Home button. If this is the case, use launchFileWithID event instead.

# Ti.App.fireEvent('sendFile')

Sends the stats and path of the file. Adds timestamp to the parameters before using them in sendStats method.

Example:

Ti.App.fireEvent('sendFile', {
  filePath: 'myFilePath'
})
  • filePath - file path of the to-be-sent file.

NOTE:

This event is for just e-mail attachments.

# Ti.App.fireEvent('updateSShotRemote')

Updates the screen shot remotely.

If sshotLock is true, this event will not work as it returns without doing anything.

Also, it updates screenshot if presentation is active.

Example:

Ti.App.fireEvent('updateSShotRemote')

# Ti.App.fireEvent('savesScreenshotsToFile')

Saves screenshots to a pdf file.

Creates file in the Pitcher directory and returns native path to the file.

Example:

Ti.App.fireEvent('savesScreenshotsToFile', {
  source: 'mySource',
  callBackFunc: 'myCallBackFunc',
  fileName: 'myFileName'
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • fileName - name of the file. If null, default name is 'pdfOutput.pdf'
  • saveToCameraRoll - optional boolean flag, indicating whether the screenshots should be also saved to iOS Camera Roll (iOS specific only)

# Ti.App.fireEvent('mergePDFs')

Merges given files into a file.

If there exists a file with given name in Pitcher directory, then this will delete the old file and creates a new one.

If it cannot read newly created file, then throws an alert and exits.

Handles exceptions while doing its job.

Example:

Ti.App.fireEvent('mergePDFs', {
  source: 'mySource',
  callBackFunc: 'myCallBackFunc',
  fileName: 'myFileName',
  files: { file0, file1, file2, ...}
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • fileName - name of the file. If null, default name is 'pdfOutput.pdf'
  • files - file list that will be merged.

# Ti.App.fireEvent('getCoordinates')

Retrieves last coordimates.

Example:

Ti.App.fireEvent('getCoordinates', {
  source: 'mySource',
  callBack: 'myCallBackFunc'
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • callBack - callBack function which is evaluated with targeted WebView

# Ti.App.fireEvent('showMap')

Shows the map.

Example:

Ti.App.fireEvent('showMap', {
  source: 'mySource',
  callBackFunc: 'myCallBackFunc'
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • callBackFunc - callBack function which is evaluated with targeted WebView

# Ti.App.fireEvent('setGPS')

Sets up the GPS. Updates the 'tbl_crm_accounts_m_v3' table with given parameters.

Example:

Ti.App.fireEvent('setGPS', {
  lat: 'myLatitude',
  lon: 'myLongitude',
  accountID: 'myAccountID'
})
  • lat - latitude value that will be subject to update query.
  • lon - longitude value that will be be subject to update query.
  • accountID - ID of the account on the GPS.

# Ti.App.fireEvent('generatePDFfromString')

fab fa-apple fab fa-android

Gets a HTML string and generate a PDF from it.

Example:

Ti.App.fireEvent('generatePDFfromString', {
  fileName: 'myFileName',
  pdfFolder: true,
  htmlString: 'myHTMLString',
  callBackFunction: 'myCallBackFunction',
  source: 'mySource'
})
  • fileName - name of the file. If null, default name is 'pdfOutput.pdf'
  • pdfFolder - if true, then file is created to pdfs folder under Pitcher directory.
  • htmlString - HTML string that pdf file will be created from.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • callBackFunc - callBack function which is evaluated with targeted WebView, used with native path to the file

NOTE:

Android: There is no need for source parameter.

# Ti.App.fireEvent('noop')

No operation event.

Example:

Ti.App.fireEvent('noop')

# Ti.App.fireEvent('refreshCallObject')

Refreshes current call object with currentAccountObject's attributes. If there is no current call object, it simply quits.

Example:

Ti.App.fireEvent('refreshCallObject')

# Ti.App.fireEvent('resizePZeroOverlay')

Resizes the sfPopover if it exists and noPopover attribute is not equal to false.

Example:

Ti.App.fireEvent('resizePZeroOverlay', { e })

# Ti.App.fireEvent('hidePZeroOverlay')

Hides sfPopover. If sfPopover is null and homescreenPopover is not, it hides homescreenPopover automatically.

Example:

Ti.App.fireEvent('hidePZeroOverlay')

# Ti.App.fireEvent('syncHomepage')

Synchronizes homepage with CRM. Operation is done on mainWebView(homescreen).

Example:

Ti.App.fireEvent('syncHomepage')

# Ti.App.fireEvent('showPZeroOverlay')

Shows PZero overlay on a to-be-added webview where its type is defined with source parameter. Before quitting, fires event openAccountInSF with the given parameters.

Example:

Ti.App.fireEvent('showPZeroOverlay', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  objectId: 'myObjectID',
  top: 'myTop',
  left: 'myLeft',
  width: 'myWidth',
  height: 'myHeight',
  create: 'myCreate',
  createObject: 'myCreateObject',
  objectType: 'myObjectType'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • objectId - id of the to-be-created object, used as accountID and customSFID.
  • top -
  • left -
  • width - width of newly opened webview
  • height - height of newly opened webview
  • create - if no undefined, this will used to create lasOfflineObejct and lastOfflineCustomObject.
  • createObject - same with create.(needs further check)
  • objectType - type of the newly created object.

# Ti.App.fireEvent('deleteEvent')

Deletes the event given eventID from Calendar.

Example:

Ti.App.fireEvent('deleteEvent', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  eventID: 'myEventID'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • eventID - id of the to-be-deleted event.

# Ti.App.fireEvent('deleteEvents')

Deletes the events happened between startDate and endDate parameters from Calendar.

If any of the startDate or endDate parameters does not exist, method will take into consideration of current date.

Example:

Ti.App.fireEvent('deleteEvents', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  startDate: 'myStartDate',
  endDate: 'myEndDate'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • startDate - start date filter to distinguish which events to delete.
  • endDate - end date filter to distinguish which events to delete.

# Ti.App.fireEvent('getCallObject')

Retrieves current call object.

Example:

Ti.App.fireEvent('getCallObject', {
  callBack: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

# Ti.App.fireEvent('getEvents')

Retrieves events between date 'startDate' and date 'endDate'.

Example:

Ti.App.fireEvent('getEvents', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  startDate: 'myStartDate',
  endDate: 'myEndDate'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • startDate - start date filter to distinguish which events to get.
  • endDate - end date filter to distinguish which events to get.

# Ti.App.fireEvent('getCalendars')

Retrieves all calendars from EventKit (or Realm custom storage) on iOS.

Example:

Ti.App.fireEvent('getEvents', {
  callBack: 'myCallBackFunc',
  source: 'mySource'
})
  • callBack - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

# Ti.App.fireEvent('setCalendar')

If called on iOS, it has the following consequences:

  • All newly created events (created from Impact native side) will have this calendar set
  • The calendar set via setCalendar Ti event will not be persisted across app re-launch, so it is instance UI's responsibility to set it accordingly upon instance launch
  • IMPORTANT NOTE: If the setCalendar was called by the instance UI, then the current logic behind extraParsed.useDefaultCalendar will be ignored

Example:

Ti.App.fireEvent('setCalendar', {
  calendarIdentifier: '0939AB87-836C-48ED-99F9-C4A96C4F1DF9'
})
  • calendarIdentifier - identifier of the calendar to be set (one of the records retrieved in the response for getCalendars Ti event

# Ti.App.fireEvent('openInOriginal')

Opens document in default document viewer application with animation set on and a quicklook view poping up next to a view.

Example:

Ti.App.fireEvent('openInOriginal', {
  source: 'mySource',
  path: 'myPath'
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • path - path to the file.

# Ti.App.fireEvent('sendEmail')

fab fa-apple fab fa-android

Sends an e-mail with given parameters.

Example:

Ti.App.fireEvent('sendEmail', {
  callBackFunc: 'myCallBackFunc',
  subject: 'mySubject',
  isHTML: true,
  messageBody: 'myMessageBody',
  fileURL: 'myFileURL',
  fileURLs: { fileURL0, fileURL1, ... },
  toRecipients: { recipient0, recipient1, ... }
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • subject - subject of the email dialog
  • isHTML - flag for emailDialog
  • messageBody - body part of the email
  • fileURL - to-be-sent file location (single file)
  • fileURLs - each of to-be-sent file location (multiple files)
  • toRecipients - recipients of the mail.

NOTE:

iOS: If appStoreVersion is true and emailDialog is supported or appStoreVersion is false but can send email over emailDialog is true, then e-mail will be sent with no problems. Otherwise, this function will throw an exception with "No email accounts are set up on this device. Can't proceed.".

Android: No need for isHTML parameter. callBackFunc is callBack for Android.

# Ti.App.fireEvent('getCameraPhoto')

fab fa-apple fab fa-android

Retrieves the photo from the camera.

NOTE

This event does not save any of the photo to the gallery.

iOS example:

Ti.App.fireEvent('getCameraPhoto', { e })

Android example:

Ti.App.fireEvent('getCameraPhoto', {
  maxWidth: 356,
  maxHeight: 354,
  targetPhoto: 'myPhotoName'
})
  • maxWidth: Width value of the to-be-opened gallery window.
  • maxHeight: Height value of the to-be-opened gallery window.
  • targetPhoto: filename parameter for the to-be-taken photo.

NOTE:

iOS: If parameters are null, then it will be created; else parameters are used as last camera event. If a modal is open, this event creates an view for the photo.

Android: If webView context is an instance of PitcherImpactActivity, then dispatches pick image intent.

# Ti.App.fireEvent('openPhotoGallery')

fab fa-apple fab fa-android

Opens the photo gallery.

NOTE

This event does not save any of the photo to the gallery.

iOS example:

Ti.App.fireEvent('openPhotoGallery', { e })

Android exmaple:

Ti.App.fireEvent('openPhotoGallery', {
  maxWidth: 356,
  maxHeight: 354
})
  • maxWidth: Width value of the to-be-opened gallery window.
  • maxHeight: Height value of the to-be-opened gallery window.

NOTE:

iOS: If parameters are null, then it will be created; else parameters are used as last camera event. If a modal is open, this event creates an view for the photo.

Android: If webView context is an instance of PitcherImpactActivity, then dispatches pick image intent.

# Ti.App.fireEvent('addFileSent')

Adds the file if it is sent to the JSON.

Example:

Ti.App.fireEvent('addFileSent', {
  fileID: 'myFileID'
})
  • fileID - fileID of the sent file. If null, then event does nothing and just quits.

# Ti.App.fireEvent('getFilesSent')

Retrieves all of the files that are sent before.

If any error occurs, this method will send pitcherAlert with the exception.

Example:

Ti.App.fireEvent('getFilesSent', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView. If null, it is set to setFilesSent
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

# Ti.App.fireEvent('addTag')

fab fa-apple fab fa-android

Adds the tag to the detailed tags.

If parameter tag is null, this function does nothing and simply quits.

Example:

Ti.App.fireEvent('addTag', {
  tag: 'myTag'
})
  • tag - tag to be added.

# Ti.App.fireEvent('getTags')

fab fa-apple fab fa-android

Retrieves all of the tags.

Example:

Ti.App.fireEvent('getTags', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView. If null, it is set to setPitcherTags
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

NOTE

Android: Only needs parameter callBack as call back function.

# Ti.App.fireEvent('receivedSpeechHypothesis')

fab fa-apple

Base on the parameter, this function does variuos things on a slide.

Example:

Ti.App.fireEvent('receivedSpeechHypothesis', {
  hypothesis: 'LAUNCH TEST111'
})
  • hypothesis - the command parameter that the method will work on. See conditions below:

    • If first part is LAUNCH, second part should be the name of the to-be-launched presentation, in upper cases and there should be no spaces. This hypothesis launches the presentation.

    • If first part is NEXT, then goNextChapter event is fired and if a presentation has been opened already and it has multiple chapters, it will show its next chapter.

    • If first part is BACK, then goPrevChapter and goPrevSlide events are fired (in this order) and if a presentation has been opened already and it has multiple chapters, it will show its previous chapter and previous slide. If it has no multiple chapters, then it will show the previous slide.

    • If first part is DOWN, then goNextSlide event is fired and if a presentation has been opened already, it will show its next slide.

NOTE

Except for the first condition, there is no need for the second part for other commands.

# Ti.App.fireEvent('copyFile')

Copies file from source to destination.

This event considers files source base and makes operation with respect to that.

Example:

Ti.App.fireEvent('copyFile', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  toFilePath: 'myToFilePath',
  sourceURL: 'mySourceURL',
  sourceBinary: true,
  sourceBase64: false
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • toFilePath - file copy operation target path
  • sourceURL - file copy operation source location
  • sourceBinary - the binary data of the file to be saved. Use readAsBinaryString (needs to be polyfilled on IE11) of the FileReader (opens new window) API.
  • sourceBase64 - flag about source being in base64 or not

# Ti.App.fireEvent('getChapterName')

Retrieves chapter name of the given slide.

Example:

Ti.App.fireEvent('getChapterName', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  slideID: 'mySlideID'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • slideID - ID of the slide, used in retrieving chapter name.

# Ti.App.fireEvent('dbFunction')

fab fa-apple fab fa-android

Various operations over DB is handled with this event.

Example:

Ti.App.fireEvent('dbFunction', {
  callBack: 'myCallBackFunc',
  source: 'mySource',
  pType: 'myPType',
  sqlitePath: 'mySQLitePath',
  csvPath: 'myCSVPath',
  wipe: false,
  tableName: 'myTableName',
  db: 'myDB',
  queries: 'myQueries',
  queriesArgs: [['myArg1', 'myArg2'], ['myArg3', 'myArg4']],
  qID: 'myqID',
  query: 'myQuery',
  args: ['myArg1', 'myArg2']
})
  • callBack - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview)
  • pType - main parameter which defines the operation on DB, can be: 'loadSQLite'(needs sqlitePath parameter), 'import'(needs csvPath, wipe, tableName parameters), 'query'(needs db, queries, qID, query parameters).
  • sqlitePath - if pType equals to 'loadSQLite', then this parameter holds the path to the SQLite DB.
  • csvPath - path to the to-be-imported CSV file.
  • wipe - drop DB table with table name?
  • tableName - if pType equals to 'import', then all the operations are done on this table, and this parameter holds the name of the table.
  • db - if searchField is Id, this is used as ID; else, this will be used as name at comparisons in where clauses.
  • queries - if pType equals to 'query', then these queries are executed in DB and for each query, result set is saved with qID.
  • queriesArgs - if pType equals to 'query' and queries is non-empty, then these queries' arguments are used as input parameters for binding to the prepared statement; it is an array of arrays (separate array or args for each query within queries); for each inner array binding values will replace ? in the given query in the order they appear in that query
  • qID - ID of the query.
  • query - if pType equals to 'query' and queries parameter is null, then this query will be executed.
  • args - if pType equals to 'query', this parameter will specify arguments for binding to the prepared statement; binding values will replace ? in the query in the order they appear

NOTE

iOS: One can load DB(pType='loadSQLite'; requires sqlitePath), import CSV files into the DB(pType='import'; requires csvPath, wipe, tableName) and execute queries in DB(pType='query'; requires db, queries, qID, query).

Android: There is no need for source parameter. One can only execute queries in DB(pType='query': db, query, qID). When pType = 'loadSQLite', this event handler evaluates js with callback function parameter in webview only. Therefore parameters will be:

  • pType
  • db
  • query
  • qID
  • callBack

# Ti.App.fireEvent('showAlertBox')

fab fa-apple fab fa-android

Shows alert box. If any of the parameters is null, then it will be treated as empty string.

Example:

Ti.App.fireEvent('showAlertBox', {
  title: 'myTitle',
  message: 'myMessage',
  callBack: 'myCallback',
  source: 'mySource'
})
  • title - title of the alert box
  • message - message of the alert box
  • callBack - callback to be executed on the close button click of alert box
  • source - source of the event, only needed if there is a callback

# Ti.App.fireEvent('saveCache')

Saves the key value pair to the cache as long as both of them exist.

Example:

Ti.App.fireEvent('saveCache', {
  key: 'myKey',
  value: 'myValue'
})
  • key - key for data to-be-cached
  • value - value of data to-be-cached

# Ti.App.fireEvent('getAppConfig')

fab fa-apple fab fa-android

Retrieves application config parameters.

Example:

Ti.App.fireEvent('getAppConfig', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

NOTE

iOS: If there is none, then this method returns '('{}')'.

Android: Only needs parameter callBack as callback function. If callback parameter is empty, than this event simply quits.

# Ti.App.fireEvent('parseAllCRMObjects')

Parses all CRM objects. However, if CRM is synchronizing, then this method will no do anything and returns.

After parsing, this method will create and/or set crmParsed property. If this has not happened, then it means that no structure has been added to DB and it re-adds all of the structures.

While adding structures and making changes to the DB, this will skip these keys:

  • externalPitcherID
  • externalField
  • parentExternalField
  • parentExternalField
  • fieldToUpsert
  • ignoreFields
  • fieldsToNull
  • objectTyp

In case of any exceptions, this method also deletes the crmParsed property, rollbacks all of the changes in DB and if gets a SQL exception including "has no column named" message, it fires itself again.

Example:

Ti.App.fireEvent('parseAllCRMObjects', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

# Ti.App.fireEvent('downloadFile')

Downloads the requested file(s).

In case of successful operation, this event will evaluate to successCallBack. Otherwise, it will evaluate to failureCallBack and checksForUpdates for re-download operation.

Example:

Ti.App.fireEvent('downloadFile', {
  successCallBack: 'mySuccessCallBack',
  fileIDArray: [id0, id1, ...],
  failureCallBack: 'myFailureCallBack',
  source: 'mySource'
})
  • successCallBack - callBack function which is evaluated with targeted WebView in case of successful operation.
  • fileIDArray - array containing files' IDs to be downloaded. If empty, then it will automatically check for updates
  • failureCallBack - callBack function which is evaluated with targeted WebView in case of failed operation.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

# Ti.App.fireEvent('saveDBPDF')

Saves a portion of DB to a PDF file and shows the native path.

This method uses custom caches from app config file; so, if there are none, then this function will fail: Shows a blank screen with no path.

Example:

Ti.App.fireEvent('saveDBPDF', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource',
  customSFID: 'myCustomSFID'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView. If null or false, then it will be 'savedDBPDF'
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • customSFID - information that will be written to PDF is gathered from DB with this ID.

# Ti.App.fireEvent('parseLeads')

Parses the leads, namely tbl_crm_leads_v2 table.

This method has no parameters and works with app config and leadEnabled property in app config only. On all of other cases, it will do nothing.

Example:

Ti.App.fireEvent('parseLeads', {})

# Ti.App.fireEvent('showConfirmBox')

Shows confirm box. If any of title or message is null, then it will be treated as empty string.

On iOS, confirmation box can be closed automatically after a certain timeout in milliseconds with an optional separate callback being called.

Example:

Ti.App.fireEvent('showConfirmBox', {
  title: 'myTitle',
  message: 'myMessage',
  source: 'mySource',
  index: 1,
  yesTitle: 'myYesTitle',
  noTitle: 'myNoTitle',
  confirm: 'confirmFunctionName',  // window.confirmFunctionName must exist
  reject: 'cancelFunctionName',    // window.cancelFunctionName must exist
})
  • title - title of the alert box
  • message - message of the alert box
  • source - iOS-only, define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • yesTitle - text that will be written on yes button. If null, it will be simply 'Yes'.
  • noTitle - text that will be written on no button. If null, it will be simply 'No'.
  • confirm - call back function that will be used if confirmed.
  • reject - call back function that will be used if rejected.
  • autoDismissTimeout - iOS-only, number of milliseconds after which the box will be closed automatically
  • autoDismiss - iOS-only, call back function that will be used if closed automatically. If autoDismissTimeout is provided without autoDismiss callback, the dialog will be closed without executing any callback.

# Ti.App.fireEvent('notifyMainPage')

Notifies mainWebView.

Notification contains contactCreated() message.

Example:

Ti.App.fireEvent('notifyMainPage', {})

# Ti.App.fireEvent('launchExternal')

Launches external browser with given url.

Example:

Ti.App.fireEvent('launchExternal', {
  urlV: 'myURLV',
  openFile: true, 
})
  • urlV - URL to be launched.
  • openFile - parameter to consider if given URL is file path or not, in case this is set then the URL will be considered as name of a pdf in the copiedPdfs folder and the pdf will be be opened on device default viewer. (This parameter is Windows only)

# Ti.App.fireEvent('showShareUI')

Launches Windows share UI to share the given link via different applications.

Example:

Ti.App.fireEvent('showShareUI', {
  link: 'myLink' 
})
  • link - a valid URL ex: ("https://pitcher.com/")

# Ti.App.fireEvent('moveCamera')

Moves camera up or down.

Sets toggle button, microphone toggle button, publisher view button and camera shuffle button bottom parameters.

Only called from native code, so one can ignore this on UI.

Example:

Ti.App.fireEvent('moveCamera', {})

# Ti.App.fireEvent('pitcherWindowOpened')

Makes view arrangement after Pitcher window opened. This method pushes this opened view to the camera holder array.

Example:

Ti.App.fireEvent('pitcherWindowOpened', {
  mode: 'myMode'
})
  • mode - the view mode in which pitcher window opens.
    • accepted values: modal(modal) or presentation(modalWeb)

# Ti.App.fireEvent('pitcherWindowClosed')

Makes view arrangement after Pitcher window closed. This method pops this opened view from the camera holder array.

Example:

Ti.App.fireEvent('pitcherWindowClosed', {})

# Ti.App.fireEvent('openCamera')

Opens the camera to the defined source parameter's webview.

This method publishes camera image for a live meeting.

If there is no internet connection, then it will throw an alert with "Please check your internet connection. You need to be online to be able to use this feature.

Example:

Ti.App.fireEvent('openCamera', {
  targetDevice: 'myTargetDevice',
  source: 'mySource',
  publishTarget: 'myPublishTarget',
  callBack: 'myCallBack'
})
  • targetDevice - recipient's device for a live meeting. If null, then it is set to IE
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • publishTarget - where to publish camera view. If null, then it is set to modal
  • callBack - callBack function which is evaluated with targeted WebView.

# Ti.App.fireEvent('closeCamera')

Closes the camera in a live meeting.

In case of any exceptions thrown while closing the camera, a pitcher alert will be thrown.

Example:

Ti.App.fireEvent('closeCamera', {})

# Ti.App.fireEvent('checkLaunchExternal')

Checks if one can launch external browser to open an URL.

Example:

Ti.App.fireEvent('checkLaunchExternal', {
  protocol: 'myProtocol',
  source: 'mySource',
  callBack: 'myCallBack'
})
  • protocol - protocol used for opening the URL.
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • callBack - callBack function which is evaluated with targeted WebView.

# Ti.App.fireEvent('scanBarcode')

Scans a barcode via camera.

Example:

Ti.App.fireEvent('scanBarcode', {
  source: 'modal',
  failureCallBack: 'successFunction',
  successCallBack: 'failerFunction',
  useScandit: true,
  colorInvertedEnabled: true
})
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).
  • failureCallBack - name of a function that will be evaluated with source webview if it fails
  • successCallBack - name of a function that will be evaluated with source webview if it receives the result
  • useScandit - if true, it sets up Scandit barcode reader and if permissions are handled, lets the user use the camera for the operation.
  • colorInvertedEnabled - if true, allows scanning symbols with inverted colors.

# Ti.App.fireEvent('manageIcons')

Manages icons for the application.

If an instance have custom icon, this will be fired at first initiation of that instance and app icon will be updated automatically.

Example:

Ti.App.fireEvent('manageIcons', {
  iconName: 'myIconName'
})
  • iconName - This is set as default alternate icon name.

# Ti.App.fireEvent('askQR')

Creates a QR code with platformID and deviceName string with lashes.

Example:

Ti.App.fireEvent('askQR', {})

# Ti.App.fireEvent('showHelp')

Shows help texts on the home screen of the Pitcher Impact application.

Example:

Ti.App.fireEvent('showHelp', {})

# Ti.App.fireEvent('getFirstDayOfWeek')

fab fa-windows

Retrieves the first day of the week (in written format, e.g. "Monday") as set up in the app.

Example:

Ti.App.fireEvent('getFirstDayOfWeek', {
  callBack: 'myCallBackFunc'
})
  • callBack - callBack function which is evaluated with targeted WebView

# Ti.App.fireEvent('arrangeQuickPlanningAccount')

fab fa-apple fab fa-windows

Shows a message dialog on quick planning page for selected account and decides if the account needs to be deselected.

Example:

Ti.App.fireEvent('arrangeQuickPlanningAccount', {
  accountId: 'myAccountId',
  isCallAllowed: true,
  message: 'myMessage',
  buttonText: 'myButtonText'              
})
  • accountId - the id of the last selected account on quick planning page
  • isCallAllowed - if true, the account with the given id is deselected
  • message - the information message text on the message dialog
  • buttonText - the text on the button of message dialog

# Ti.App.fireEvent('getOAuthToken')

fab fa-apple

The event starts an OAuth 2.0 Authorization Code Flow and returns an access token to the homescreen.

Example:

Ti.App.fireEvent('getOAuthToken', {
  authorizationEndpoint: 'https://MyDomainName.my.salesforce.com/services/oauth2/authorize',
  tokenEndpoint: 'https://MyDomainName.my.salesforce.com/services/oauth2/token',
  clientID: '3MVG9IHf89I1t8hrvswazsWedXWY0i1qK20PSFaInvUgLFB6vrcb9bbWFTSIHpO8G2jxBLJA6uZGyPFC5Aejq',
  clientSecret: '*******************',
  scope: 'openid email api',
  callBackFunc: 'onOAuthToken'
})
  • authorizationEndpoint
  • tokenEndpoint
  • clientID
  • clientSecret - Optional
  • scope - A string of scopes separated by spaces
  • callBackFunc - A global function called on success or failure

Read more:

# Ti.App.fireEvent('setAccountID')

fab fa-windows

Sets the account id of the ongoing active call.

Example:

Ti.App.fireEvent('setAccountID', {
  accountID: 'myAccountId'            
})
  • accountID - the id that is going to be set as account id of the ongoging active call

# Ti.App.fireEvent('addSfEvent')

fab fa-apple fab fa-windows

This event directly creates a planned call with the given parameters.

Example:

Ti.App.fireEvent('addSfEvent', {
  contactIDs: ['mycontactIDs', ...],
  accountID: 'myaccountID',
  title: 'mytitle',
  start: 'Start date',
  end: 'End date',
  json: '{...}',
  isRemote: true,
  notes: 'notes to save to event object'
})
  • contactIDs - contact/HCP ids that is going to be saved as attenees to the sfEvent
  • accountID - the id that is going to be set as account id for the saved sfEvent
  • title - title for the planned meeting
  • start - start datetime of the sfEvent
  • end - end datetime of the sfEvent
  • json - JSON information for the sfEvent
  • isRemote - to set if the meeting is remote or not

# Ti.App.fireEvent('createCall')

fab fa-apple fab fa-windows

This event creates / updates a planned call with the given parameters.

Example:

Ti.App.fireEvent('createCall', {
  notes: 'Call Notes',
  title: 'Title for the call',
  listOfPeople: ['contacts for the call', ...],
  listOfContent: ['contents of the call', ...],
  startDate:'Start Date',
  endDate: 'End Date',
  accountID: 'myaccountID'
  selectedCallJSON: '{...}',
  skipPlan: '<true | false, specifies if remote event update should be skipped or not>',
  selectedEvent: '{fakeObject: <boolean to specify this is for update an existing call only>, eventId: <existing event Id>, ...}',
})
  • notes - Call notes
  • title - Title of the event
  • listOfPeople - Contact Ids for the event
  • listOfContent - Content Ids of the call
  • startDate - Start datetime of the sfEvent
  • endDate - End datetime of the sfEvent
  • accountID - Account Id
  • selectedCallJSON - Event JSON
  • skipPlan - When true, event update will be skipped, so no event_redirect_planEvent will be fired
  • selectedEvent - If exists and has fakeObject property set to true, event wiğll be retrieved from db by eventId value of this property, and event will be overwritten

# Ti.App.fireEvent('submitPostcallForm')

fab fa-apple

Autosubmits the Post Call Form without any user interaction required.

Example:

Ti.App.fireEvent('submitPostcallForm')

# Ti.App.fireEvent('getKeyboardInfo')

fab fa-apple

Returns the information regarding soft keyboard - its frame size and whether it is opened or not.

Example:

Ti.App.fireEvent('getKeyboardInfo')

# Ti.App.fireEvent('setBackgroundColor')

fab fa-apple

Sets background color of the webview (black by default) to the desired color.

Example:

Ti.App.fireEvent('setBackgroundColor', {
  source: 'modal',
  backgroundColor: '#fff'
})
  • source - identifier of the target webview
  • backgroundColor - CSS color string that can be either a named color or a hex color string

# Ti.App.fireEvent('clearCalendarDuplicates')

fab fa-apple

Clears duplicate events for Calendar by calling clearDuplicateEventsInCalendar function

Example:

Ti.App.fireEvent('clearCalendarDuplicates', {
  start: 'myStartDate',
  end: 'myEndDate',
  clearCallDB: true
})
  • clearCallDB - clears tbl_calls_n_v6 table.
  • start - start date of the event.
  • end - end date of the event.

# Ti.App.fireEvent('markAllAsRead')

Marks all files as viewed.

Example:

Ti.App.fireEvent('markAllAsRead')

# Ti.App.fireEvent('createLocalNotification')

fab fa-apple

Schedules a notification based on defined time in event config

Example:

Ti.App.fireEvent('createLocalNotification', {
  message: "Don't forget your meeting!",
  alertAction: "Open",
  badge: 1,
  time: new Date().getTime() + 60000, // 1 hour from now
  callback: "console.log",
  source: "homescreen"
});
  • message - Custom user message.
  • time - Scheduled time for the message to show in notifications.
  • callback - name of a function that will be evaluated with source webview if it receives the result
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

# Ti.App.fireEvent('removeLocalNotification')

fab fa-apple

Removes scheduled notification based on id received from createLocalNotification callback.

Example:

Ti.App.fireEvent('removeLocalNotification', {
 'notificationId':'notification_1724774705587',
  callback: "console.log",
  source: "homescreen"
});
  • notificationId - notificationId got from createLocalNotification in callback.
  • callback - name of a function that will be evaluated with source webview if it receives the result
  • source - define the targeted web view.
    • accepted values: modal, postcall, precall(modalWebView), homescreen(mainWebView), sfdcWebView(sfdcWebView), popover(initPopover.webview), '' (blank, currentPage's webview).

# Ti.App.fireEvent('dropDB')

fab fa-apple

Drops the local CRM DB by setting local device setting as true and prompting to restart the app.

Example:

Ti.App.fireEvent('dropDB', {});

# Ti.App.fireEvent('removeEvent')

fab fa-apple fab fa-windows

Removes a certain sync box item. Here Id should be given with a single parameter Id, and it should be Id of the event retrieved from native.

Example:

Ti.App.fireEvent('removeEvent', {Id: 5});