Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

SimplePush: use pushEndpoint URL as device token #290

Closed
wants to merge 2 commits into from
Closed

Conversation

matzew
Copy link
Contributor

@matzew matzew commented Jul 11, 2014

For SimplePush we now use the pushEndpoint URL as device-token instead of having it its own field. We also no longer store channelID, was device-token in the past

Done for https://issues.jboss.org/browse/AGPUSH-532

…d of having it its own field. We also no longer store channelID, was device-token in the past
@matzew
Copy link
Contributor Author

matzew commented Jul 11, 2014

Test:

Using this as a quick, hacky client:
https://gist.github.com/matzew/cbda360d72eaaef75971

Used the returned pushEndpoint as devicetoken, and did a CURL registration, like:

curl -u "d30082b0-0102-4756-a8ec-08665ee4e8e8:d7f15b49-6b65-4773-9296-94948be3dbea" -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{
"deviceToken" : "https://updates.push.services.mozilla.com/update/C_k8o-RCV2BqGiMChwAFdp_cTc2skKDoZ4HEheBqu7NujlMel0rXsh52dvQrqtB7gETOgpN3mR4YvGYH5njqeaGDxJexJB4VNIix4WC8b-bP1aGjUQ==","alias" : "mwessendorf"}' http://localhost:8080/ag-push/rest/registry/device

Now, with the deployed fix, I was able to get the 'onmessage' callback receiving an update, based on a push out of the AdminUI

@@ -67,7 +66,7 @@ public String getDeviceToken() {
* <ul>
* <li> APNs: <code>deviceToken</code>
* <li> GCM: <code>registrationId</code>
* <li> SimplePush: <code>channelId</code>
* <li> SimplePush: <code>pushEndoint</code>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "pushEndpoint"

@sebastienblanc
Copy link
Member

Ok tested with success with Firefox OS 👍

@sebastienblanc
Copy link
Member

For those interested testing it with FFOS, I updated my ChcukPush repo to support this change :) https://github.com/sebastienblanc/chuckpush/

@sebastienblanc
Copy link
Member

I just noticed that I can not toggle an "installation" to "off", I'm getting this error http://pastie.org/9378086

@edewit
Copy link
Member

edewit commented Jul 11, 2014

Could it be that it's an old database?

@matzew
Copy link
Contributor Author

matzew commented Jul 11, 2014

@sebastienblanc @edewit not related to this PR.

I am getting the same on MASTER branch (tested with a CLEAN AS7 and CLEAN DB).

Can not construct instance of org.jboss.aerogear.unifiedpush.api.VariantType from String value 'ios': value not one of declared Enum instance names
 at [Source: org.apache.catalina.connector.CoyoteInputStream@672ded8d; line: 1, column: 281] (through reference chain: org.jboss.aerogear.unifiedpush.api.Installation["variantType"])

@matzew
Copy link
Contributor Author

matzew commented Jul 11, 2014

is that something related to the model simplification ?

@matzew
Copy link
Contributor Author

matzew commented Jul 11, 2014

File new JIRA: https://issues.jboss.org/browse/AGPUSH-803

@matzew
Copy link
Contributor Author

matzew commented Jul 11, 2014

landed

@matzew matzew closed this Jul 11, 2014
@matzew matzew deleted the AGPUSH-532 branch July 29, 2014 07:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants