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
| import React from 'react-native'; | |
| import PushNotification from 'react-native-push-notification'; | |
| export default function () { | |
| PushNotification.configure({ | |
| // (optional) Called when Token is generated (iOS and Android) | |
| onRegister(data) { | |
| Meteor.call('notifications.set.pushToken', {data}, err => { | |
| if (err) { alert(`notifications.set.pushToken: ${err.reason}`); } | |
| }); |
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
| import _ from 'lodash'; | |
| const SEND_APN_MSG = 'notifications.send.APNMsg'; | |
| Meteor.methods({ | |
| 'notifications.send.APNMsg'({sendToUserId}) { | |
| check(arguments[0], { | |
| sendToUserId: String, | |
| }); | |
| const user = Meteor.users.findOne(sendToUserId); |
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
| import apnagent from 'apnagent'; | |
| let agent = new apnagent.Agent(); | |
| agent | |
| .set('cert', Assets.getText('cert.pem')) | |
| .set('key', Assets.getText('key.pem')) | |
| .enable('sandbox') | |
| .connect(function (err) { | |
| if (err) { |
NewerOlder