Beispiel #1
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()); }
                                    );
        }
Beispiel #2
0
 partial void BtnLaunchCometChat_TouchUpInside(UIButton sender)
 {
     readyUIFile.LaunchCometChat(true, this, (userInfo) => OnUserInfo(userInfo), groupInfo => OnGroupInfo(groupInfo), messageRecieve => OnMessageRecieve(messageRecieve), launchSuccess => OnLaunchSuccess(launchSuccess), launchFailure => OnLaunchFailure(launchFailure), onLogout => OnLogout(onLogout));
 }