public void initializeCometChat(string SiteUrl, string LicenseKey, string ApiKey, bool isCometOnDemand, CometChatFormCallback callback) { if (context != null) { cometchat = CometChat.GetInstance(context); cometchat.InitializeCometChat(SiteUrl, LicenseKey, ApiKey, isCometOnDemand, new CometChatCallback(success => callback.SuccessCallback((string)success), fail => callback.FailCallback((string)fail))); } else { System.Console.Write("Conetext Null"); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); SugarContext.Init(this); // System.Console.WriteLine(TAG+ "google app id: " + GetString(Resource.String.common_google_play_services_notification_channel_name)); Firebase.FirebaseApp.InitializeApp(this); // Get our button from the layout resource, // and attach an event to it cc = CometChat.GetInstance(this.ApplicationContext); setUpFields(); }
public void initializeCometChat(string SiteUrl, string LicenseKey, string ApiKey, bool isCometOnDemand, CometChatFormCallback callback) { if (context != null) { cometchat = CometChat.GetInstance(context); cometchat.InitializeCometChat(SiteUrl, LicenseKey, ApiKey, isCometOnDemand, new CometChatCallback((JSONObject obj) => { System.Console.Write("InitializeCometChat success"); this.isInitializeCometChat = true; if (callback != null) { callback.SuccessCallback((string)obj); } }, (JSONObject obj) => { System.Console.Write("InitializeCometChat fail"); if (callback != null) { callback.FailCallback((string)obj); } })); } }