Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OneSignal/OneSignal-Unity-SDK
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.0
Choose a base ref
...
head repository: OneSignal/OneSignal-Unity-SDK
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 1,210 changed files with 85,904 additions and 12,863 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/ask-question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🙋‍♂️ Ask a question
description: Tell us what's on your mind
title: "[question]: "
labels: ["Question"]

body:
- type: markdown
attributes:
value: |
Having issues integrating this SDK?
- type: textarea
id: question
attributes:
label: How can we help?
description: Specific question regarding integrating this SDK.
placeholder: How do I...?
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://onesignal.com/code-of-conduct)
options:
- label: I agree to follow this project's Code of Conduct
required: true
80 changes: 80 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: 🪳 Bug report
description: File a bug report
title: "[Bug]: "
labels: ["Bug"]

body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Provide a thorough description of whats going on.
placeholder: The latest version of the SDK causes my screen to go blank when I tap on the screen three times.
validations:
required: true
- type: textarea
id: reproduction-steps
attributes:
label: Steps to reproduce?
description: Provide as much detail as posible to reproduce the issue.
placeholder: |
1. Install vX.Y.Z of dependency
2. Launch the app on iOS device
3. Tap the screen three times
4. Note that the app crashes
render: Markdown
validations:
required: true
- type: textarea
id: what-are-expectations
attributes:
label: What did you expect to happen?
description: Also tell us, what did you expect to happen?
placeholder: I expected the app to continue running no matter how many times I tap the screen.
validations:
required: true
- type: textarea
id: unity-version
attributes:
label: Unity version
description: What version of Unity are you running?
placeholder: 2021.2.x
value: 2021.2.12 (latest)
validations:
required: true
- type: textarea
id: unity-sdk-version
attributes:
label: OneSignal Unity SDK version
description: The version of the OneSignal Unity SDK used in your app.
placeholder: 3.0.0-beta.6 Release
validations:
required: true
- type: dropdown
id: platform
attributes:
label: Platform
description: Which platform are you having an issue with?
multiple: true
options:
- iOS
- Android
- Other
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: Shell
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/OneSignal-Unity-SDK/blob/a5a2db49604e9b6386fb46c7869db9d7f814702d/CONTRIBUTING.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/general-feedback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 📣 General feedback
description: Tell us what's on your mind
title: "[General]: "
labels: ["Feedback"]

body:
- type: markdown
attributes:
value: |
Thanks for sharing your valuable feedback!
- type: textarea
id: feedback
attributes:
label: What's on your mind?
description: Feedback regarding this SDK.
placeholder: Share your feedback...
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://onesignal.com/code-of-conduct)
options:
- label: I agree to follow this project's Code of Conduct
required: true
58 changes: 58 additions & 0 deletions .github/os_probot_metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Based on probot-metadata - https://github.com/probot/metadata
*/
const regex = /\n\n<!-- probot = (.*) -->/

const { Octokit } = require("@octokit/action")

const octokit = new Octokit()

module.exports = (context, issue = null) => {
console.log(context)
const prefix = "onesignal-probot"

if (!issue) issue = context.payload.issue

return {
async get (key = null) {
let body = issue.body

if (!body) {
body = (await octokit.issues.get(issue)).data.body || ''
}

const match = body.match(regex)

if (match) {
const data = JSON.parse(match[1])[prefix]
return key ? data && data[key] : data
}
},

async set (key, value) {
let body = issue.body
let data = {}

if (!body) body = (await octokit.issues.get(issue)).data.body || ''

body = body.replace(regex, (_, json) => {
data = JSON.parse(json)
return ''
})

if (!data[prefix]) data[prefix] = {}

if (typeof key === 'object') {
Object.assign(data[prefix], key)
} else {
data[prefix][key] = value
}

body = `${body}\n\n<!-- probot = ${JSON.stringify(data)} -->`

const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/")
const issue_number = context.payload.issue.number
return octokit.issues.update({ owner, repo, issue_number, body })
}
}
}
57 changes: 57 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!-- 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**
<!-- 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.

# Testing
## Unit testing
**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

# 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

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

## 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.
27 changes: 27 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name-template: $RESOLVED_VERSION
tag-template: $RESOLVED_VERSION
categories:
- title: 🚀 Features
label: Enhancement / Feature
- title: 🐛 Bug Fixes
label: Bug
- title: 🧰 Improvements
label: Improvement
- title: down arrow Dependency Updates
label: Dependencies
change-template: '- $TITLE (#$NUMBER)'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Other Changes
$CHANGES
47 changes: 47 additions & 0 deletions .github/set_response_times.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
function calcResponseTimeForIssueCreatedAt(createdAt) {
const issueOpenedDate = new Date(createdAt);
const issueTriagedDate = new Date();
const businessDaysResponseTime = calcBusinessDaysBetweenDates(issueOpenedDate, issueTriagedDate);
return businessDaysResponseTime;
}

function calcBusinessDaysBetweenDates(openedDate, triagedDate) {
let differenceInWeeks, responseTime;
if (triagedDate < openedDate)
return -1; // error code if dates transposed
let openedDay = openedDate.getDay(); // day of week
let triagedDay = triagedDate.getDay();
openedDay = (openedDay == 0) ? 7 : openedDay; // change Sunday from 0 to 7
triagedDay = (triagedDay == 0) ? 7 : triagedDay;
openedDay = (openedDay > 5) ? 5 : openedDay; // only count weekdays
triagedDay = (triagedDay > 5) ? 5 : triagedDay;
// calculate differnece in weeks (1000mS * 60sec * 60min * 24hrs * 7 days = 604800000)
differenceInWeeks = Math.floor((triagedDate.getTime() - openedDate.getTime()) / 604800000);
if (openedDay < triagedDay) { //Equal to makes it reduce 5 days
responseTime = (differenceInWeeks * 5) + (triagedDay - openedDay);
}
else if (openedDay == triagedDay) {
responseTime = differenceInWeeks * 5;
}
else {
responseTime = ((differenceInWeeks + 1) * 5) - (openedDay - triagedDay);
}
return (responseTime);
}

module.exports = async(context, osmetadata) => {
const foundResponseTime = await osmetadata(context).get('response_time_in_business_days');
if (foundResponseTime) {
const foundString = "already found response time in business days: " + foundResponseTime
console.log(foundString);
return foundString;
}
if (context.payload.comment && context.payload.comment.author_association != "MEMBER" && context.payload.comment.author_association != "OWNER" && context.payload.comment.author_association != "CONTRIBUTOR") {
return;
}
const businessDaysResponseTime = calcResponseTimeForIssueCreatedAt(context.payload.issue.created_at);
console.log("response time in business days: " + businessDaysResponseTime);
const result = osmetadata(context, context.payload.issue).set('response_time_in_business_days', businessDaysResponseTime)
console.log("osmetadata update result: " + result);
return "set response time in business days: " + businessDaysResponseTime;
}
18 changes: 18 additions & 0 deletions .github/workflows/activation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Acquire activation file
on:
workflow_dispatch: {}
jobs:
activation:
name: Request manual activation file 🔑
runs-on: ubuntu-latest
steps:
# Request manual activation file
- name: Request manual activation file
id: getManualLicenseFile
uses: game-ci/unity-request-activation-file@v2
# Upload artifact (Unity_v20XX.X.XXXX.alf)
- name: Expose as artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.getManualLicenseFile.outputs.filePath }}
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
47 changes: 47 additions & 0 deletions .github/workflows/asana-add-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Github --> Asana Add Comment Workflow

on:
issue_comment:
types: [created]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
issues: read
steps:
- name: Get Asana Task Corresponding to Issue
env:
ISSUE_ID: ${{ github.event.issue.id }}
REPO_FULL_NAME: ${{ github.event.repository.full_name }}
WORKSPACE_ID: "780103692902078"
run: |
REPO_SCOPED_ISSUE_ID="$REPO_FULL_NAME#$ISSUE_ID"
curl --request GET \
--url "https://app.asana.com/api/1.0/workspaces/$WORKSPACE_ID/tasks/search?opt_fields=notes&text=$REPO_SCOPED_ISSUE_ID&sort_by=modified_at&sort_ascending=false" \
--header 'accept: application/json' \
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
--output response.json
TASK_GID=$(jq -r '.data[0].gid' response.json)
echo "TASK_GID=$TASK_GID" >> $GITHUB_ENV
- name: Comment on Asana Task
env:
ISSUE_COMMENT: ${{ github.event.comment.body }}
COMMENTER_NAME: ${{ github.event.comment.user.login }}
run: |
BODY_DATA=$(jq -n \
--arg text "$ISSUE_COMMENT" \
--arg commenter_name "$COMMENTER_NAME" \
'{
"data": {
"text": "\($commenter_name) left a comment:\n\n\($text)",
}
}')
curl --request POST \
--url https://app.asana.com/api/1.0/tasks/$TASK_GID/stories \
--header 'accept: application/json' \
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
--header 'content-type: application/json' \
--data "$BODY_DATA"
Loading