Developer Docs | Kommunicate

Developer Docs | Kommunicate

  • Try For Free
  • Docs

›Ionic/Capacitor

Web

  • Installation
  • CMS Installation
  • Authentication
  • Conversation
  • Conversation Assignment
  • Customization
  • Localization
  • Logout
  • Troubleshooting

Android

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Migration
  • Troubleshooting

iOS

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Troubleshooting

React Native

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Logout

Flutter

  • Installation
  • Authentication
  • Customization
  • Conversation
  • Push Notification
  • Localization
  • Troubleshooting

Ionic/Cordova/Phonegap

  • Installation
  • Authentication
  • Push Notification
  • Conversation
  • Customization
  • Localization
  • Logout
  • Resolving Errors

Ionic/Capacitor

  • Installation
  • Authentication
  • Push notification
  • Customization

Rich Messages

  • How To Use
  • Types of Rich Messages

Bots

  • Bot setup
  • Dialogflow Integration
  • Lex Integration
  • Kompose Bot Builder
  • IBM Watson Integration
  • Custom Bot Integration
  • Import Kompose Bot
  • Bot Samples

Integrations

  • Zapier
  • WhatsApp
  • WhatsApp 360Dialog
  • WhatsApp Twilio
  • WhatsApp Cloud API

Platform APIs

  • Authentication
  • Endpoints

Dashboard Features

  • Analytics
  • Conversations
  • Users
  • Bot Integration
  • Helpcenter
  • Settings

Configuration

  • Email Fallback
  • Webhooks
  • Access Token URL

Push notification

Push Notification setup

Android

  1. Create your app on firebase and download the google-services.json file: https://console.firebase.google.com/project

  2. Copy the firebase server key and add it in Kommunicate dashboard under Developer -> Push notifications -> Android -> FCM/GCM Key

  3. Download the google-services.json file from firebase dashboard and paste it under your project/android/app/ directory

  4. Copy the KmFirebaseService file from here and paste it in your project's java directory project/android/app/src/main/java/

  5. Add the below configurations in your AndroidManifest.xml file inside the <application tag:

        <service
            android:name="com.getcapacitor.CapacitorFirebaseMessagingService"
            tools:node="remove" />

        <service
            android:name="com.applozic.mobicomkit.uiwidgets.KmFirebaseMessagingService"
            tools:node="remove" />

        <service
            android:name=".KmFirebaseService"
            android:stopWithTask="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
  1. Add the below entry inside the <manifest tag in your AndroidManifest.xml file:
    xmlns:tools="http://schemas.android.com/tools"
    

iOs

  1. Generate your debug and production certificates from your apple developer account and upload on Kommunicate dashboard.

  2. Follow the steps from here to upload the certificates and add notification capabilities: https://docs.kommunicate.io/docs/ios-pushnotification#certificates

  3. Download the KommunicateWrapper.swift file from here

  4. Add the KommunicateWrapper.swift file to the project target. Click on -> Add files to 'YourProject' -> Select the downloaded KommunicateWrapper.swift file

  5. Do the below changes in your AppDelgate.swift file: a. Add import for UserNotifications: import UserNotifications

    b. implement the UNUserNotificationCenterDelegate:

    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
    

    c. Call the KommunicateWrapper methods in the respective AppDelegate methods as below:

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
   // Override point for customization after application launch.
   UNUserNotificationCenter.current().delegate = self
   KommunicateWrapper.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
   return true
 }
   
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping       (UNNotificationPresentationOptions) -> Void) {
           KommunicateWrapper.shared.userNotificationCenter(center, willPresent: notification, withCompletionHandler: { options in
               completionHandler(options)
           })
   }
   
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
           KommunicateWrapper.shared.userNotificationCenter(center, didReceive: response, withCompletionHandler: {
               completionHandler()
           })
       }

func applicationDidEnterBackground(_ application: UIApplication) {
   // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
   // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
   KommunicateWrapper.shared.applicationDidEnterBackground(application: application)
 }

func applicationWillEnterForeground(_ application: UIApplication) {
   // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
   KommunicateWrapper.shared.applicationWillEnterForeground(application: application)
   UIApplication.shared.applicationIconBadgeNumber = 0
 }

func applicationWillTerminate(_ application: UIApplication) {
   // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
   KommunicateWrapper.shared.applicationWillTerminate(application: application)
 }

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
   NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidRegisterForRemoteNotificationsWithDeviceToken.name()), object: deviceToken)
   print("DEVICE_TOKEN_DATA :: \(deviceToken.description)") // (SWIFT = 3) : TOKEN PARSING
   KommunicateWrapper.shared.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
 }
← AuthenticationCustomization →
  • Push Notification setup
    • Android
    • iOs

Ready to automate more than 80% of your customer support?

Try for Free
  • support@kommunicate.io
  • United States
    (+1) (310) 402-2374
  • India
    (+91) 974-057-0196
  • Docs
    • Web
    • Android
    • iOS
    • Ionic/Phonegap
    • React Native
    • Flutter
  • Product
    • Kompose Chatbot Builder
    • Live Chat
    • Integrations
    • Helpcenter
    • Dialogflow Integration
    • Features
    • Pricing and FAQs
    • Get Demo
  • Resources
    • Chatbots Templates
    • Blog
    • Kommunity
    • Support Metrics
    • Free SaaS Icons
    • ROI Calculator
    • Comparison
  • Company
    • About Us
    • Partner Program
    • Terms of Service
    • Privacy Policy
    • Jobs
    • SLA
    • DPA
  • Support
    • Knowledge Base
    • Docs
    • Stack Overflow
    • API Status
    • Contact Us
Software Advice Frontrunners for Live Chat Mar-22crozdesk badgeCapterra Shortlist for Live Chat Mar-22GetApp Category Leaders for Live Chat Mar-22GDPR compliant - GDPR Copy 12Created with Sketch.COMPLIANTG2 reviews badge
Copyright © 2023 Kommunicate.io