### Example HTML Implementation for MeetingDoctors SDK Source: https://developer.meetingdoctors.com/web/installation A complete HTML file demonstrating the integration of the MeetingDoctors SDK, including the container element and script initialization. ```HTML
``` -------------------------------- ### Call MeetingDoctors Initialize Method Source: https://developer.meetingdoctors.com/web/legacy/installation This example demonstrates how to call the MeetingDoctors SDK's initialize method with the necessary arguments, such as JWT and containerId, to render the application. ```JavaScript meetingDoctors.initialize({...args}); ``` -------------------------------- ### Start Videocall (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/7to8 Demonstrates the change in initiating a video call. The `deeplink` method for videocalls has been replaced with a dedicated `startVideocall` static method, featuring an updated completion handler. ```Swift public class func deeplink( _ deeplinkOption: MeetingDoctorsDeeplinkOption, origin: UIViewController? = nil, animated: Bool = true, completion: @escaping ((MeetingDoctorsResult) -> Void) ) ``` ```Swift public static func startVideocall( origin: UIViewController? = nil, animated: Bool = true, completion: @escaping @Sendable (Swift.Result) -> Void ) ``` -------------------------------- ### Application Launch Configuration for MeetingDoctors (Objective-C/Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/installation Provides an example of how to initialize the MeetingDoctors SDK within the `didFinishLaunchingWithOptions` method of your application delegate. It includes setting up the configuration with an API key and handling the returned UUID. ```swift func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { ... let configuration = MeetingDoctors.Configuration(apikey: apikey) let uuid = try await MeetingDoctors.initialize(configuration: configuration) ... } ``` -------------------------------- ### Initialize VideoCallClient Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Videocall/Installation Initializes the VideoCallClient in the Application's onCreate() method. This requires an API key, installation GUID, encryption settings, environment mode, and optional locale. ```Kotlin VideoCallClient.initialize( this, , , true/false, "yourEncryptionPassword", object : VideoCallClient.InitResponseListener { override fun onInitSuccess() { } override fun onInitFailure(s: String?) { } }, //You must set a value from enum class VideoCallBuildMode VideoCallBuildMode.DEV/STAGING/PROD, // If you do not want to set specific locale just set to null, //Locale configuration will be handled by Android system as usual //e.g. Locale locale = Locale("es") "yourLocaleLanguage" ) ``` -------------------------------- ### Firebase Messaging Service Worker Setup and Message Handling Source: https://developer.meetingdoctors.com/web/legacy/push-notifications This snippet sets up the Firebase Messaging service worker, initializes the Firebase app, and defines the onBackgroundMessage handler. It processes incoming push notifications, parses payload data, and displays notifications to the user. It also includes logic to send messages to client windows and handle different notification types. ```javascript // Give the service worker access to Firebase Messaging. // Note that you can only use Firebase Messaging here, other Firebase libraries // are not available in the service worker. importScripts('https://www.gstatic.com/firebasejs/10.12.2/firebase-app-compat.js'); importScripts('https://www.gstatic.com/firebasejs/10.12.2/firebase-messaging-compat.js'); // Function to parse new format of payload notification (function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e["payload-notification"]={}))})(this,function(e){"use strict";const i=t=>{try{return JSON.parse(t)}catch{return t}};function r(t){return Object.entries(t.data).reduce((d,[c,f])=>(d[c]=i(f),d),{})}const o=t=>{try{return!("data"in t.data)}catch{return!0}},a=t=>{if(o(t)){const n=r(t);return{data:{data:JSON.stringify(n)}}}return t};self.customPayloadNotification={isPayloadNotificationNew:o,payloadNotificationMiddleware:a},e.isPayloadNotificationNew=o,e.payloadNotificationMiddleware=a,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}); //////////////////////////////////////////////////////////////////////////////////////////// // FIREBASE WEB CREDENTIALS - https://firebase.google.com/docs/web/learn-more#config-object firebase.initializeApp({ apiKey: "", authDomain: "", databaseURL: "", projectId: "", storageBucket: "", messagingSenderId: "", appId: "", measurementId: "", }); //////////////////////////////////////////////////////////////////////////////////////////// const messaging = firebase.messaging(); messaging.onBackgroundMessage(function (backgroundMessage) { try { if (backgroundMessage.data && backgroundMessage.data.type === "silent") { return; } } catch (_) {} const payload = self.customPayloadNotification.payloadNotificationMiddleware(backgroundMessage); const pushMessage = payload.data; const pushMessageData = JSON.parse(pushMessage.data); pushMessageData.company = "MD" const promiseChain = clients.matchAll({ type: "window", includeUncontrolled: true }) .then(windowClients => { for (let i = 0; i < windowClients.length; i++) { const windowClient = windowClients[i]; windowClient.postMessage(pushMessageData); } }) .then(() => { if (!['video-consultations', 'consultations'].includes(pushMessageData.module)) { return null; } var tag = null; switch (pushMessageData.type) { case "open_url": return self.registration.showNotification(pushMessageData.title, { body: pushMessageData.message, tag: pushMessageData.type, data: {url: pushMessageData.url} }); case 'video_consultation:assigned': case 'video_call:calling': case 'video_consultation:cancelled': tag = 'videoCall'; break; case 'push-notifications.new_video_consultation:assigned': return self.registration.showNotification(pushMessageData.message.title, { body: pushMessageData.message.body, icon:pushMessageData.professional.avatar, tag: pushMessageData.type, }); case 'message_created': tag = pushMessageData.room_id; break; } return self.registration.showNotification(pushMessageData.message.title, { body: pushMessageData.message.body, icon:pushMessageData.professional.avatar, tag, badge: 1, }); }); return promiseChain; }); ``` -------------------------------- ### Generate Installation GUID Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Videocall/Installation Provides a method to generate a unique Installation GUID using device identifiers, SDK version, model, API key, and a random number. ```Java UUID.nameUUIDFromBytes( (Settings.Secure.getString( context.contentResolver, Settings.Secure.ANDROID_ID ) + Build.VERSION.RELEASE + Build.MODEL + Repository.apiKey + Math.random()).toByteArray() ).toString() ``` -------------------------------- ### Open Chat Window Conditionally Source: https://developer.meetingdoctors.com/web/legacy/push-notifications This snippet checks if a widget is not on a tab and, if true, opens a new chat window. It uses asynchronous operations to handle the window opening. ```javascript if (!widgetOnTab) { await clients.openWindow('/#/chat'); } ``` -------------------------------- ### Initialize Firebase Messaging Service Worker Source: https://developer.meetingdoctors.com/web/legacy/push-notifications This JavaScript snippet demonstrates how to initialize the Firebase app within a service worker file for receiving push notifications. It requires Firebase configuration details. ```javascript importScripts('https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js'); importScripts('https://www.gstatic.com/firebasejs/8.10.0/firebase-messaging.js'); // Initialize Firebase const firebaseConfig = { apiKey: "YOUR_API_KEY", authDomain: "YOUR_AUTH_DOMAIN", projectId: "YOUR_PROJECT_ID", storageBucket: "YOUR_STORAGE_BUCKET", messagingSenderId: "YOUR_MESSAGING_SENDER_ID", appId: "YOUR_APP_ID" }; firebase.initializeApp(firebaseConfig); // Retrieve Firebase Messaging const messaging = firebase.messaging(); // Handle incoming messages messaging.onMessage(function(payload) { console.log('Message received. ', payload); // ... }); ``` -------------------------------- ### Handle Consultation List Errors Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/features/consultation-list Provides examples of handling specific exceptions that may occur when retrieving the consultation list, such as framework initialization failure or installation not being created. ```swift MeetingDoctorsError.illegalStateException(reason: .frameworkInitializationFailed)) ``` ```swift MeetingDoctorsError.illegalStateException(reason: .installationNotCreated)) ``` -------------------------------- ### Handle Videocall Initiation Errors in Swift Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/features/videocall Provides examples of specific MeetingDoctors errors that can occur during videocall initiation. These include framework initialization failures, issues with installation creation, and the video call being forbidden for the user. ```swift MeetingDoctorsError.illegalStateException(reason: .frameworkInitializationFailed)) ``` ```swift MeetingDoctorsError.illegalStateException(reason: .installationNotCreated)) ``` ```swift MeetingDoctorsError.videoCall(reason: .videoCallForbidden)) ``` -------------------------------- ### Listen to Meetingdoctors SDK Events (TypeScript) Source: https://developer.meetingdoctors.com/web/legacy/installation The `on` method enables listening to events emitted by the Meetingdoctors SDK. This example demonstrates how to subscribe to the 'roomOpened' event and log a message when it occurs. Ensure the SDK is properly initialized before using this method. ```typescript /** * The `on` method allows you to listen to events emitted by the SDK. * * Events currently available: * * - `termsAccepted`: Emitted when the user accepts the terms and conditions (it depends on the company configuration). * * - `firstSessionMessage`: Emitted when the user sends a message for the first time in a session. * * - `roomOpened`: Emitted when the user opens a room. * * @param {'termsAccepted' | 'firstSessionMessage' | 'roomOpened'} eventName - The name of the event to listen to. * @param {void} callback - The function to call when the event is emitted. * * @example * window.meetingdoctors.on('roomOpened', () => { * console.log('📝 roomOpened'); * }); * */ on(eventName: 'termsAccepted' | 'firstSessionMessage' | 'roomOpened', callback: void): void; ``` -------------------------------- ### Videocall Implementation Example in Swift Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/features/videocall Demonstrates how to call the `startVideocall` function and handle both successful initiation and potential errors using a do-catch block. ```swift do { let viewController = try await MeetingDoctors.startVideocall(origin: self) // Handle success } catch { // Handle error } ``` -------------------------------- ### Declare SDK Dependency (Gradle) Source: https://developer.meetingdoctors.com/mobile/android/sdkchat/installation Adds the MeetingDoctors customer chat SDK as an implementation dependency in the app's build.gradle file. Replace `{last_version}` with the latest available version. ```Gradle implementation 'com.meetingdoctors:customer-chat-sdk:{last_version}' ``` -------------------------------- ### Initialize MeetingDoctors SDK (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/6to7 Compares the 'From' and 'To' versions of the `initialize` method for the MeetingDoctors SDK. The 'To' version removes the `UIApplication` and `options` parameters. ```Swift public class func initialize( _ application: UIApplication, with configuration: MeetingDoctors.Configuration, options _: [UIApplication.LaunchOptionsKey: Any]?, completion: ((MeetingDoctorsResult) -> Void)? = nil ) -> UUID? ``` ```Swift public class func initialize( with configuration: MeetingDoctors.Configuration, completion: ((MeetingDoctorsResult) -> Void)? = nil ) -> UUID? ``` -------------------------------- ### Initialize MeetingDoctors SDK Source: https://developer.meetingdoctors.com/web/installation Initializes the MeetingDoctors SDK with provided configuration. Requires widgetId, companySlug, companyId, lang, displayMode, containerId, authType, and optionally a token for SSO. ```JavaScript window.MeetingDoctors.init({ widgetId: "", companySlug: "", companyId: "", lang: "en", displayMode: "embed", containerId: "root", authType: "sso", token: "", // Optional SSO-only parameters: isolatedView: { type: "chat", // enum: "chat" | "video_call" | "medical_history" data: { specialtyId: 1, // integer ID of a specialty required by type "chat" // or specialtyCode: "general" // string code of a specialty required by type "video_call" } } }); ``` -------------------------------- ### Start Videocall in Swift Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/features/videocall Initiates a videocall using the MeetingDoctors SDK. It can be presented from a specified origin view controller and with optional animation. The function is asynchronous and can throw errors if the framework is not initialized, the installation is not created, or the feature is not enabled for the user. ```swift public static func startVideocall(origin: UIViewController? = nil, animated: Bool = true) async throws ``` -------------------------------- ### Initialize MeetingDoctors SDK with Configuration (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/installation Demonstrates the initialization of the MeetingDoctors SDK using a configuration object containing an API key. This asynchronous method returns a UUID upon successful initialization. ```swift public static func initialize(configuration: MeetingDoctors.Configuration) async throws -> UUID ``` -------------------------------- ### Get MyHealth View Controller (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/7to8 Illustrates the migration of the `myHealthViewController` method. The new version adopts a completion handler pattern for asynchronous execution, returning a Swift Result type. ```Swift public class func myHealthViewController() -> MeetingDoctorsResult ``` ```Swift public static func myHealthViewController( completion: @escaping (Swift.Result ) -> Void) ``` -------------------------------- ### Get Booking View Controller (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/7to8 Outlines the migration of the `bookingViewController` method. The new signature employs a completion handler for asynchronous operations, returning a Swift Result type for better error management. ```Swift public class func bookingViewController() -> MeetingDoctorsResult ``` ```Swift public static func bookingViewController( completion: @escaping (Swift.Result ) -> Void) ``` -------------------------------- ### Get Professional List View Controller (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/7to8 Details the changes in retrieving the professional list view controller. The method signature has been updated to use Swift's `any` protocol syntax and a completion handler for asynchronous operations. ```Swift public class func professionalListViewController( with filter: MeetingDoctorsSDK.MeetingDoctorsFilterType = MeetingDoctorsFilter.default, showHeader: Bool = false, divider: (MeetingDoctorsSDK.MeetingDoctorsDividerType)? = nil, topDividers: [MeetingDoctorsSDK.MeetingDoctorsDividerType]? = [], onUpdateLayout listener: ((CGSize) -> Void)? = nil ) -> MeetingDoctorsSDK.MeetingDoctorsResult ``` ```Swift public static func professionalListViewController( filter: any MeetingDoctorsFilterType = MeetingDoctorsFilter.default, showHeader: Bool = false, divider: (any MeetingDoctorsDividerType)? = nil, // status 3 topDividers: [any MeetingDoctorsDividerType]? = [], completion: @escaping @Sendable(Swift.Result) -> Void ) ``` -------------------------------- ### Initialize MeetingDoctors SDK (Kotlin) Source: https://developer.meetingdoctors.com/mobile/android/sdkchat/installation Initializes the MeetingDoctors SDK with essential parameters such as the API key, build mode (DEV/STAGING/PROD), data encryption settings, and locale. This should be done once, typically in the Application class. ```Kotlin MeetingDoctorsClient.newInstance(this, "", CustomerSdkBuildMode.DEV/STAGING/PROD, true/false, "yourEncryptionPassword", // If ENABLE_DATA_ENCRYPTION is false -> "" "yourLocaleLanguage"); //e.g. val locale = Locale("es") //If you do not want to set specific local just set to null, //Locale configuration will be handled by Android system as usual ``` -------------------------------- ### Import MeetingDoctors SDK in AppDelegate (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/installation This snippet shows how to import the MeetingDoctorsSDK into your AppDelegate file in Swift, which is a prerequisite for initializing the framework. ```swift import MeetingDoctorsSDK ``` -------------------------------- ### Initialize MeetingDoctors SDK (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/7to8 Migrates the SDK initialization method from version 7.x.x to 8.x.x. The new version uses a static method and a different completion handler signature. ```Swift public class func initialize( _ application: UIApplication = UIApplication.shared, with configuration: MeetingDoctorsSDK.MeetingDoctors.Configuration, options _: [UIApplication.LaunchOptionsKey : Any]?, completion: ((MeetingDoctorsSDK.MeetingDoctorsResult) -> Void)? = nil ) -> UUID? ``` ```Swift public static func initialize( configuration: MeetingDoctors.Configuration, completion: @escaping @Sendable (Swift.Result) -> Void ) ``` -------------------------------- ### Initialize MeetingDoctors SDK in HTML Source: https://developer.meetingdoctors.com/web/legacy/installation This snippet shows how to include the MeetingDoctors SDK script and initialize it within an HTML document. It demonstrates setting essential parameters like apiKey, jwt, displayMode, and language. ```HTML // Main app styles // Custom app styles (depending on your configuration) ... // Main app script // App initializer ... ``` -------------------------------- ### Listen for MeetingDoctors SDK Events Source: https://developer.meetingdoctors.com/web/installation Attaches an event listener to the MeetingDoctors SDK to react to specific events, such as when the SDK is ready. ```JavaScript window.MeetingDoctors.on("meeting_doctors_ready", (data) => { // The SDK is fully loaded and ready }); ``` -------------------------------- ### Get Feeds View Controller (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/7to8 Details the migration of the `feedsViewController` method. The updated method utilizes a completion handler for asynchronous retrieval of the view controller, returning a Swift Result. ```Swift public class func feedsViewController() -> MeetingDoctorsResult ``` ```Swift public static func feedsViewController( completion: @escaping (Swift.Result ) -> Void) ``` -------------------------------- ### Add Maven Repository (Gradle) Source: https://developer.meetingdoctors.com/mobile/android/sdkchat/installation Updates the project's build.gradle file to include the new Maven repository URL for the MeetingDoctors SDK. This allows Gradle to download the SDK artifacts. ```Gradle allprojects { repositories { .... maven { url "https://storage.googleapis.com/production-mobile-sdks/android/" } .... } ``` -------------------------------- ### Login User Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Videocall/Installation Logs in a user to the MeetingDoctors service using a user token. The listener provides callbacks for successful login or failure. ```Kotlin VideoCallClient.login(, object : VideoCallClient.LoginResponseListener{ override fun onLoginSuccess() { /* Your code here */ } override fun onLoginFailure(message: String?) { /* Your code here */ } }) ``` -------------------------------- ### Declare SDK Dependency Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Videocall/Installation Adds the MeetingDoctors video call SDK as a dependency in the app's module-level build.gradle file. Replace '{last_version}' with the latest SDK version. ```Gradle implementation 'com.meetingdoctors:videocall-sdk:{last_version}' //See Release Notes ``` -------------------------------- ### Notification Click Handling in Service Worker Source: https://developer.meetingdoctors.com/web/legacy/push-notifications This snippet handles the 'notificationclick' event for the service worker. It closes the notification and performs actions based on the notification's tag, such as opening a specific URL, posting a message to client tabs, or opening a new window. It prioritizes focusing an existing tab if available. ```javascript addEventListener('notificationclick', event => { event.notification.close(); event.waitUntil(async function () { if (event.notification.tag === 'push-notifications.new_video_consultation:assigned') { const tabs = await clients.matchAll({ type: 'window', includeUncontrolled: true }); const dataToSend = {data: {type: event.notification.tag}} const destinationUrl = '/?notificationData=' + encodeURIComponent(JSON.stringify(dataToSend)) let widgetOnTab = false; for (const tab of tabs) { if ('focus' in tab) { tab.postMessage(dataToSend); widgetOnTab = true; return tab.focus(); } } if (!widgetOnTab) { await clients.openWindow('/#/chat'+ destinationUrl); } return; } const tabs = await clients.matchAll({ type: 'window', includeUncontrolled: true }); let widgetOnTab = false; if (event.notification.tag === "open_url") { await clients.openWindow(event.notification.data.url); return; } for (const tab of tabs) { tab.focus(); widgetOnTab = true; break; } ``` -------------------------------- ### User Information Response Example (JSON) Source: https://developer.meetingdoctors.com/API/S2S%20%C2%B7%20User/retrieve-user This snippet provides an example of the JSON response when retrieving user information. It illustrates the structure and data types for various user attributes, including personal details and feature flags. ```JSON { "token": "12345678Z", "status": 2, "email": "soporte@meetingdoctors.com", "nid_number": "12345678Z", "firstname": "Soporte", "lastname": "MeetingDoctors", "gender": 0, "birthdate": "1990-01-01", "mobile_phone": "612345678", "description": "", "features": { "video_call:": 1, "video_call_1to1:": 1 }, "company_group_code": "" } ``` -------------------------------- ### Implement Booking Process - Swift Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/features/booking An example demonstrating how to invoke the booking process using the `bookingWebviewController` function. It includes a do-catch block for handling both successful booking and potential errors. ```swift do { let booking = try await MeetingDoctors.bookingWebviewController() // Handle success } catch { // Handle error } ``` -------------------------------- ### Enable Screenshots Captures Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Videocall/Installation Demonstrates how to enable the screenshots capture feature by calling setScreenshotsCapturesEnabled(true) during VideoCallClient initialization. ```Kotlin VideoCallClient.initialize( this, , , true/false, "yourEncryptionPassword", object : VideoCallClient.InitResponseListener { override fun onInitSuccess() { } override fun onInitFailure(s: String?) { } }, //You must set a value from enum class VideoCallBuildMode VideoCallBuildMode.DEV/STAGING/PROD, // If you do not want to set specific locale just set to null, //Locale configuration will be handled by Android system as usual //e.g. Locale locale = Locale("es") "yourLocaleLanguage" ).setScreenshotsCapturesEnabled(true) ``` -------------------------------- ### Add Maven Repository Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Videocall/Installation Updates the build.gradle file to include the MeetingDoctors SDK repository. This ensures that the SDK dependencies can be resolved correctly. ```Gradle allprojects { repositories { .... maven { url "https://storage.googleapis.com/production-mobile-sdks/android/" } .... } ``` -------------------------------- ### Set Kotlin Version (Gradle) Source: https://developer.meetingdoctors.com/mobile/android/sdkchat/installation Defines the minimum Kotlin version required for the project, ensuring compatibility with SDK version 1.46.0 or later. The specified version is 1.8.0. ```Gradle ext.kotlin_version = '1.8.0' ``` -------------------------------- ### Cordova Manifest Activities Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Videocall/Installation Lists the necessary activity declarations to be included in the AndroidManifest.xml file when using the MeetingDoctors SDK with Cordova. ```XML ``` ```XML ``` ```XML ``` ```XML ``` ```XML ``` ```XML ``` -------------------------------- ### Set Minimum SDK Version (Gradle) Source: https://developer.meetingdoctors.com/mobile/android/sdkchat/installation Specifies the minimum Android API level required for the project. This ensures compatibility with devices running Android 6.0 (API 23) or higher. ```Gradle minSdkVersion: 23 ``` -------------------------------- ### Authenticate User (Kotlin) Source: https://developer.meetingdoctors.com/mobile/android/sdkchat/installation Authenticates a user with the MeetingDoctors SDK using a user token. This process involves providing a callback listener to handle successful authentication or authentication errors. ```Kotlin MeetingDoctorsClient.instance?.authenticate(token,object: MeetingDoctorsClient.AuthenticationListener { override fun onAuthenticated() { /* your code here */ } override fun onAuthenticationError(throwable: Throwable) { /* your code here */ } }) ``` -------------------------------- ### Fix Moshi Adapter and Installation Object Parameter Source: https://developer.meetingdoctors.com/mobile/android/videocall/release-notes This snippet covers fixes related to adding a Moshi adapter for the videocallpush object and correcting the name parameter on the Installation object, as noted in version 3.0.14. ```General Fix add moshi adapter for videocallpush object Fix name parameter on Installation object ``` -------------------------------- ### Set Minimum SDK Version Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Videocall/Installation Specifies the minimum Android SDK version required for the MeetingDoctors SDK. This is a crucial setting in the app's build.gradle file. ```Gradle minSdkVersion: 23 ``` -------------------------------- ### Get Professional List Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Chat/Exposed/Methods Retrieves a list of professionals. Requires initialization and authentication of the SDK. It uses a listener to handle the response or errors. ```Kotlin MeetingDoctorsClient.instance.getProfessionalList(object : MeetingDoctorsClient.GetProfessionalListListener{ override fun onResponse(professionals: List?) { } override fun onError(error: Throwable) { } }) ``` -------------------------------- ### Generate Custom CSS Theme Source: https://developer.meetingdoctors.com/web/legacy/installation This command shows how to generate a custom CSS theme for the MeetingDoctors SDK using npm. It involves setting a brand variable and running a specific script. ```Shell BRAND=someBrand npm run theme-generate ``` -------------------------------- ### Customize MeetingDoctors SDK Display Options (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/6to7 Illustrates the changes in customization flags for the MeetingDoctors SDK. It shows how options like `showCollegiateNumber` and `showProfessionalListHeader` are now accessed through `MeetingDoctors.style?.flags`. ```Swift /// Whether the collegiate number should appear next to the speciality in professional profile. showCollegiateNumber: Bool? ``` ```Swift /// Show header of professional list. showProfessionalListHeader: Bool? ``` ```Swift /// Whether the collegiate number should appear next to the speciality in professional profile. MeetingDoctors.style?.flags.professionalList.showCollegiateNumber: Bool? ``` ```Swift /// Show header of professional list. MeetingDoctors.style?.flags.professionalList.showHeader: Bool? ``` -------------------------------- ### Enable Screenshots Feature (Kotlin) Source: https://developer.meetingdoctors.com/mobile/android/sdkchat/installation Configures the MeetingDoctors SDK to enable or disable screenshot capture functionality. This is done by chaining the `setScreenshotsCapturesEnabled` method after initialization. ```Kotlin MeetingDoctorsClient.newInstance(this, "", CustomerSdkBuildMode.DEV/STAGING/PROD, true/false, "yourEncryptionPassword", "yourLocaleLanguage") .setScreenshotsCapturesEnabled(true/false); ``` -------------------------------- ### MeetingDoctors SDK Error Handling (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/features/chat This section outlines specific errors that can occur when interacting with the MeetingDoctors SDK, such as framework initialization failures or issues with creating an installation. These errors are represented by the MeetingDoctorsError enum. ```swift MeetingDoctorsError.illegalStateException(reason: .frameworkInitializationFailed)) ``` ```swift MeetingDoctorsError.illegalStateException(reason: .installationNotCreated)) ``` -------------------------------- ### Authenticate MeetingDoctors SDK (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/7to8 Shows the migration of the authentication method for the MeetingDoctors SDK. The 'authenticate' method signature has been updated for better error handling with Swift's Result type. ```Swift public class func authenticate( token: String, completion: @escaping (MeetingDoctorsResult) -> Void ) ``` ```Swift static func authenticate( token: String, completion: @escaping @Sendable (Swift.Result) -> Void ) ``` -------------------------------- ### Handle Booking Errors - Swift Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/features/booking Provides specific error cases for booking operations, including framework initialization, installation creation, and feature enablement. These errors are crucial for robust application development. ```swift MeetingDoctorsError.illegalStateException(reason: .frameworkInitializationFailed)) ``` ```swift MeetingDoctorsError.illegalStateException(reason: .installationNotCreated)) ``` ```swift MeetingDoctorsError.booking(reason: .notEnabled)) ``` -------------------------------- ### Authenticate User Request Source: https://developer.meetingdoctors.com/API/S2S%20%C2%B7%20User/authenticate-user This snippet shows the HTTP GET request to authenticate a user. It requires an apiKey, secretKey, installationGuid, and userToken. The response contains sessionToken, userHash, and jwt. ```HTTP GET https://customer.staging.meetingdoctors.com/2/authenticate?installationGuid=bc19c506-92be-11ed-a1eb-0242ac120002&userToken=$2a$15$h7Rhbx/iqLRMNbnVDP0LLOxuE2hYEmMCeQpnjJkO40LROjFFMGqz2... Headers: apiKey: Integration identifier provided by MeetingDoctors secretKey: Security key provided by MeetingDoctors to securize server-to-server communications Content-Type: application/json Accept: application/json ``` -------------------------------- ### Get Medical History View Controller (Swift) Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/migration/7to8 Shows the updated signature for `medicalHistoryViewController`. The method now uses a completion handler to return the view controller asynchronously, incorporating Swift's Result type for error management. ```Swift public class func medicalHistoryViewController() -> MeetingDoctorsResult ``` ```Swift public static func medicalHistoryViewController( completion: @escaping (Swift.Result ) -> Void) ``` -------------------------------- ### Consultation Closed Event Payload Example Source: https://developer.meetingdoctors.com/webhooks/event-webhooks Provides an example of the JSON payload for the 'consultation_closed' webhook event. This payload includes details about the consultation, customer, customer usage, and company information. ```json { "room_closing_log": { "room_closing_log_id": 34123, "speciality_consultation_type_id": 52, "speciality_consultation_type_name": "Dermatologia", "room_id": 23 }, "consultation": { "status": "resolved", "reason": "Solicitud pruebas diagnósticas", "additional_classification": "Pruebas de alergias", "diagnosis_icd11_code": "CA00", "diagnosis_icd11_text": "Nasofaringitis aguda" }, "customer": { "token": "00000000A", "hash": "13d960ac-3f15-499a-b16e-67641fd793a3" }, "customer_usage": { "services_limit": 40, "services_used": 1, "period": { "start_date": "2025-09-01", "end_date": "2025-09-30" }, "remaining_services": 39 }, "company": { "api_key": "09hr2hpo0va" } } ``` -------------------------------- ### Update User Request Body Example Source: https://developer.meetingdoctors.com/API/S2S%20%C2%B7%20User/update-user Provides an example of the JSON payload required to update a user's details. It includes fields for status, email, personal information, and feature enablement. ```JSON { "email": "soporte@meetingdoctors.com", "nid_number": "12345678Z", "firstname": "Soporte", "lastname": "MeetingDoctors", "status": 2, "gender": 0, "birthdate": "1990-01-01", "description": "", "has_video_call": 1, "has_video_call_1to1": 1, "company_group_code": "" } ``` -------------------------------- ### Retrieve User Information (HTTP GET) Source: https://developer.meetingdoctors.com/API/S2S%20%C2%B7%20User/retrieve-user This snippet shows the HTTP GET request to retrieve user information from the MeetingDoctors API. It includes the endpoint URL and required headers for authentication and content type. ```HTTP GET https://customer.staging.meetingdoctors.com/api/v3/pendingCompanyUsers/{token} Headers: apiKey: Integration identifier provided by MeetingDoctors secretKey: Security key provided by MeetingDoctors to securize server-to-server communications Content-Type: application/json ``` -------------------------------- ### Logout from MeetingDoctors SDK Source: https://developer.meetingdoctors.com/web/installation Logs the user out and clears the current session within the MeetingDoctors SDK. ```JavaScript window.MeetingDoctors.logout(); ``` -------------------------------- ### Remove MeetingDoctors SDK Event Listener Source: https://developer.meetingdoctors.com/web/installation Removes an event listener from the MeetingDoctors SDK, stopping it from reacting to specified events. ```JavaScript window.MeetingDoctors.off("meeting_doctors_ready"); ``` -------------------------------- ### MeetingDoctors Maintenance Notifications Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/features/maintenance-mode This snippet shows how to observe notifications from the MeetingDoctors SDK related to maintenance mode. It covers the notification for when maintenance starts and when it ends. ```swift // Will notify if the Service has been setup to maintenance Notification.Name.MeetingDoctors.Maintain.Started // Will notify maintenance has been completed Notification.Name.MeetingDoctors.Maintain.Ended ``` -------------------------------- ### Launch Professional List Activity Source: https://developer.meetingdoctors.com/Mobile/Android/SDK%20Chat/Features/Professional%20List Enables launching the professional list as a separate activity within the application. This includes passing context and a toolbar image resource for customization. ```Java MeetingDoctorsClient.instance.launchProfessionalList(context,R.drawable.yourToolbarImage) ``` -------------------------------- ### Configure App ID Details Source: https://developer.meetingdoctors.com/mobile/ios/apple-developer/identifiers This section details the configuration steps for creating an App ID. It includes entering a descriptive name, choosing between an Explicit or Wildcard Bundle ID, and enabling necessary app capabilities such as Push Notifications and Associated Domains. ```text Description: Enter a name for your App ID to identify it within your developer account. Bundle ID: Choose either "Explicit" or "Wildcard" for your App ID type. - Explicit: is used for a single app. It is unique to one app and is typically in reverse-domain name format, e.g., com.companyname.appname. - Wildcard: can be used for multiple apps and is defined with an asterisk at the end, e.g., com.companyname.* - Capabilities: Enable specific app services like Push Notifications, iCloud, HealthKit, etc., by checking the appropriate boxes. These services are part of your app's entitlements and require proper configuration in both your app and the Apple Developer portal. **Associated Domains** and **Push Notifications** required. ``` -------------------------------- ### Get Professional List Source: https://developer.meetingdoctors.com/mobile/ios/chat-vc/exposed/methods Instantiate MDConsultationMainViewController and call consultationViewController to retrieve the raw data of the professional list. This method supports filtering, header display, and dividers. ```swift public static func consultationViewController( filter: any MeetingDoctorsFilterType = MeetingDoctorsFilter.default, showHeader: Bool = true, divider: (any MeetingDoctorsDividerType)? = nil, topDividers: [any MeetingDoctorsDividerType]? = [] ) throws -> UIViewController ``` -------------------------------- ### User Banned Event Payload Example Source: https://developer.meetingdoctors.com/webhooks/event-webhooks Demonstrates the JSON payload for the 'user_banned' webhook event. This payload includes the customer's token and the reason for the ban. ```json { "customer": { "token": "00000000A" }, "reason": "Mal uso del servicio." } ```