123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- //
- // ViewController.swift
- // ExampleCode
- //
- // Created by Akhmad Al Qindi Irsyam on 10/05/23.
- //
- import Foundation
- import UIKit
- import NexilisLite
- import StreamShield
- class ViewController: UIViewController, ConnectDelegate {
- func onSuccess(userId: String) {
- print("SUCCESS \(userId)")
- }
-
- func onFailed(error: String) {
- print("FAILED")
- }
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- APIS.connect(appName: "SecureComm" ,apiKey: "8E784770B239FA3044A1DB44E276FB575B9BF3800ED11E200F4ACDD8FB476ABA", delegate: self, showButton: false)
- //"OneApp","38747683290F62E9667A018F490396EAE47BC16ADECD85B7E865C733E6DBD6A2"
- }
-
- override func viewDidAppear(_ animated: Bool) {
- let childrenMenu : [UIAction] = [
- UIAction(title: "Contact Center".localized(), handler: {(_) in
- APIS.openContactCenter()
- }),
- UIAction(title: "Chat".localized(), handler: {(_) in
- APIS.openChat()
- }),
- UIAction(title: "Notification Center".localized(), handler: {(_) in
- APIS.openNotificationCenter()
- }),
- UIAction(title: "Call".localized(), handler: {(_) in
- APIS.openCall()
- }),
- UIAction(title: "Live Streaming".localized(), handler: {(_) in
- APIS.openStreaming()
- }),
- UIAction(title: "Settings".localized(), handler: {(_) in
- APIS.openSetting()
- }),
- ]
- self.navigationController?.navigationBar.backgroundColor = .mainColor
-
- let menu = UIMenu(title: "", children: childrenMenu)
- self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: nil, image: UIImage(systemName: "ellipsis"), primaryAction: .none, menu: menu)
- self.navigationItem.rightBarButtonItem?.tintColor = .white
- }
- }
|