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)));
     }
 }
Ejemplo n.º 2
0
        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) => {
                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()); }
                                    );
        }
Ejemplo n.º 3
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");
     }
 }