Created
January 9, 2019 09:36
-
-
Save indatawetrust/760031438696643b1e64e741b8bd7ae2 to your computer and use it in GitHub Desktop.
web-push with nodejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const OneSignal = require('onesignal-node'); | |
| const client = new OneSignal.Client({ | |
| app: { | |
| appAuthKey: '*', | |
| appId: '*', | |
| }, | |
| }); | |
| const notification = new OneSignal.Notification({ | |
| contents: { | |
| tr: '', | |
| en: '', | |
| }, | |
| filters: [], | |
| }); | |
| notification.postBody['included_segments'] = ['Active Users']; | |
| notification.postBody['web_url'] = '#'; | |
| notification.postBody['big_picture'] = '#' | |
| notification.postBody["headings"] = {"en": '', "tr": ''}; | |
| client.sendNotification(notification, function( | |
| err, | |
| httpResponse, | |
| data, | |
| ) { | |
| if (err) { | |
| } else { | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment