Search code examples
loopbackjsstrongloop

Using Push Notications in Strongloop


I am trying to add push notification support to a REST server build in Strongloop / Loopback. I have followed the instructions at http://docs.strongloop.com/display/public/LB/Push+notifications, but it fails. It seems to be due to the line that reads var db = require('./data-sources/db'); this doesn't exist in my loopback installation (perhaps it is documentation related to an older version)?

I can get the sample server running, but trying to get it going in my application has eluded me...


Solution

  • The doc is outdated (I'll fix it). That way of getting the data source is based on the old structure of the push example. You will need to get a handle on your data source differently; typically something like

    var datasource = app.datasources.db;
    

    See Working with LoopBack objects for more information.