Skip to content

feat: implement Clickstream React Native SDK #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
09ee34f
feat: implement clickstream react native SDK
Apr 2, 2024
a18d246
feat: add ios package resolved file
Apr 2, 2024
2e89909
fix: change license in pr template
Apr 2, 2024
aadd822
fix: change build name for web
Apr 2, 2024
c4171cd
fix: update build rn workflow
Apr 2, 2024
16736ef
fix: update clickstream swift sdk version
Apr 2, 2024
d3a6ab2
fix: use xcode-select to use Xcode 15.2 app
Apr 2, 2024
512c90d
fix: change sdk name, test build ios
Apr 3, 2024
e1dd857
fix: change to react native SDK 0.1.0 version, optimize ios build action
Apr 3, 2024
cf415a9
fix: add pod install for react native ios build
Apr 3, 2024
1ecd327
feat: optimize readme and react native ios project build
Apr 3, 2024
a92e79f
feat: add example link in readme
Apr 3, 2024
d1ba60c
fix: add exit code for build rn-ios
Apr 7, 2024
2604425
fix: upgrade clickstream version and Compatible with Swift version 5
Apr 7, 2024
3277bab
fix: add xcode version 15.2 to build rn-ios
Apr 7, 2024
be2ce69
fix: add clang
Apr 7, 2024
58de834
fix: remove unary binary function and fix ios build issue
Apr 7, 2024
9dc0504
fix: optimize ios build
Apr 7, 2024
9f4d926
fix: remove gcc compile option and optimize ios build
Apr 7, 2024
f778252
fix: test build with fail
Apr 7, 2024
1af0807
fix: test build success
Apr 7, 2024
ce67843
ci: Update build-rn.yml
zhu-xiaowei Apr 7, 2024
03d7536
ci: Update Podfile test build fail
zhu-xiaowei Apr 7, 2024
02abf83
ci: revert pod file
zhu-xiaowei Apr 7, 2024
db84701
ci: add pipe fail for build-ios
zhu-xiaowei Apr 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Bug Report
description: Create a report to help us improve
body:
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps To Reproduce
description: How do you trigger this bug? Please walk us through it step by step.
value: |
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
render: typescript
validations:
required: true
- type: textarea
id: behavior
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: input
id: clickstream-version
attributes:
label: ClickstreamAnalytic SDK Version
placeholder: e.g. 1.0.0
validations:
required: true
- type: input
id: platform
attributes:
label: The platform of the bug
placeholder: |
- e.g. Android/iOS/Web/All
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: >-
Include any relevant log output
value: |
<details>
<summary>Log Messages</summary>

```
INSERT LOG MESSAGES HERE
```
</details>
render: shell
- type: dropdown
id: regression
attributes:
label: Is this a regression?
multiple: false
options:
- "Yes"
- "No"
validations:
required: true
- type: textarea
id: regression-info
attributes:
label: Regression additional context
placeholder: If it was a regression provide the versions used before and after the upgrade.
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the problem here.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature request
description: Suggest an idea for this project
body:
- type: textarea
id: description
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true

- type: textarea
id: proposal
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: true

- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the problem here.
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Issue \#
<!-- If applicable, please link to issue(s) this change addresses -->

## Description
<!-- Why is this change required? What problem does it solve? -->

## General Checklist
<!-- Check or cross out if not relevant -->

- [ ] Added new tests to cover change, if needed
- [ ] Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
- [ ] Documentation update for the change if required
- [ ] PR title conforms to conventional commit style
- [ ] If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT-0 license.
22 changes: 22 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build for Android

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
cache: gradle
- name: Build android apk
run: |
cd android
./gradlew assembleDebug
22 changes: 22 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build for iOS

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-ios:
runs-on: macos-13-xl
steps:
- uses: actions/checkout@v3
- name: Build ios
run: |
sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'
xcode-select --print-path
cd ios
xcodebuild -resolvePackageDependencies
echo "start build ios app"
set -o pipefail
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
49 changes: 49 additions & 0 deletions .github/workflows/build-rn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build for React Native

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
lint-rn:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run lint
run: |
cd react-native
yarn
yarn lint

build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
cache: gradle
- name: Build android apk
run: |
cd react-native
yarn
cd android
./gradlew assembleDebug

build-ios:
runs-on: macos-13-xl
steps:
- uses: actions/checkout@v3
- name: Build ios
run: |
sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'
xcode-select --print-path
cd react-native
yarn
cd ios && pod install
echo "start build ios app"
set -o pipefail
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
19 changes: 19 additions & 0 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build for Web

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run build
run: |
cd web
yarn
cd packages/vue2
yarn build
24 changes: 24 additions & 0 deletions .github/workflows/title-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull Request Title Lint

on:
pull_request:
branches: [ "*" ]

jobs:
title-lint:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |-
feat
fix
chore
docs
ci
tests
requireScope: false
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ More references:

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

## React-Native Example
## React Native SDK Example
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).

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.
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.

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.

### Record screen views when using React Navigation
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:

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"location" : "https://github.com/awslabs/clickstream-swift.git",
"state" : {
"branch" : "main",
"revision" : "32f44a86c1674f8375e2de903a6aeb21420bd4d7"
"revision" : "a2c331eed23b8441aedc6de4e2fba2d339bf35b7"
}
},
{
Expand Down
13 changes: 0 additions & 13 deletions react-native/.github/FUNDING.yml

This file was deleted.

18 changes: 0 additions & 18 deletions react-native/.github/ISSUE_TEMPLATE/bug_report.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions react-native/.github/ISSUE_TEMPLATE/custom.md

This file was deleted.

28 changes: 0 additions & 28 deletions react-native/.github/ISSUE_TEMPLATE/feature_request.yaml

This file was deleted.

Loading