1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // 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)")
- // SecurityShield.check(appName: "OneApp", apiKey: "38747683290F62E9667A018F490396EAE47BC16ADECD85B7E865C733E6DBD6A2")
- }
-
- func onFailed(error: String) {
- print("FAILED")
- }
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- APIS.connect(appName: "esApp" ,apiKey: "FE44324020F0F0196F29D86987B63047D58E546BA8CE5E349F0F5058041C40A7", delegate: self, showButton: true)
- // "ps29ios" ,apiKey: "31D080A9F46FBCAAE18F122B8C621CAC2994151978DD3D9BEBD01EB927EE840C"
- //"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.openConversation()
- }),
- 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()
- }),
- UIAction(title: "Conference Call".localized(), handler: {(_) in
- APIS.openConference()
- }),
- ]
- 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
- }
- }
|