Skip to content

Instantly share code, notes, and snippets.

View cci-rmirza's full-sized avatar

Rufat Mirza cci-rmirza

View GitHub Profile
@cci-rmirza
cci-rmirza / APIHelper.swift
Last active October 4, 2022 13:28
Login and Logout
extension LoginViewController: MembershipShowing {
func login(outletNumber: String, password: String) {
API.authProvider.request(.login(outletNumber: outletNumber, password: password)) { result in
CountlyExceptionHandler.sendLog(result.value, result.error, methodName: AuthService.login(outletNumber: "", password: "").path)
switch result {
case .failure(let error):
[Countly] [Info] Initializing with objc-native-ios SDK v21.11.2
[Countly] [Debug] Device ID successfully retrieved from UserDefaults: CC729DFB-8857-4EB6-8B39-F1DD675630CD
[Countly] [Debug] Proceeding on queue...
[Countly] [Debug] Request <0x600002724e60> started:
[Countly] [Debug] Fetching remote config on start...
[Countly] [Debug] Remote Config Request <0x600002720370> started:
[Countly] [Debug] Proceeding on queue...
[Countly] [Debug] Proceeding on queue is aborted: Already has a request in process!
[Countly] [Debug] Remote Config Request <0x600002720370> successfully completed.
[Countly] [Debug] Request <0x600002724e60> successfully completed.
@cci-rmirza
cci-rmirza / AppDelegate.swift
Last active October 4, 2022 13:04
Countly SDK Setup - TR
private func setCountly() {
let config = CountlyConfig()
config.appKey = Configuration.isInBeta ? "0de383003ac05f5e26c58e68caf68945ef95a478" : "c366cd0e6e796fb9a7457be62f9b3d3e8450aa1a"
config.host = "https://ccinext.count.ly"
config.features = [CLYFeature.pushNotifications, CLYFeature.crashReporting]
config.enableRemoteConfig = true
config.remoteConfigCompletionHandler = { (error : Error?) in
if error == nil {
RemoteConfigManager.shared.start()
}