Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Embed Engagement Messenger in a native iOS app using Now Mobile SDK - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Embed Engagement Messenger in a native iOS app using Now Mobile SDK
KB1587276

Embed Engagement Messenger in a native iOS app using Now Mobile SDK


577 Views Last updated : Feb 20, 2024 All Users, Any User, public Copy Permalink

This topic provides steps to embed Engagement Messenger in a native iOS Mobile App built with Swift. 

Pre-requisite: 

To embed Engagement Messenger in the native applications, the developer or user needs to configure the following:

  • Now Mobile SDK libraries in the application. For more information, see Mobile SDK Libraries – iOS in the ServiceNow® store.
  • Mobile SDK Plugin and OAuth JWT Authentication on your ServiceNow Instance. For more details, see Mobile SDK API reference - iOS.
  • Install and configure the latest version of Engagement Messenger (Support v5.2 onwards) in your ServiceNow instance. For more details, see Setting up Engagement Messenger.
  • Copy the Engagement Messenger module ID, as you need it to embed messenger in the mobile app.

Procedure 

  1. Copy “EngagementMessengerUtil.swift” file to your application project from the SampleApp project.
  2. In the View Controller file where Engagement Messenger needs to be embedded, configure EngagementMessengerUtil in the init function.

    private var emUtils : EngagementMessengerUtil! 

    init() { 

       let instanceUrl = “” //specify the Url of your instance e.g. https://instancename.service-now.com 

       let moduleId = “” //specify the sys_id of Engagement Messenger module or copy the module Id from Engagement Messenger embed code 

       let emUtils = EngagementMessengerUtil(instanceUrl: instanceUrl, moduleId: moduleId, parentViewController: self) 

       emUtils.initializeWebService() 

    }

  3.  On any click event or function, the loadEMfeature() function can launch Engagement Messenger on the View Controller.

    //  Open Engagement Messenger Home 

    emUtils.loadEMfeature() 


  4.  Use the Deep linking functionality to launch specific features on Engagement Messenger by passing the feature name as a parameter in the loadEMfeature function. For more details, see Deep Linking Features in Engagement Messenger.

    //  Open Engagement Messenger feature 

    emUtils.loadEMfeature("CHAT") 

    //  Open Engagement Messenger feature with parameters 

    var params : [String: String] = [ "sys_kb_id" : sys_kb_id ] 

    emUtils.loadEMfeature(feature: "VIEW_ARTICLE", params: params) 

 

To see how Engagement Messenger works in the mobile application, developers can refer to the SampleApp Project that is available with Mobile SDK Libraries as SampleApp.zip and check how Engagement Messenger is implemented and configured in the Sample App. 


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.