<div dir="ltr">Hi,<div><br></div><div>I'm trying to adapt the sample code under <a href="https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart">aerogear-simplepush-unifiedpush-quickstart</a> for my application. I'm having a problem inside <a href="https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart/blob/master/js/unifiedpush.js#L15">spConnect() function</a>.</div>
<div><br></div><div>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 <a href="https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart/blob/master/js/unifiedpush.js#L50">UPClient.registerWithPushServer(...)</a>.</div>
<div><br></div><div>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 <a href="https://github.com/aerogear/aerogear-simplepush-unifiedpush-quickstart/blob/master/js/unifiedpush.js#L29">in this line</a>, correct?)</div>
<div><br></div><div>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.</div><div><br></div>
<div><ol><li>How should I best recover from this? <br></li><li>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?<br>
</li></ol></div><div>Thank you,</div><div><br></div><div>Michi Oshima</div></div>