You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am getting errors in the example.
I just changed import 'package:service_worker/service_worker.dart';
to import 'package:service_worker/worker.dart';
And I am getting the following in the web console:
`
MAIN: registereddart_sdk.js:18740
MAIN: ready dart_sdk.js:18740
MAIN: Sending message: Sample message: 2019-06-18 10:52:26.908 dart_sdk.js:18740
MAIN: Message sent: Sample message: 2019-06-18 10:52:26.908 main.dart:34
Uncaught (in promise) TypeError: Cannot read property 'new' of undefined
`
Where new is used there:
var subs = await registration.pushManager .subscribe(new sw.PushSubscriptionOptions(userVisibleOnly: true));
The text was updated successfully, but these errors were encountered:
AFAICR worker is for on-page web worker, and with that it may not have access to the pushManager. But my memory is really vague on this one, I haven't done deep web coding for ages...
Hello,
I am getting errors in the example.
I just changed
import 'package:service_worker/service_worker.dart';
to
import 'package:service_worker/worker.dart';
And I am getting the following in the web console:
`
MAIN: registereddart_sdk.js:18740
MAIN: ready dart_sdk.js:18740
MAIN: Sending message: Sample message: 2019-06-18 10:52:26.908 dart_sdk.js:18740
MAIN: Message sent: Sample message: 2019-06-18 10:52:26.908 main.dart:34
Uncaught (in promise) TypeError: Cannot read property 'new' of undefined
`
Where new is used there:
var subs = await registration.pushManager .subscribe(new sw.PushSubscriptionOptions(userVisibleOnly: true));
The text was updated successfully, but these errors were encountered: