简体   繁体   English

当我切换到生产证书时,Trigger.io和解析推送通知不起作用

[英]Trigger.io & Parse push notifications don't work when I switch to production certificate

Using Trigger.io and Parse - I'm trying to submit my app to the iOS store. 使用Trigger.io和Parse-我正尝试将我的应用提交到iOS商店。 I got parse push notifications working on iOS (and Android) using a development provisioning profile. 我使用开发配置文件解析了可在iOS(和Android)上使用的推送通知。 I switched to an ad-hoc production certificate, and now the same code gets this error: 我切换到临时生产证书,现在相同的代码得到此错误:

TypeError: 'undefined' is not an object

For this line: (In reality it's more complex but I stripped it down to this line and it still doesn't work.) 对于此行:( 实际上,它更复杂,但我将其简化为该行,但仍然无法使用。)

forge.event.messagePushed.addListener(function (msg) {
    forge.logging.log(JSON.stringify(msg));
  });

Things I've done: 我所做的事情:

  • Checked to make sure the parse module was set up in config.json with the right keys 检查以确保使用正确的键在config.json中设置了解析模块
  • Check to make sure I'm using the new correct provisioning profile to build the app 检查以确保我使用新的正确的配置文件来构建应用程序
  • Used the correct .p12 file for the parse certificate. 为解析证书使用了正确的.p12文件。
  • Made sure I'm subscribed to the correct channel. 确保我订阅了正确的频道。

What am I doing wrong? 我究竟做错了什么?

edit: Cleaned up code for more clarity. 编辑:清理代码以更清楚。

edit: Check out the comments for more info. 编辑:查看注释以获取更多信息。 It might help to mention that when I run 我跑步时可能要提一下

forge.event.messagePushed.addListener(function (msg) {
    alert(JSON.stringify(msg));
});

It returns an alert (with message: "undefined") right away. 它立即返回警报(带有消息:“ undefined”)。

In your question you are actually talking about two different things. 在您的问题中,您实际上是在谈论两种不同的事物。

The forge.notification module has nothing to do with the push notifications provided by the Parse integration. forge.notification模块与Parse集成提供的推送通知无关。 The former can be used to send a notification to the user's phone which is triggered by the app and while the app is opened . 前者可用于将通知发送到用户的手机,该通知由该应用触发并在该应用打开时触发。

In my opinion this is not extremely useful to send push notifications, as those are usually triggered when something happens while the user is not currently using the app . 我认为这对于发送推送通知不是非常有用,因为通常在用户当前不使用该应用程序时发生某些事件触发推送通知。 Thats where the Parse integration comes into play. 那就是Parse集成发挥作用的地方。 The correct module for this is called forge.partners.parse . 正确的模块称为forge.partners.parse

You can trigger push notifications manually from the Parse Web Interface. 您可以从解析Web界面手动触发推送通知。 Go to the Push section of your app (URL: https://parse.com/apps/<your app>/push_notifications ) and choose + Send a push on the top. 转到应用程序的“推送”部分(URL: https://parse.com/apps/<your app>/push_notifications : https://parse.com/apps/<your app>/push_notifications <您的应用https://parse.com/apps/<your app>/push_notifications ),然后在顶部选择+ Send a push There you can target, customize and send your push. 您可以在那里定位,自定义和发送推送。 Hope this helps. 希望这可以帮助。

If you want to automatically trigger push notifications based on certain events (eg on your backend server), you should have a look at the Parse Push Notification Guide . 如果您想基于某些事件自动触发推送通知(例如,在后端服务器上),则应查看《 解析推送通知指南》

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行iOS时的Trigger.io不打开模拟器 - Trigger.io when run ios don't open simulator 当我仍在测试我的应用程序时,带有Production-SSL证书的推送通知将起作用吗? 我怎么知道它会起作用? - will push notifications with Production-SSL certificate work when I'm still testing my app? How can I know it will work? 当应用程序在后台运行时,推送通知不起作用 - Push notifications don't work when app is in background Trigger.io和Parse通道推送通知的其他数据用于深层链接 - Trigger.io and Parse channel push notification additional data for deep-linking Trigger.io无法指向证书。 / usr / bin / codesign:iPhone开发人员:找不到身份 - Trigger.io Can't point to certificate. /usr/bin/codesign: iPhone Developer: no identity found 使用Trigger.io开发时如何使用自签名SSL证书? - How to use a self-signed SSL certificate when developing with Trigger.io? 我未注册时,推送通知仍会播放声音 - Push Notifications still play sounds when I don't register it 推送通知不起作用 Xcode 11.3.1 - Push notifications don't work Xcode 11.3.1 我可以检测用户是否在trigger.io上全局禁用推送通知吗? - Can i detect if the user disables push notification globally on trigger.io? 推送通知是为了开发而不是生产而工作 - Push notifications work for development, not production
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM