Пример #1
0
        public void launchCometChatWithId(bool isFullScreen, string userOrGroupId, bool isGroup, bool setBackButton, CometChatLaunchCallbacks launchCallbacks)
        {
            var window      = UIApplication.SharedApplication.KeyWindow;
            var currentView = window.RootViewController;

            while (currentView.PresentedViewController != null)
            {
                currentView = currentView.PresentedViewController;
            }

            var navController = currentView as UINavigationController;

            if (navController != null)
            {
                currentView = navController.ViewControllers.Last();
            }

            readyUI.LaunchCometChat(userOrGroupId, isGroup, isFullScreen, currentView, setBackButton,
                                    (dict) => {
                Console.WriteLine("OnUserInfo CometChatImplementation" + dict.ToString());
                String push_channel = (dict["push_channel"] as NSString);
                Console.WriteLine("push_channel " + push_channel);
                CrossFirebasePushNotification.Current.Subscribe(push_channel);
                launchCallbacks.UserInfoCallback(dict.ToString());
            },
                                    (dict1) => { launchCallbacks.ChatroomInfoCallback(dict1.ToString()); },
                                    (dict2) => { launchCallbacks.MessageReceiveCallback(dict2.ToString()); },
                                    (dict3) => { launchCallbacks.SuccessCallback(dict3.ToString()); },
                                    (err) => { launchCallbacks.FailCallback(err.ToString()); },
                                    (dict4) => { launchCallbacks.LogoutCallback(dict4.ToString()); }
                                    );
        }
        public void launchCometChatWindow(bool isFullScreen, CometChatLaunchCallbacks launchCallbacks)
        {
            //get current UIViewController
            var window      = UIApplication.SharedApplication.KeyWindow;
            var currentView = window.RootViewController;

            while (currentView.PresentedViewController != null)
            {
                currentView = currentView.PresentedViewController;
            }

            var navController = currentView as UINavigationController;

            if (navController != null)
            {
                currentView = navController.ViewControllers.Last();
            }

            readyUI.LaunchCometChat(true, currentView,
                                    (dict) => {
                String push_channel = (dict["push_channel"] as NSString);
                CrossFirebasePushNotification.Current.Subscribe(push_channel);
                launchCallbacks.UserInfoCallback(dict.ToString());
            },
                                    (dict1) => { launchCallbacks.ChatroomInfoCallback(dict1.ToString()); },
                                    (dict2) => { launchCallbacks.MessageReceiveCallback(dict2.ToString()); },
                                    (dict3) => { launchCallbacks.SuccessCallback(dict3.ToString()); },
                                    (err) => { launchCallbacks.FailCallback(err.ToString()); },
                                    (dict4) => { launchCallbacks.LogoutCallback(dict4.ToString()); }
                                    );
        }
 public void launchCometChatWindow(bool isFullScreen, CometChatLaunchCallbacks launchCallbacks)
 {
     if (context != null)
     {
         cometchat.LaunchCometChat((Android.App.Activity)context, isFullScreen, new LaunchCallbacks(successObj => launchCallbacks.SuccessCallback((string)successObj), fail => launchCallbacks.FailCallback((string)fail), onChatroomInfo => launchCallbacks.ChatroomInfoCallback((string)onChatroomInfo), onError => launchCallbacks.ErrorCallback((string)onError), onLogout => launchCallbacks.LogoutCallback((string)onLogout), onMessageReceive => launchCallbacks.MessageReceiveCallback((string)onMessageReceive), onUserInfo => launchCallbacks.UserInfoCallback((string)onUserInfo), onWindowClose => launchCallbacks.WindowCloseCallback((string)onWindowClose)));
     }
 }
Пример #4
0
 public void launchCometChatWithId(bool isFullScreen, String userOrGroupId, bool isGroup, bool setBackButton, CometChatLaunchCallbacks launchCallbacks)
 {
     if (context != null)
     {
         cometchat.LaunchCometChat((Android.App.Activity)context, isFullScreen, userOrGroupId, isGroup, setBackButton, new LaunchCallbacks(successObj => launchCallbacks.SuccessCallback((string)successObj), fail => launchCallbacks.FailCallback((string)fail), onChatroomInfo => launchCallbacks.ChatroomInfoCallback((string)onChatroomInfo), onError => launchCallbacks.ErrorCallback((string)onError), onLogout => launchCallbacks.LogoutCallback((string)onLogout), onMessageReceive => launchCallbacks.MessageReceiveCallback((string)onMessageReceive), onUserInfo => launchCallbacks.UserInfoCallback((string)onUserInfo), onWindowClose => launchCallbacks.WindowCloseCallback((string)onWindowClose)));
     }
     else
     {
         System.Console.Write("Conetext Null");
     }
 }