Search code examples
buildfire

BuildFire: Push Notification Testing


I'm have a plugin that I'd like to send push notifications with. Referencing the BuildFire SDK Wiki, I've followed the documentation, but never received any notifications. As a trouble shooting step I've created a bare bones plugin that does nothing else aside from scheduling a push notification.

Here's the code that I'm using:

let now = new Date();
const fiveMinutes = (1000 * 60 * 5);
const sendAt = new Date(now.getTime() + fiveMinutes);

buildfire.notifications.pushNotification.schedule({
  title:"Notification title"
  ,text:"Notification text"
  ,at: sendAt
  },function(e){
       if(e) console.error(e); 
});

I'm testing this using a simple test app, from within the BuildFire Previewer app. As this is not a real app, it doesn't have any certificates for Push Notification. Can I receive the pushNotification SDK calls from within a test app via the Previewer that doesn't have any certificates?

Additionally, I don't receive any errors when testing via the SDK or the control panel. I do get the the callback function as expected, and no exception data in returned.


Solution

  • You are correct. The Previewer app will not allow you to send push notifications properly and here is why... The previewer app is set up with a certificate. However, When your hot loaded app sends a push notification to queue up in the server. It will not find a certificate matching your hot loaded app id. And thus fail on the server.