pusher / push-notifications-web

Beams Browser notifications
MIT License
39 stars 20 forks source link

Start method returns undefined #86

Closed nickland03 closed 3 years ago

nickland03 commented 3 years ago

Start method returns undefined instead of Client.

This is the code from the official docs:

  const beamsClient = new PusherPushNotifications.Client({
    instanceId: 'YOUR_INSTANCE_ID',
  });

  beamsClient.start()
     // beamsClient is undefined
    .then(beamsClient => beamsClient.getDeviceId())
    .then(deviceId =>
      console.log('Successfully registered with Beams. Device ID:', deviceId)
    )
    .then(() => beamsClient.addDeviceInterest('hello'))
    .then(() => beamsClient.getDeviceInterests())
    .then(interests => console.log('Current interests:', interests))
    .catch(console.error);
benw-pusher commented 3 years ago

Hi, Could you elaborate a little on the issue here? Using the code above I am able to successfully register the device and add the interests. What does your full js file look like?