メテオールで新しくなった。Meteor:アプリがraixで閉じたときにプッシュ通知:Androidでプッシュ
今、私はCordovaとの統合を試みています。主に、Meteorのプッシュプラグインであるraix:プッシュ通知を使用しています。
通知内の画像を受け取ることはできませんが、アプリケーションはバックグラウンドで実行されているときに簡単な通知を受け取ります。
主な問題は、アプリケーションが完全に閉じられたときに通知を受信できないために発生し、サーバーはエラーメッセージをドロップしません。
アプリはHerokuサーバにデプロイされています。
%%%%%%%%%%%%%%%%%%%%%%
% mobile-config.js %%
%%%%%%%%%%%%%%%%%%%%%%
App.configurePlugin('phonegap-plugin-push', {
SENDER_ID: XXXXXXXXXXX
});
%%%%%%%%%%%%%%%%%%
% client/main.js %
%%%%%%%%%%%%%%%%%%
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import './main.html';
Push.Configure({
android: {
senderID: XXXXXXXXXXX,
alert: true,
badge: true,
sound: true,
vibrate: true,
clearNotifications: true
// icon: '',
// iconColor: ''
},
});
Template.hello.onCreated(function helloOnCreated() {
// counter starts at 0
this.counter = new ReactiveVar(0);
});
Template.hello.helpers({
counter() {
return Template.instance().counter.get();
},
});
Template.hello.events({
'click button'(event, instance) {
// increment the counter when button is clicked
instance.counter.set(instance.counter.get() + 1);
},
});
%%%%%%%%%%%%%%%%%%
% server/main.js %
%%%%%%%%%%%%%%%%%%
import { Meteor } from 'meteor/meteor';
Meteor.startup(() => {
// code to run on server at startup
Push.Configure({
gcm: {
apiKey: 'XXXXXXXXXXXXXXXXXXXXXX',
},
production: true,
});
});
Meteor.methods({
sendPush: function() {
return Push.send({
from: 'Test',
title:'Greetings',
text:'Hello world!',
badge: 3,
query: {},
});
},
});
mesaggeは
> Meteor.call('sendPush');
私は次のバージョンを使用しているサーバシェルに送信されます。
// [email protected]
// raix:[email protected]
// [email protected]
// [email protected]
が、私は問題が何であるかを理解していないと私が過ごしました解決策を見つけようと多くの時間を費やしています。どんな助けも歓迎されます。
にも同様の問題があります。それを解決できましたか? – user3807691