Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
barbayrak committed May 22, 2020
0 parents commit 5b7ed68
Show file tree
Hide file tree
Showing 36 changed files with 1,822 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
26 changes: 26 additions & 0 deletions PapcornsAnalytics.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

Pod::Spec.new do |spec|

spec.name = "PapcornsAnalytics"
spec.version = "1.0.0"
spec.summary = "Papcorns Analytics Tool iOS SDK"

spec.description = "Internal Papcorns Analytics Tool iOS SDK"

spec.homepage = "https://www.papcorns.com"


spec.license = { :type => "GNU", :file => "LICENSE" }


spec.authors = { "Kaan" => "[email protected]" }


spec.source = { :git => "https://github.com/papcorns/PapcornsAnalyticsiOSSDK.git", :tag => "#{spec.version}" }


spec.swift_version = '5.0'
spec.ios.deployment_target = '11.0'
spec.source_files = "PapcornsAnalytics/**/*"

end
454 changes: 454 additions & 0 deletions PapcornsAnalytics.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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1150"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB99639D2477D7190004D9C7"
BuildableName = "PapcornsAnalytics.framework"
BlueprintName = "PapcornsAnalytics"
ReferencedContainer = "container:PapcornsAnalytics.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB99639D2477D7190004D9C7"
BuildableName = "PapcornsAnalytics.framework"
BlueprintName = "PapcornsAnalytics"
ReferencedContainer = "container:PapcornsAnalytics.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>PapcornsAnalytics.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>BB99639D2477D7190004D9C7</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
10 changes: 10 additions & 0 deletions PapcornsAnalytics.xcworkspace/contents.xcworkspacedata

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
32 changes: 32 additions & 0 deletions PapcornsAnalytics/API/PapcornsAPILogEvent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// PapcornsAPILogEvent.swift
// PapcornsAnalytics
//
// Created by Kaan Baris BAYRAK on 22.05.2020.
// Copyright © 2020 Papcorns. All rights reserved.
//

import Foundation

class PapcornsAPILogEvent: PapcornsRequest<PapcornsAPISuccess> {

convenience init(eventName : String,eventParameters : [String : Any]) {
self.init()

addBodyItem(name: "userId", value: PapcornsConfigManager.shared.config.userId)
addBodyItem(name: "eventName", value: eventName)
addBodyItem(name: "eventParameters", value: eventParameters)
addBodyItem(name: "appId", value: PapcornsConfigManager.shared.config.appId)
addBodyItem(name: "appVersion", value: PapcornsConfigManager.shared.config.appVersion)

}

override var httpMethod: HTTPMethod {
return .POST
}

override var path: String {
return "/logEvent"
}

}
32 changes: 32 additions & 0 deletions PapcornsAnalytics/API/PapcornsAPILogScreen.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// PapcornsAPILogScreen.swift
// PapcornsAnalytics
//
// Created by Kaan Baris BAYRAK on 22.05.2020.
// Copyright © 2020 Papcorns. All rights reserved.
//

import Foundation

class PapcornsAPILogScreen: PapcornsRequest<PapcornsAPISuccess> {

convenience init(screenName : String,screenParameters : [String : Any]) {
self.init()

addBodyItem(name: "userId", value: PapcornsConfigManager.shared.config.userId)
addBodyItem(name: "eventName", value: screenName)
addBodyItem(name: "eventParameters", value: screenParameters)
addBodyItem(name: "appId", value: PapcornsConfigManager.shared.config.appId)
addBodyItem(name: "appVersion", value: PapcornsConfigManager.shared.config.appVersion)

}

override var httpMethod: HTTPMethod {
return .POST
}

override var path: String {
return "/screenLog"
}

}
37 changes: 37 additions & 0 deletions PapcornsAnalytics/API/PapcornsAPISetUser.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// PapcornsAPISetUser.swift
// PapcornsAnalytics
//
// Created by Kaan Baris BAYRAK on 22.05.2020.
// Copyright © 2020 Papcorns. All rights reserved.
//

import Foundation

class PapcornsAPISetUser: PapcornsRequest<PapcornsAPISuccess> {

convenience init(userId : String) {
self.init()

addBodyItem(name: "userId", value: PapcornsConfigManager.shared.config.userId)
addBodyItem(name: "idfa", value: PapcornsConfigManager.shared.config.idfa ?? "")
addBodyItem(name: "deviceId", value: PapcornsConfigManager.shared.config.deviceId ?? "")
addBodyItem(name: "deviceModel", value: PapcornsConfigManager.shared.config.deviceModel ?? "")
addBodyItem(name: "deviceVersion", value: PapcornsConfigManager.shared.config.osVersion ?? "")
addBodyItem(name: "preferedLanguage", value: PapcornsConfigManager.shared.config.language ?? "")
addBodyItem(name: "country", value: PapcornsConfigManager.shared.config.country ?? "")
addBodyItem(name: "ip", value: PapcornsConfigManager.shared.config.ip ?? "")
addBodyItem(name: "appId", value: PapcornsConfigManager.shared.config.appId)
addBodyItem(name: "appVersion", value: PapcornsConfigManager.shared.config.appVersion)

}

override var httpMethod: HTTPMethod {
return .POST
}

override var path: String {
return "/userLog"
}

}
21 changes: 21 additions & 0 deletions PapcornsAnalytics/Manager/PapcornsConfigManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// PapcornsConfigManager.swift
// PapcornsAnalytics
//
// Created by Kaan Baris BAYRAK on 22.05.2020.
// Copyright © 2020 Papcorns. All rights reserved.
//

import Foundation
import UIKit

class PapcornsConfigManager {

static let shared = PapcornsConfigManager()
private (set) var config : PapcornsConfiguration

private init() {
config = PapcornsConfiguration()
}

}
24 changes: 24 additions & 0 deletions PapcornsAnalytics/Models/PapcornsAPIError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// PapcornsAPIError.swift
// PapcornsAnalytics
//
// Created by Kaan Baris BAYRAK on 22.05.2020.
// Copyright © 2020 Papcorns. All rights reserved.
//

import Foundation

class PapcornsAPIError: Codable {

var status:String?
var message:String?

private enum CodingKeys: String, CodingKey {
case status = "status"
case message = "message"
}

var error : PapcornsError {
return .UnknownError
}
}
21 changes: 21 additions & 0 deletions PapcornsAnalytics/Models/PapcornsAPISuccess.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// PapcornsAPISuccess.swift
// PapcornsAnalytics
//
// Created by Kaan Baris BAYRAK on 22.05.2020.
// Copyright © 2020 Papcorns. All rights reserved.
//

import Foundation

class PapcornsAPISuccess: Codable {

var status:String?
var message:String?

private enum CodingKeys: String, CodingKey {
case status = "status"
case message = "message"
}

}
Loading

0 comments on commit 5b7ed68

Please sign in to comment.