Skip to content

Commit

Permalink
transfered
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillkotov committed Oct 18, 2020
1 parent d2eb1f9 commit d3c1920
Show file tree
Hide file tree
Showing 20 changed files with 342 additions and 294 deletions.
358 changes: 166 additions & 192 deletions HyberSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>Hyber-SDK-iOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>25</integer>
</dict>
<key>HyberSDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>6</integer>
<integer>9</integer>
</dict>
</dict>
</dict>
Expand Down
4 changes: 2 additions & 2 deletions HyberSDK.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
11 changes: 5 additions & 6 deletions HyberSDK/HyberSDK.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// Hyber_SDK_iOS.h
// Hyber-SDK-iOS
// HyberSDK.h
// HyberSDK
//
// Created by Дмитрий Буйновский on 24/11/2019.
// Copyright © 2019 GMS. All rights reserved.
// Created by Kirill Kotov on 01/10/2020.
// Copyright © 2020 HYBER. All rights reserved.
//

#import <UIKit/UIKit.h>
Expand All @@ -12,9 +12,8 @@
//! Project version number for HyberSDK.
FOUNDATION_EXPORT double HyberSDKVersionNumber;

//! Project version string for Hyber_SDK_iOS.
//! Project version string for HyberSDK.
FOUNDATION_EXPORT const unsigned char HyberSDKVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <HyberSDK/PublicHeader.h>


9 changes: 6 additions & 3 deletions HyberSDK/HyberSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// hybersdk.swift
// hybersdk
//
// Created by ard on 08/05/2019.
// Created by Kirill Kotov on 08/05/2019.
// Copyright © 2019 ard. All rights reserved.
//

//import UIKit
import Foundation
import UIKit
import CryptoSwift
import SwiftyBeaver

//import CoreData
//import FirebaseCore
Expand All @@ -28,7 +29,10 @@ public extension Notification.Name {

public class HyberSDK {

public init()
public init(
//platform_branch: PushSdkParametersPublic,
log_level: String = "error"
)
{
Constants.registrationstatus = UserDefaults.standard.bool(forKey: "registrationstatus")
Constants.hyber_registration_token = UserDefaults.standard.string(forKey: "hyber_registration_token")
Expand Down Expand Up @@ -69,7 +73,6 @@ public class HyberSDK {
let answer_b = AnswerBuider.init()



//Procedure 1. new device registration
//x_hyber_sesion_id - firebase FCM token
//x_hyber_ios_bundle_id - ios application bundle id
Expand Down
2 changes: 1 addition & 1 deletion HyberSDK/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.8</string>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
91 changes: 45 additions & 46 deletions HyberSDK/api/hyber_adapter.swift

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HyberSDK/logger/Formatters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Formatters.swift
// Hyber-SDK
//
// Created by Taras on 10/27/16.
// Created by Kirill Kotov on 10/27/16.
// Incuube
//
import Foundation
Expand Down
2 changes: 1 addition & 1 deletion HyberSDK/logger/Themes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Themes.swift
// Hyber-SDK
//
// Created by Taras on 10/27/16.
// Created by Kirill Kotov on 10/27/16.
// Incuube
//

Expand Down
2 changes: 1 addition & 1 deletion HyberSDK/logger/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Utilities.swift
// Hyber-SDK
//
// Created by Taras on 10/27/16.
// Created by Kirill Kotov on 10/27/16.
// Incuube
//

Expand Down
8 changes: 1 addition & 7 deletions HyberSDK/settings/add_functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// add_functions.swift
// test222
//
// Created by ard on 28/04/2019.
// Created by Kirill Kotov on 28/04/2019.
// Copyright © 2019 ard. All rights reserved.
//

Expand All @@ -14,8 +14,6 @@ public class Processing {

//function for write debug log into additional file. Calling from procedures
func file_logger(message: String, loglevel: String){
do
{
if (Constants.loglevel==".debug") {
log_wr(message: message, loglevel: loglevel)
}else if (Constants.loglevel==".errors" && (loglevel==".error" || loglevel==".critical") ){
Expand All @@ -25,9 +23,6 @@ public class Processing {
}else{
//if another level in loglevel
}
} catch let error as String {
log_wr(message: error, loglevel: ".error")
}
}

private func log_wr(message: String, loglevel: String){
Expand All @@ -41,7 +36,6 @@ public class Processing {
}

public func matches(for regex: String, in text: String) -> [String] {

do {
let regex = try NSRegularExpression(pattern: regex)
let results = regex.matches(in: text,
Expand Down
3 changes: 1 addition & 2 deletions HyberSDK/settings/hyber_answer_func.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// hyber_answer_func.swift
// PushDemo
//
// Created by ard on 28/09/2019.
// Created by Kirill Kotov on 28/09/2019.
// Copyright © 2019 ard. All rights reserved.
//

Expand Down Expand Up @@ -32,7 +32,6 @@ class AnswerBuider {

resp = HyberGeneralAnswerStruct.init(code: Int(resp_code)!, result: "Failed", description: "Failed", body: body_json)
}

return resp
}

Expand Down
2 changes: 1 addition & 1 deletion HyberSDK/settings/json_parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// json_parser.swift
// HyberSDK
//
// Created by Дмитрий Буйновский on 29/03/2020.
// Created by Kirill Kotov on 29/03/2020.
// Copyright © 2020 GMS. All rights reserved.
//

Expand Down
57 changes: 53 additions & 4 deletions HyberSDK/settings/params.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//
// params.swift
// test222
//
// Created by ard on 28/04/2019.
// Created by Kirill Kotov on 28/04/2019.
// Copyright © 2019 ard. All rights reserved.
//

Expand Down Expand Up @@ -109,6 +107,53 @@ public struct HyberGeneralAnswerStruct {
public var body: String
}


public struct PushSdkParametersPublic {

public struct BranchStructObj {
var fun_hyber_url_device_update: String
var fun_hyber_url_registration: String
var fun_hyber_url_revoke: String
var fun_hyber_url_get_device_all: String
var fun_hyber_url_message_callback: String
var fun_hyber_url_message_dr: String
var fun_hyber_url_mess_queue: String
var hyber_url_message_history: String
}

var BranchStructObj = branchMasterValue.self

//public val branchMasterValue: BranchStructObj = BranchStructObj()


public struct branchMasterValue {
static let fun_hyber_url_device_update = "https://push.hyber.im/api/2.3/device/update"
static let fun_hyber_url_registration = "https://push.hyber.im/api/2.3/device/registration"
static let fun_hyber_url_revoke = "https://push.hyber.im/api/2.3/device/revoke"
static let fun_hyber_url_get_device_all = "https://push.hyber.im/api/2.3/device/all"
static let fun_hyber_url_message_callback = "https://push.hyber.im/api/2.3/message/callback"
static let fun_hyber_url_message_dr = "https://push.hyber.im/api/2.3/message/dr"
static let fun_hyber_url_mess_queue = "https://push.hyber.im/api/2.3/message/queue"
static let hyber_url_message_history = "https://push.hyber.im/api/2.3/message/history?startDate="
}

public struct branchTestValue {
static let fun_hyber_url_device_update = "https://test-push.hyber.im/api/2.3/device/update"
static let fun_hyber_url_registration = "https://test-push.hyber.im/api/2.3/device/registration"
static let fun_hyber_url_revoke = "https://test-push.hyber.im/api/2.3/device/revoke"
static let fun_hyber_url_get_device_all = "https://test-push.hyber.im/api/2.3/device/all"
static let fun_hyber_url_message_callback = "https://test-push.hyber.im/api/2.3/message/callback"
static let fun_hyber_url_message_dr = "https://test-push.hyber.im/api/2.3/message/dr"
static let fun_hyber_url_mess_queue = "https://test-push.hyber.im/api/2.3/message/queue"
static let hyber_url_message_history = "https://test-push.hyber.im/api/2.3/message/history?startDate="
}

static let TAG_LOGGING = "HyberPushSDK"
static let hyber_log_level_error = "error"
static let hyber_log_level_debug = "debug"
}


public struct Constants {

public static var registrationstatus = UserDefaults.standard.bool(forKey: "registrationstatus")
Expand All @@ -123,7 +168,6 @@ public struct Constants {




let kOSType = "ios"
static let sdkVersion = "0.0.12"
static let dev_os_Version = UIDevice.current.systemVersion
Expand Down Expand Up @@ -266,6 +310,10 @@ public extension UIDevice {
case "iPhone11,2": return "iPhone XS"
case "iPhone11,4", "iPhone11,6": return "iPhone XS Max"
case "iPhone11,8": return "iPhone XR"
case "iPhone12,1": return "iPhone 11"
case "iPhone12,3": return "iPhone 11 Pro"
case "iPhone12,5": return "iPhone 11 Pro Max"
case "iPhone12,8": return "iPhone SE (2nd generation)"
case "iPad2,1", "iPad2,2", "iPad2,3", "iPad2,4":return "iPad 2"
case "iPad3,1", "iPad3,2", "iPad3,3": return "iPad 3"
case "iPad3,4", "iPad3,5", "iPad3,6": return "iPad 4"
Expand All @@ -285,6 +333,7 @@ public extension UIDevice {
case "iPad7,3", "iPad7,4": return "iPad Pro (10.5-inch)"
case "iPad8,1", "iPad8,2", "iPad8,3", "iPad8,4":return "iPad Pro (11-inch)"
case "iPad8,5", "iPad8,6", "iPad8,7", "iPad8,8":return "iPad Pro (12.9-inch) (3rd generation)"
case "iPad8,11", "iPad8,12": return "iPad Pro (12.9-inch) (4th generation)"
case "AppleTV5,3": return "Apple TV"
case "AppleTV6,2": return "Apple TV 4K"
case "AudioAccessory1,1": return "HomePod"
Expand Down
22 changes: 16 additions & 6 deletions HyberSDKTests/HyberSDKTests.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
//
// Hyber_SDK_iOSTests.swift
// Hyber-SDK-iOSTests
// HyberSDKTests.swift
// HyberSDKTests
//
// Created by Дмитрий Буйновский on 24/11/2019.
// Copyright © 2019 GMS. All rights reserved.
// Created by Kirill Kotov on 01/10/2020.
// Copyright © 2020 HYBER. All rights reserved.
//

import XCTest
@testable import Hyber_SDK_iOS
@testable import HyberSDK

class Hyber_SDK_iOSTests: XCTestCase {
class HyberSDKTests: XCTestCase {

var sdkInitHyber = HyberSDK.init()

override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
Expand All @@ -30,5 +32,13 @@ class Hyber_SDK_iOSTests: XCTestCase {
// Put the code you want to measure the time of here.
}
}

//func testRegistrar() {
// sdkInitHyber.hyber_register_new(user_phone: "375291234567", user_password: "Password", x_hyber_sesion_id: "123", x_hyber_ios_bundle_id: "test", X_Hyber_Client_API_Key: "test")
// }

func testPrint() {
print("error: not a valid http response")
}

}
18 changes: 16 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ target 'HyberSDK' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for Hyber-SDK-iOS
pod 'SwiftyJSON', '~> 4.0'
# Pods for HyberSDK
#pod 'Firebase/Core'
#pod 'Firebase/Messaging'
#pod 'Firebase/Auth'
Expand All @@ -18,10 +17,25 @@ target 'HyberSDK' do
pod 'BoringSSL-GRPC'
pod 'CryptoSwift', '1.0.0'
pod 'JSON'
pod 'RetrofireSwift'
pod 'SwiftyBeaver'

target 'HyberSDKTests' do
inherit! :search_paths
# Pods for testing
#pod 'Firebase/Core'
#pod 'Firebase/Messaging'
#pod 'Firebase/Auth'
#pod 'Firebase/AdMob'
#pod 'Firebase/Database'
#pod 'Firebase/Storage'
#pod 'Firebase/Firestore'
#pod 'Google-Mobile-Ads-SDK'
pod 'BoringSSL-GRPC'
pod 'CryptoSwift', '1.0.0'
pod 'JSON'
pod 'RetrofireSwift'
pod 'SwiftyBeaver'
end

end
Loading

0 comments on commit d3c1920

Please sign in to comment.