Skip to content

Commit c0a8c62

Browse files
zhu-xiaoweixiaoweii
andauthored
chore: add action to publish API doc (#7)
Co-authored-by: xiaoweii <xiaoweii@amazom.com>
1 parent aeea2af commit c0a8c62

File tree

7 files changed

+50
-4
lines changed

7 files changed

+50
-4
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Jazzy doc generate
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
env:
7+
GIT_USER_NAME: clickstream-android-dev+ghops
8+
GIT_USER_EMAIL: no-reply@amazon.com
9+
jobs:
10+
deploy:
11+
runs-on: macos-12
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Generate docs
15+
run: jazzy
16+
- name: add images to docs
17+
run: mkdir -p docs/images | cp -R images/. docs/images/
18+
- name: commit code
19+
run: |
20+
git add docs
21+
git commit -m "chore: update API docs"
22+
git push origin HEAD:gh-pages -f

.jazzy.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module: Clickstream
2+
author: Amazon Web Services
3+
github_url: https://github.com/awslabs/clickstream-swift
4+
5+
swift-build-tool: spm
6+
clean: true
7+
skip_undocumented: false
8+
undocumented_text: ""
9+
hide_documentation_coverage: true
10+
sdk: iphone
11+
theme: apple
12+
build_tool_arguments:
13+
- -Xswiftc
14+
- -swift-version
15+
- "5"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The SDK relies on the Amplify for Swift Core Library and is developed according
1010

1111
The Clickstream SDK supports iOS 13+.
1212

13+
[**API Documentation**](https://awslabs.github.io/clickstream-swift/)
14+
1315
## Integrate SDK
1416

1517
Clickstream requires Xcode 13.4 or higher to build.

Sources/Clickstream/ClickstreamAttribute.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Amplify
1111
public typealias ClickstreamAttribute = AnalyticsProperties
1212

1313
typealias AttributeValue = AnalyticsPropertyValue
14+
/// for support Int64 attribute value
1415
extension Int64: AnalyticsPropertyValue {}
1516

1617
struct BaseClickstreamEvent: AnalyticsEvent {

Sources/Clickstream/Dependency/Clickstream/ActivityTracking/UIViewController+Swizzle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
//
77

88
#if canImport(UIKit)
9-
import UIKit
10-
#endif
9+
import UIKit
1110

1211
private var hasSwizzled = false
1312
private var viewDidAppearFunc: ((String, String) -> Void)?
@@ -47,3 +46,4 @@ extension UIViewController {
4746
hasSwizzled = true
4847
}
4948
}
49+
#endif

Sources/Clickstream/Dependency/Clickstream/AutoRecord/AutoRecordEventClient.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#if canImport(UIKit)
99
import UIKit
1010
#endif
11+
import Foundation
1112

1213
class AutoRecordEventClient {
1314
private let clickstream: ClickstreamContext
@@ -21,7 +22,9 @@ class AutoRecordEventClient {
2122
self.clickstream = clickstream
2223
self.isFirstOpen = UserDefaultsUtil.getIsFirstOpen(storage: clickstream.storage)
2324
if clickstream.configuration.isTrackScreenViewEvents {
24-
UIViewController.swizzle(viewDidAppear: onViewDidAppear)
25+
#if canImport(UIKit)
26+
UIViewController.swizzle(viewDidAppear: onViewDidAppear)
27+
#endif
2528
}
2629
}
2730

Sources/Clickstream/Support/Utils/UserDefaultsUtil.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ enum UserDefaultsUtil {
1616
return deviceId
1717
}
1818
var newDeviceId = ""
19-
let idfv = UIDevice.current.identifierForVendor?.uuidString ?? ""
19+
var idfv = ""
20+
#if canImport(UIKit)
21+
idfv = UIDevice.current.identifierForVendor?.uuidString ?? ""
22+
#endif
2023
if idfv != "" {
2124
newDeviceId = idfv
2225
} else {

0 commit comments

Comments
 (0)