uniqush / uniqush-push

Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.
http://uniqush.org
Apache License 2.0
1.54k stars 201 forks source link

(Beginner's question) Cannot get a push to work after successfully registering a subscription #240

Closed aaronvdbrugge closed 5 years ago

aaronvdbrugge commented 5 years ago

I managed to get it running but I think I'm doing one step wrong. Could you please take a look at my console log? Perhaps you can recognize the issue.

This is my Console log:

image

This is my Android app. I used it to send a WWW form to my server http://216.119.157.64:5400/subscribe. As you can see from the returned text beneath INITIALIZE, it looks like that worked. It says UNIQUSH_SUCCESS.

screenshot_2019-02-19-20-27-44

So I'm not sure what's wrong. I might be doing something very obviously wrong, because this is my very first time working with notifications.

I got them to work with a local demo server on my laptop/WLAN but that's not useful for real use cases. Now I'm trying to get it to work with uniqush-push on my cloud server.

mishan commented 5 years ago

After calling addpsp to add a push endpoint, then need to call subscribe to subscribe that user to that service.

Then you can call push with some friendly name instead of that hash.

Please see the docs, particularly /subscribe

https://uniqush.org/documentation/usage.html

aaronvdbrugge commented 5 years ago

After calling addpsp to add a push endpoint, then need to call subscribe to subscribe that user to that service.

Then you can call push with some friendly name instead of that hash.

Please see the docs, particularly /subscribe

https://uniqush.org/documentation/usage.html

What I did was:

So I followed what you said already but it doesn't work?

I read the documentation over and over hehe.

Can you tell anything from my console picture what the issue is?

aaronvdbrugge commented 5 years ago

Is there any way to "debug" uniqush-push by viewing a list of subscribers, providers, etc.? @mishan

mishan commented 5 years ago

@aaronvdbrugge You can always poke inside your Redis instance with redis-cli

Here are the Redis keys it uses (from pushredisdb.go):


const (
    DELIVERY_POINT_PREFIX                                  string = "delivery.point:"         // STRING (prefix of)- Maps the delivery point name to a json blob of information about a delivery point.
    PUSH_SERVICE_PROVIDER_PREFIX                           string = "push.service.provider:"  // STRING (prefix of) - Maps a push service provider name to a json blob of information about it.
    SERVICE_SUBSCRIBER_TO_DELIVERY_POINTS_PREFIX           string = "srv.sub-2-dp:"           // SET (prefix of) - Maps a service name + subscriber to a set of delivery point names
    SERVICE_DELIVERY_POINT_TO_PUSH_SERVICE_PROVIDER_PREFIX string = "srv.dp-2-psp:"           // STRING (prefix of) - Maps a service name + delivery point name to the push service provider
    SERVICE_TO_PUSH_SERVICE_PROVIDERS_PREFIX               string = "srv-2-psp:"              // SET (prefix of) - Maps a service name to a set of PSP names
    DELIVERY_POINT_COUNTER_PREFIX                          string = "delivery.point.counter:" // STRING (prefix of) - Maps a delivery point name to the number of subcribers(summed across each service).
    SERVICES_SET                                           string = "services{0}"             // SET - This is a set of service names.
)```
mishan commented 5 years ago

You can do like KEYS push.service.provider:* for example