Skip to content

Commit 2ed9ade

Browse files
authored
feat: implement Clickstream React Native SDK (#25)
1 parent 1f92eb6 commit 2ed9ade

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+353
-747
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Bug Report
2+
description: Create a report to help us improve
3+
body:
4+
- type: textarea
5+
id: description
6+
attributes:
7+
label: Describe the bug
8+
description: A clear and concise description of what the bug is.
9+
validations:
10+
required: true
11+
- type: textarea
12+
id: repro
13+
attributes:
14+
label: Steps To Reproduce
15+
description: How do you trigger this bug? Please walk us through it step by step.
16+
value: |
17+
Steps to reproduce the behavior:
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
render: typescript
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: behavior
27+
attributes:
28+
label: Expected behavior
29+
description: A clear and concise description of what you expected to happen.
30+
validations:
31+
required: true
32+
- type: input
33+
id: clickstream-version
34+
attributes:
35+
label: ClickstreamAnalytic SDK Version
36+
placeholder: e.g. 1.0.0
37+
validations:
38+
required: true
39+
- type: input
40+
id: platform
41+
attributes:
42+
label: The platform of the bug
43+
placeholder: |
44+
- e.g. Android/iOS/Web/All
45+
validations:
46+
required: true
47+
- type: textarea
48+
id: logs
49+
attributes:
50+
label: Relevant log output
51+
description: >-
52+
Include any relevant log output
53+
value: |
54+
<details>
55+
<summary>Log Messages</summary>
56+
57+
```
58+
INSERT LOG MESSAGES HERE
59+
```
60+
</details>
61+
render: shell
62+
- type: dropdown
63+
id: regression
64+
attributes:
65+
label: Is this a regression?
66+
multiple: false
67+
options:
68+
- "Yes"
69+
- "No"
70+
validations:
71+
required: true
72+
- type: textarea
73+
id: regression-info
74+
attributes:
75+
label: Regression additional context
76+
placeholder: If it was a regression provide the versions used before and after the upgrade.
77+
- type: textarea
78+
id: context
79+
attributes:
80+
label: Additional context
81+
description: Add any other context about the problem here.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Feature request
2+
description: Suggest an idea for this project
3+
body:
4+
- type: textarea
5+
id: description
6+
attributes:
7+
label: Is your feature request related to a problem? Please describe.
8+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
validations:
10+
required: true
11+
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: Describe the solution you'd like
16+
description: A clear and concise description of what you want to happen.
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Describe alternatives you've considered
24+
description: A clear and concise description of any alternative solutions or features you've considered.
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: context
30+
attributes:
31+
label: Additional context
32+
description: Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Issue \#
2+
<!-- If applicable, please link to issue(s) this change addresses -->
3+
4+
## Description
5+
<!-- Why is this change required? What problem does it solve? -->
6+
7+
## General Checklist
8+
<!-- Check or cross out if not relevant -->
9+
10+
- [ ] Added new tests to cover change, if needed
11+
- [ ] Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
12+
- [ ] Documentation update for the change if required
13+
- [ ] PR title conforms to conventional commit style
14+
- [ ] If breaking change, documentation/changelog update with migration instructions
15+
16+
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT-0 license.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build for Android
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-android:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-java@v3
15+
with:
16+
distribution: 'corretto'
17+
java-version: '17'
18+
cache: gradle
19+
- name: Build android apk
20+
run: |
21+
cd android
22+
./gradlew assembleDebug

.github/workflows/build-ios.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build for iOS
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-ios:
11+
runs-on: macos-13-xl
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Build ios
15+
run: |
16+
sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'
17+
xcode-select --print-path
18+
cd ios
19+
xcodebuild -resolvePackageDependencies
20+
echo "start build ios app"
21+
set -o pipefail
22+
xcodebuild -scheme "ModerneShopping" -sdk iphoneos -configuration Release -destination generic/platform=iOS CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO clean archive | xcpretty

.github/workflows/build-rn.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build for React Native
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
lint-rn:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Run lint
15+
run: |
16+
cd react-native
17+
yarn
18+
yarn lint
19+
20+
build-android:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-java@v3
25+
with:
26+
distribution: 'corretto'
27+
java-version: '17'
28+
cache: gradle
29+
- name: Build android apk
30+
run: |
31+
cd react-native
32+
yarn
33+
cd android
34+
./gradlew assembleDebug
35+
36+
build-ios:
37+
runs-on: macos-13-xl
38+
steps:
39+
- uses: actions/checkout@v3
40+
- name: Build ios
41+
run: |
42+
sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'
43+
xcode-select --print-path
44+
cd react-native
45+
yarn
46+
cd ios && pod install
47+
echo "start build ios app"
48+
set -o pipefail
49+
xcodebuild -workspace app.xcworkspace -scheme app -sdk iphoneos -configuration Release -destination generic/platform=iOS CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO clean archive | xcpretty

.github/workflows/build-web.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Build for Web
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-web:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Run build
15+
run: |
16+
cd web
17+
yarn
18+
cd packages/vue2
19+
yarn build

.github/workflows/title-lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Pull Request Title Lint
2+
3+
on:
4+
pull_request:
5+
branches: [ "*" ]
6+
7+
jobs:
8+
title-lint:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- uses: amannn/action-semantic-pull-request@v5
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
with:
17+
types: |-
18+
feat
19+
fix
20+
chore
21+
docs
22+
ci
23+
tests
24+
requireScope: false

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,15 @@ More references:
3838

3939
License: [MIT](https://github.com/Djallil14/SwiftUI-FakeShopping-App/blob/main/LICENSE.md)
4040

41-
## React-Native Example
41+
## React Native SDK Example
4242
React-Native example app **v2ex** is forked from https://github.com/funnyzak/react-native-v2ex. To get started with the React-Native example, refer to the [React-Native Example README](react-native/README.md).
4343

44-
You can refer this [PR](https://github.com/aws-samples/clickstream-sdk-samples/pull/8/files) to learn how to integrate Clickstream Android and Swift SDK into react-native app.
44+
Please refer this [PR](https://github.com/aws-samples/clickstream-sdk-samples/pull/25/files#diff-92545e618a4ce920ced0c68cb0dd77f476ad4613261b41b57e3d41e8ab84a4e8R12-R19) to learn how to integrate Clickstream React Native SDK into your app.
45+
46+
You can also refer this [PR](https://github.com/aws-samples/clickstream-sdk-samples/pull/8/files) to learn how to manually integrate Clickstream Android and Swift SDK into react native app.
47+
48+
### Record screen views when using React Navigation
49+
Here's an [example](https://github.com/aws-samples/clickstream-sdk-samples/pull/25/files#diff-96a74db413b2f02988e5537fdbdf4f307334e8f5ef3a9999df7de3c6785af75bR344-R397) of globally logging React Native screen view events when using React Navigation 6.x:
4550

4651
License: [Apache-2.0](https://github.com/funnyzak/react-native-v2ex/blob/dev/LICENSE)
4752

ios/ModerneShopping.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)