【问题标题】:Open a website link upon clicking on push notification in Android Phone单击 Android 手机中的推送通知后打开网站链接
【发布时间】:2015-12-29 10:32:09
【问题描述】:

我们正在使用 phonegap cordova 和 node-gcm 发送推送通知。实际上我们的移动应用程序还没有完成它有登录屏幕,所以在登录成功后我们将设备令牌发送到服务器。所以我们希望当我们发送推送通知时它会打开浏览器并重定向到链接,这可能吗?

节点代码

var gcm = require('node-gcm');
var message = new gcm.Message();

//API Server Key
var sender = new gcm.Sender('ccxxxcdddd');
var registrationIds = [];

sender.send(message, registrationIds, 4, function (a,result) {

    console.log("ok",a);
    console.log("result",result);

});

所以基本上我们希望在点击推送通知时在浏览器中打开特定链接。我们在移动设备中收到推送通知,但点击后打开应用程序

【问题讨论】:

  • 我相信你应该在你的应用程序中创建重定向功能。由于推送始终打开应用程序
  • 不,我认为这是可能的stackoverflow.com/questions/16526369/…
  • 您必须编写所需的代码,您必须编辑推送插件以包含该代码

标签: node.js cordova push-notification phonegap-plugins


【解决方案1】:

我们使用window.open('http://www.kidzout.com', '_system'); 来解决这个问题。应用在暂停状态下运行,不打开应用直接打开浏览器

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-22
    • 1970-01-01
    • 2017-08-27
    • 1970-01-01
    • 2018-01-12
    • 1970-01-01
    • 2017-10-14
    • 1970-01-01
    相关资源
    最近更新 更多