This commit is contained in:
Anatoly Pristensky 2021-08-06 12:56:31 +03:00 коммит произвёл GitHub
Родитель d7523443f9
Коммит e4dd83fb55
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 34 добавлений и 31 удалений

Просмотреть файл

@ -1,11 +1,10 @@
target 'sampleapp-ios-swift' do
platform :ios, '10.0'
use_frameworks!
pod 'AppCenter'
pod 'AppCenter/Push'
pod 'AppCenter/Distribute'
pod 'AppCenter/Analytics'
pod 'AppCenter/Crashes'
target 'sampleapp-ios-swiftUITests' do
inherit! :search_paths
# Pods for testing

Просмотреть файл

@ -1,22 +1,18 @@
PODS:
- AppCenter (2.5.1):
- AppCenter/Analytics (= 2.5.1)
- AppCenter/Crashes (= 2.5.1)
- AppCenter/Analytics (2.5.1):
- AppCenter (4.2.0):
- AppCenter/Analytics (= 4.2.0)
- AppCenter/Crashes (= 4.2.0)
- AppCenter/Analytics (4.2.0):
- AppCenter/Core
- AppCenter/Core (2.5.1)
- AppCenter/Crashes (2.5.1):
- AppCenter/Core
- AppCenter/Distribute (2.5.1):
- AppCenter/Core
- AppCenter/Push (2.5.1):
- AppCenter/Core (4.2.0)
- AppCenter/Crashes (4.2.0):
- AppCenter/Core
- VSMobileCenterExtensions (0.9.1)
DEPENDENCIES:
- AppCenter
- AppCenter/Distribute
- AppCenter/Push
- AppCenter/Analytics
- AppCenter/Crashes
- VSMobileCenterExtensions
SPEC REPOS:
@ -25,9 +21,9 @@ SPEC REPOS:
- VSMobileCenterExtensions
SPEC CHECKSUMS:
AppCenter: fddcbac6e4baae3d93a196ceb0bfe0e4ce407dec
AppCenter: 87ef6eefd8ade4df59e88951288587429f3dd2a5
VSMobileCenterExtensions: 5f8b4b284f6817c1d58e860bf7ad0945f1244733
PODFILE CHECKSUM: 88dda23b55749ff77cb7e2a56e89be563b7f6a81
PODFILE CHECKSUM: afd045c8011878a0b57ece97bc75b3ddd27a3cb0
COCOAPODS: 1.8.3
COCOAPODS: 1.10.1

10
sampleapp-ios-swift.xcworkspace/contents.xcworkspacedata сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:sampleapp-ios-swift.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

Просмотреть файл

@ -20,7 +20,7 @@ class AnalyticsViewController: UIViewController {
@IBAction func analyticsButtonTapped(_ sender: UIButton) {
switch sender {
case customEventButton:
MSAnalytics.trackEvent("Sample event")
Analytics.trackEvent("Sample event")
print("send a custom event")
presentCustomEventAlert()
@ -58,21 +58,21 @@ class AnalyticsViewController: UIViewController {
alert.addAction(UIAlertAction(title: "💛 Yellow",
style: .default,
handler: { _ in alert.dismiss(animated: true)
MSAnalytics.trackEvent("Color event", withProperties: ["Color": "Yellow"])
Analytics.trackEvent("Color event", withProperties: ["Color": "Yellow"])
}))
// Blue button
alert.addAction(UIAlertAction(title: "💙 Blue",
style: .default,
handler: { _ in alert.dismiss(animated: true)
MSAnalytics.trackEvent("Color event", withProperties: ["Color": "Blue"])
Analytics.trackEvent("Color event", withProperties: ["Color": "Blue"])
}))
// Red button
alert.addAction(UIAlertAction(title: "❤️ Red",
style: .default,
handler: { _ in alert.dismiss(animated: true)
MSAnalytics.trackEvent("Color event", withProperties: ["Color": "Red"])
Analytics.trackEvent("Color event", withProperties: ["Color": "Red"])
}))
present(alert, animated: true)

Просмотреть файл

@ -3,7 +3,6 @@ import UIKit
import AppCenter
import AppCenterAnalytics
import AppCenterCrashes
import AppCenterPush
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
@ -14,12 +13,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch.
// Enabled App Center SDK verbose logs
MSAppCenter.setLogLevel(.verbose)
AppCenter.logLevel = .verbose
MSAppCenter.start("<APP SECRET HERE>", withServices: [
MSAnalytics.self,
MSCrashes.self,
MSPush.self,
AppCenter.start(withAppSecret: "<APP SECRET HERE>", services: [
Analytics.self,
Crashes.self,
])
return true

Просмотреть файл

@ -20,7 +20,7 @@ class CrashViewController: UIViewController {
@IBAction func userIdButtonTapped(_: UIButton) {
// Set a user id
MSAppCenter.setUserId("<CUSTOM USER ID HERE")
AppCenter.userId = "<CUSTOM USER ID HERE"
print("set a user id")
presentCustomUserIdAlert()
}
@ -59,7 +59,7 @@ class CrashViewController: UIViewController {
style: UIAlertAction.Style.destructive,
handler: { _ in alert.dismiss(animated: true)
// generate test crash
MSCrashes.generateTestCrash()
Crashes.generateTestCrash()
fatalError()
}))