Hi Sébastien,
Sébastien Blanc wrote
>
> Also, how should I detect whether registration with SPS is previously
> done?
> Would the `mailEndpoint` be falsey in that case?
Yes
> I'm talking about this
> sample code
> <
>
https://github.com/aerogear/aerogear-js-cookbook/blob/master/simplepush-u...
> >
> .
I haven't run the sample code I mention above. But in my code the endpoint
(`event.target.result`) is never falsey. I just tested this. I use
aerogear.js version 2.0.0. My code snippet below:
```javascript
request.onsuccess = function (event) {
var endpoint = event.target.result;
var channelID = event.type.replace('-success', '');
if (! endpoint) {
console.log('null endpoint for topic registration: channelID=' +
channelID);
return;
}
console.log('successful simple push registration: topic=' + topic + ',
channelID=' + channelID);
```
Console always logs 'successful simple push registration'.
Also Matthias, if I am supposed to register with simple push only the first
time, then should I still be registering/unregistering with UPS every time I
run my application?
--
View this message in context:
http://aerogear-users.1116366.n5.nabble.com/Registering-and-unregistering...
Sent from the aerogear-users mailing list archive at
Nabble.com.