Skip to content

Commit

Permalink
Merge pull request #71 from OneSignal/2.0.4
Browse files Browse the repository at this point in the history
2.0.4 Release - fix typescript compiler errors related to event handler functions
  • Loading branch information
rgomezp committed May 25, 2022
2 parents c9550a7 + 0075739 commit 9821073
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
Expand All @@ -20,6 +19,3 @@ dist
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# NPM README file
package/README.md
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Modified MIT License

Copyright 2021 OneSignal
Copyright 2022 OneSignal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ Special thanks to [pedro-lb](https://github.com/pedro-lb) and others for work on
<img src="https://user-images.githubusercontent.com/11739227/119415383-1d354700-bcb7-11eb-946d-01c40cd07010.png" />
</a>

Enjoy!
Enjoy!
2 changes: 1 addition & 1 deletion example/src/onesignal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OneSignal from 'react-onesignal';

export default async function runOneSignal() {
await OneSignal.init({ appId: 'bb8fb3ed-6c11-4dc4-b026-83d3d29e45ee'});
await OneSignal.init({ appId: 'bb8fb3ed-6c11-4dc4-b026-83d3d29e45ee', allowLocalhostAsSecureOrigin: true});
OneSignal.showSlidedownPrompt();
}
12 changes: 6 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ interface IInitObject {

interface IOneSignal {
init(options: IInitObject): Promise<void>
on(event: string, listener: () => void): void
off(event: string, listener: () => void): void
once(event: string, listener: () => void): void
on(event: string, listener: (eventData?: any) => void): void
off(event: string, listener: (eventData?: any) => void): void
once(event: string, listener: (eventData?: any) => void): void
isPushNotificationsEnabled(callback?: Action<boolean>): Promise<boolean>
showHttpPrompt(options?: AutoPromptOptions): Promise<void>
registerForPushNotifications(options?: RegisterOptions): Promise<void>
Expand Down Expand Up @@ -162,7 +162,7 @@ interface IOneSignal {



function on(event: string, listener: () => void): void {
function on(event: string, listener: (eventData?: any) => void): void {
if (!doesOneSignalExist()) {
reactOneSignalFunctionQueue.push({
name: 'on',
Expand All @@ -176,7 +176,7 @@ interface IOneSignal {
});
}

function off(event: string, listener: () => void): void {
function off(event: string, listener: (eventData?: any) => void): void {
if (!doesOneSignalExist()) {
reactOneSignalFunctionQueue.push({
name: 'off',
Expand All @@ -190,7 +190,7 @@ interface IOneSignal {
});
}

function once(event: string, listener: () => void): void {
function once(event: string, listener: (eventData?: any) => void): void {
if (!doesOneSignalExist()) {
reactOneSignalFunctionQueue.push({
name: 'once',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-onesignal",
"version": "2.0.3",
"version": "2.0.4",
"description": "React OneSignal Module: Make it easy to integrate OneSignal with your React App!",
"author": "rgomezp",
"contributors": [{ "name": "Rodrigo Gomez-Palacio" }, { "name": "Pedro Bini" }, { "name": "Graham Marlow" }],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"outDir": "build",
"outDir": "dist",
"module": "esnext",
"target": "es6",
"lib": ["es6", "dom", "es2016", "es2017"],
Expand Down

0 comments on commit 9821073

Please sign in to comment.