[aerogear-dev] Stuck in spConnect()

Sebastien Blanc scm.blanc at gmail.com
Tue Apr 1 16:04:22 EDT 2014


Hum,
That makes me think that we should maybe implement the push.registrations()
function as Mozilla does :

https://developer.mozilla.org/en-US/docs/Web/API/PushManager.registrations

This is really helpful to iterate over existing registrations,  not sure
about the security implications but yeah they provide it ...


On Tue, Apr 1, 2014 at 10:00 PM, Matthias Wessendorf <matzew at apache.org>wrote:

>
>
>
> On Tue, Apr 1, 2014 at 9:57 PM, Michi Oshima <michi.oshima at gmail.com>wrote:
>
>> Hi Sebastian,
>>
>> It makes sense, but I do need the value of pushEndpoint in this another
>> line<https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart/blob/master/js/unifiedpush.js#L33>.
>>  After the initial call to register(), pushEndpoint doesn't get returned
>> any more by the subsequent register() calls.
>>
>
> I *think* it was done for security reasons (pushEndpoint only on initial
> register, and not on re-registering).
>
>
>
>>
>> Hm.  Is the endpoint object what's stored in the local store?  That'd
>> make sense, yes.
>>
>>
>>    - ag-push-store
>>    {"channels":[{"requestObject":{},"channelID":"68e000dd-c0d9-42f1-9527-06b1c149d7f6","state":"used"}],"uaid":"5c557248-ed2d-4af3-8e9e-2ea2889e9730"}
>>
>>
>>
>> On Tue, Apr 1, 2014 at 3:47 PM, Sebastien Blanc <scm.blanc at gmail.com>wrote:
>>
>>> And in the mean time, while we find a proper way to fix that,  you can
>>>  remove the check you mention here  = > in this line<https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart/blob/master/js/unifiedpush.js#L29> ,
>>> this way it  will always call the registration, the first time it will
>>> create a new installation in UPS but after that it will just do an update.
>>> Might not be the most efficient as you do a call each time you connect your
>>> app but it's not that big impact (And this way you are sure it updates the
>>> UPS in case you add a category, change the alias ...)
>>>
>>>
>>> On Tue, Apr 1, 2014 at 9:33 PM, Lucas Holmquist <lholmqui at redhat.com>wrote:
>>>
>>>> we store some things in local-storage,  so you would need to delete
>>>> that record.
>>>>
>>>> if you are using chrome, you can use the dev tools and go to the
>>>> resources tab and delete the record that is aerogear-push(?),  i think
>>>> thats the name,  i don't have it in front of me
>>>>
>>>>
>>>> On Apr 1, 2014, at 2:50 PM, Michi Oshima <michi.oshima at gmail.com>
>>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm trying to adapt the sample code under
>>>> aerogear-simplepush-unifiedpush-quickstart<https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart>for my application.  I'm having a problem inside spConnect()
>>>> function<https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart/blob/master/js/unifiedpush.js#L15>
>>>> .
>>>>
>>>> When I first ran my code PushManager.register() call was successful,
>>>> and it returned a pushEndpoint.  But I had mistyped the code somewhere
>>>> below and I never got to call UPClient.registerWithPushServer(...)<https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart/blob/master/js/unifiedpush.js#L50>
>>>> .
>>>>
>>>> Every subsequent run of the spConnect() function skips the line to call
>>>> UPClient.registerWithPushServer(...), because PushManager.register() call
>>>> doesn't return a pushEndpoint.  (That's what you check in this line<https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart/blob/master/js/unifiedpush.js#L29>,
>>>> correct?)
>>>>
>>>> I'm guessing that I am somehow successfully registered with the simple
>>>> push server, but not with the unified push server.  I'm very new to
>>>> AeroGear, so I'm not at all sure.
>>>>
>>>>
>>>>    1. How should I best recover from this?
>>>>    2. If I'm correct about what's going on, how should I rearrange the
>>>>    code so that I can properly handle the situation where I'm registered with
>>>>    the simple push server but not with the unified push server?
>>>>
>>>> Thank you,
>>>>
>>>> Michi Oshima
>>>> _______________________________________________
>>>> aerogear-dev mailing list
>>>> aerogear-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> aerogear-dev mailing list
>>>> aerogear-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>>
>>>
>>>
>>> _______________________________________________
>>> aerogear-dev mailing list
>>> aerogear-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>
>>
>>
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20140401/173c68bb/attachment.html 


More information about the aerogear-dev mailing list