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

Onesignal export typescript created #822

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,56 @@
</p>

### OneSignal Cordova Push Notification Plugin

[![npm version](https://img.shields.io/npm/v/onesignal-cordova-plugin.svg)](https://www.npmjs.com/package/onesignal-cordova-plugin) [![npm downloads](https://img.shields.io/npm/dm/onesignal-cordova-plugin.svg)](https://www.npmjs.com/package/onesignal-cordova-plugin)

---

[OneSignal](https://onesignal.com/) is a free email, sms, push notification, and in-app message service for mobile apps. This plugin makes it easy to integrate your [Cordova](http://cordova.apache.org/) based (e.g. [Ionic](http://ionicframework.com/), [PhoneGap](https://phonegap.com/), and PhoneGap Build app with OneSignal.
[OneSignal](https://onesignal.com/) is a free email, sms, push notification, and in-app message service for mobile apps. This plugin makes it easy to integrate your [Cordova](http://cordova.apache.org/) based (e.g. [Ionic](http://ionicframework.com/), [PhoneGap](https://phonegap.com/), and PhoneGap Build app with OneSignal.

<p align="center"><img src="https://app.onesignal.com/images/android_and_ios_notification_image.gif" width="500" alt="Cordova Notification"></p>

#### Installation and Setup

See the [Documentation](https://documentation.onesignal.com/docs) for installation and setup instructions:

- Cordova: https://documentation.onesignal.com/docs/cordova-sdk-setup
- Ionic: https://documentation.onesignal.com/docs/ionic-sdk-setup
- Phonegap: https://documentation.onesignal.com/docs/phonegap-sdk-setup
- Intel XDK: https://documentation.onesignal.com/docs/intel-xdk-setup

#### API

See OneSignal's [Cordova SDK API](https://documentation.onesignal.com/docs/cordova-sdk) page for a list of all available methods.

#### Change Log

See this repository's [release tags](https://github.com/OneSignal/OneSignal-Cordova-SDK/releases) for a complete change log of every released version.

#### Support

Please visit this repository's [Github issue tracker](https://github.com/OneSignal/OneSignal-Cordova-SDK/issues) for feature requests and bug reports related specificly to the SDK.
For account issues and support please contact OneSignal support from the [OneSignal.com](https://onesignal.com) dashboard.

#### Demo Project

To make things easier, we have published demo projects for [Cordova](https://github.com/OneSignal/OneSignal-Cordova-Example) and [Ionic](https://github.com/OneSignal/OneSignal-Ionic-Example)

#### Supports:
* Cordova, Ionic, Ionic Capacitor, and Phonegap
* Android 4.1 (API Level 16) through 12 (API Level 31), and Amazon FireOS
* iOS 9 - 15

- Cordova, Ionic, Ionic Capacitor, and Phonegap
- Android 4.1 (API Level 16) through 12 (API Level 31), and Amazon FireOS
- iOS 9 - 15

### Usages

```typescript
import Onesignal, {
OpenedEvent,
} from "onesignal-cordova-plugin/dist/Onesignal";

Onesignal.setAppId("YOUR_ONESIGNAL_APP_ID");
Onesignal.setNotificationOpenedHandler((jsonData: OpenedEvent) => {
console.log("notificationOpenedCallback: " + JSON.stringify(jsonData));
});
```
Loading