Skip to content
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

[User Model] Notification permission and PushSubscription observer updates #1532

Merged
merged 29 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8ae6275
run Prettier for linting test failure
jennantilla Jun 20, 2023
8a99c38
Migration guide fixes
jennantilla Jun 27, 2023
7dc08f7
Update Migration Guide formatting
jennantilla Jun 30, 2023
3b1949e
Update Notification permission observer and PushSubscription observer…
jennantilla Jul 1, 2023
c83d478
Update Migration Guide examples with new addEventListener methods for…
jennantilla Jul 1, 2023
118b343
Run Prettier for new linting errors
jennantilla Jul 1, 2023
0fc4ba5
Update clearEventHandler method with early return
jennantilla Jul 10, 2023
c6cf5c5
Fix lint error on EventManager class
jennantilla Jul 10, 2023
25b652c
Update Limitations and Notifications permission event listener code s…
jennantilla Jul 15, 2023
39ff2fe
Update iOS click listeners to be invoked by sharedInstance
jennantilla Jul 15, 2023
164d324
Remove old Email and SMS observers from iOS Event Emitter.
jennantilla Jul 15, 2023
3670e4f
Update PushSubscription interfaces, properties, and functions
jennantilla Jul 15, 2023
f0fb0f0
Delete native call to removePushSubscriptionObserver
jennantilla Jul 15, 2023
dfc58ca
Update InAppMessages listeners to be handled by EventManager
jennantilla Jul 15, 2023
7e10dbf
Update Notification event interfaces and methods
jennantilla Jul 15, 2023
762ee2b
Update Android Notification and IAM listeners to send entire event
jennantilla Jul 15, 2023
c544316
Update EventManager to allow for multiple Notification and IAM listeners
jennantilla Jul 15, 2023
4f8e60c
Fix lint errors
jennantilla Jul 15, 2023
7c0a465
remove clearHandlers public method
jennantilla Jul 17, 2023
970f29e
Update Event Manager method names
jennantilla Jul 21, 2023
5515e81
remove setLaunchURLsInApp
jennantilla Jul 21, 2023
f3b2aa5
Add back clearAll method to iOS
jennantilla Jul 21, 2023
e4ab46c
Update Android notification and push subscription conversion methods …
jennantilla Jul 21, 2023
07b9803
Remove user state refresh limitation from Migration Guide
jennantilla Jul 21, 2023
d8099e1
Update import for push subscription changed state and method declarat…
jennantilla Jul 21, 2023
d5d21f3
Replace logLevel types from int to enum
jennantilla Jul 21, 2023
117722b
Bump iOS native dependency to beta-5
jennantilla Jul 21, 2023
8568b1e
Update InAppMessage lifecycle listeners to send entire event on iOS
jennantilla Jul 21, 2023
980b458
Fix linting errors
jennantilla Jul 21, 2023
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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/ask-question.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🙋‍♂️ Ask a question
description: Tell us what's on your mind
title: "[question]: "
labels: ["question"]
title: '[question]: '
labels: ['question']
# assignees:
# - OneSignal/ios-sdk
body:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🪳 Bug report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
title: '[Bug]: '
labels: ['bug', 'triage']
# assignees:
# - OneSignal/ios-sdk
body:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/general-feedback.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 📣 General feedback
description: Tell us what's on your mind
title: "[Feedback]: "
labels: ["triage"]
title: '[Feedback]: '
labels: ['triage']
# assignees:
# - OneSignal/ios-sdk
body:
Expand Down
67 changes: 41 additions & 26 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,75 @@
<!-- START -->

# READ AND DELETE THIS SECTION BEFORE SUBMITTING PR
* **Fill out each _REQUIRED_ section**
* **Fill out _OPTIONAL_ sections, remove section if it doesn't apply to your PR**
* **Read and fill out each of the checklists below**
* **Remove this section after reading**

- **Fill out each _REQUIRED_ section**
- **Fill out _OPTIONAL_ sections, remove section if it doesn't apply to your PR**
- **Read and fill out each of the checklists below**
- **Remove this section after reading**
<!-- END -->

# Description

## One Line Summary

**REQUIRED** - Very short description that summaries the changes in this PR.

## Details

### Motivation

**REQUIRED -** Why is this code change being made? Or what is the goal of this PR? Examples: Fixes a specific bug, provides additional logging to debug future issues, feature to allow X.

### Scope

**RECOMMEND - OPTIONAL -** What is intended to be effected. What is known not to change. Example: Notifications are grouped when parameter X is set, not enabled by default.

### OPTIONAL - Other

**OPTIONAL -** Feel free to add any other sections or sub-sections that can explain your PR better.

# Testing

## Unit testing
**OPTIONAL -** Explain unit tests added, if not clear in the code.

**OPTIONAL -** Explain unit tests added, if not clear in the code.

## Manual testing

**RECOMMEND - OPTIONAL -** Explain what scenarios were tested and the environment.
Example: Tested opening a notification while the app was foregrounded, app build with Android Studio 2020.3 with a fresh install of the OneSignal example app on a Pixel 6 with Android 12.

# Affected code checklist
- [ ] Notifications
- [ ] Display
- [ ] Open
- [ ] Push Processing
- [ ] Confirm Deliveries
- [ ] Outcomes
- [ ] Sessions
- [ ] In-App Messaging
- [ ] REST API requests
- [ ] Public API changes

- [ ] Notifications
- [ ] Display
- [ ] Open
- [ ] Push Processing
- [ ] Confirm Deliveries
- [ ] Outcomes
- [ ] Sessions
- [ ] In-App Messaging
- [ ] REST API requests
- [ ] Public API changes

# Checklist

## Overview
- [ ] I have filled out all **REQUIRED** sections above
- [ ] PR does one thing
- If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
- [ ] Any Public API changes are explained in the PR details and conform to existing APIs

- [ ] I have filled out all **REQUIRED** sections above
- [ ] PR does one thing
- If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
- [ ] Any Public API changes are explained in the PR details and conform to existing APIs

## Testing
- [ ] I have included test coverage for these changes, or explained why they are not needed
- [ ] All automated tests pass, or I explained why that is not possible
- [ ] I have personally tested this on my device, or explained why that is not possible

- [ ] I have included test coverage for these changes, or explained why they are not needed
- [ ] All automated tests pass, or I explained why that is not possible
- [ ] I have personally tested this on my device, or explained why that is not possible

## Final pass
- [ ] Code is as readable as possible.
- Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
- [ ] I have reviewed this PR myself, ensuring it meets each checklist item
- WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

- [ ] Code is as readable as possible.
- Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
- [ ] I have reviewed this PR myself, ensuring it meets each checklist item
- WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.
6 changes: 3 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ categories:
- title: 🐛 Bug Fixes
label: Bug
- title: 🧰 Improvements
label: Improvement
label: Improvement
- title: down arrow Dependency Updates
label: Dependencies
label: Dependencies
change-template: '- $TITLE (#$NUMBER)'
version-resolver:
major:
Expand All @@ -23,5 +23,5 @@ version-resolver:
default: patch
template: |
## Other Changes

$CHANGES
2 changes: 1 addition & 1 deletion .github/workflows/Zapier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
# Triggers the workflow on push or pull request events but only for the "main" branch
issues:
types: [closed]

permissions:
issues: read

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ name: Test

on:
pull_request:
branches: "**"
branches: '**'

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: "[Setup] Node"
- name: '[Setup] Node'
uses: actions/setup-node@v3
with:
node-version: 16
- name: "[Setup] Dependencies"
- name: '[Setup] Dependencies'
run: yarn
- name: "[Test] Linting"
- name: '[Test] Linting'
run: yarn lint

- name: Unit tests results
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Release Drafter

on:
Expand Down
17 changes: 10 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:

### How to Contribute

We love the open source community and enjoy the support and contributions of many of our users. We ask that any potential contributors to the SDK Follow the following guidelines:

If your proposed contribution is a small bug fix, please feel free to create your own fork of the repository and create a pull request.

If your contribution would _break_ or _change_ the functionality of the SDK, please reach out to us on (contact) before you put in a lot of effort into a change we may not be able to use. We try our best to make sure that the SDK remains stable so that developers do not have to continually change their code, however some breaking changes _are_ desirable, so please get in touch to discuss your idea before you put in a lot of effort.

#### Reporting Bugs
If you have found a bug with the SDK, please feel free to open an Issue.

If you have found a bug with the SDK, please feel free to open an Issue.

If you are pretty certain that the issue is only related to the native iOS SDK, please open the issue in our [native iOS SDK repository](https://github.com/OneSignal/OneSignal-iOS-SDK).

If you are certain the issue is contained to the Android SDK, please open the issue in our [Android SDK repository](https://github.com/OneSignal/OneSignal-Android-SDK)

#### Before Submitting A Bug Report

Before creating bug reports, please check this list of steps to follow.

1. Make sure that you are actually encountering an _issue_ and not a _question_. If you simply have a question about the SDK, we would be more than happy to assist you in our Support section on the web (https://www.onesignal.com - click the Message button at the bottom right)
2. Please make sure to [include as many details as possible](#how-do-i-submit-a-good-bug-report)

> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.


#### How Do I Submit a Good Bug Report
* **Use a clear and descriptive title** for the issue to identify the problem.
* **Include Reproducibility** It is nearly always a good idea to include steps to reproduct the issue. If you cannot reliably reproduce the issue yourself, that's ok, but reproducible steps help best.
* **Describe your environment**, tell us what version of react-native your app is using, what version of the react-native-onesignal SDK you're using, how you added it to your project, and so on.
* **Include a Stack Trace** If your issue involves a crash/exception, ***PLEASE*** post the stack trace to help us identify the root issue.
* **Include an Example Project** This isn't required, but if you want your issue fixed quickly, it's often a good idea to include an example project as a zip and include it with the issue. You can also download the Demo project (included in the `/examples` folder of this repo) and set up an example project with this code as a starting point.

- **Use a clear and descriptive title** for the issue to identify the problem.
- **Include Reproducibility** It is nearly always a good idea to include steps to reproduct the issue. If you cannot reliably reproduce the issue yourself, that's ok, but reproducible steps help best.
- **Describe your environment**, tell us what version of react-native your app is using, what version of the react-native-onesignal SDK you're using, how you added it to your project, and so on.
- **Include a Stack Trace** If your issue involves a crash/exception, **_PLEASE_** post the stack trace to help us identify the root issue.
- **Include an Example Project** This isn't required, but if you want your issue fixed quickly, it's often a good idea to include an example project as a zip and include it with the issue. You can also download the Demo project (included in the `/examples` folder of this repo) and set up an example project with this code as a starting point.
Loading
Loading