centrifugal / centrifuge-mobile

iOS and Android clients for Centrifugo and Centrifuge library using gomobile on top of centrifuge-go
MIT License
57 stars 14 forks source link

Subscription always null in PublishHandler #16

Closed danilashamin closed 5 years ago

danilashamin commented 6 years ago

Hello. The problem is that when a new message arrives in the onPublish method, the Subscription variable is always null. What could be the problem?

subEvents.onPublish((p0, p1) -> /some action/);

FZambia commented 6 years ago

Hello @danilashamin

Thanks for report, looks like I missed this while making proxy to centrifuge-go types during migration to Centrifugo v2. The solution is not simple in this case unfortunately. Looks like we need to change library API a bit to fix this, changes won't be dramatic but current API will be broken. I already have working prototype at my laptop - will try to figure out how it behaves.

FZambia commented 6 years ago

@danilashamin I've made several changes in libraries - please look, what do you think. If no objections appear I'll merge everything tomorrow and create new 0.2.0 tags here and in centrifuge-go.

For me new API without using EventHub and SubscriptionEventHub seems is a bit more natural than now.

danilashamin commented 6 years ago

Alexander, thanks for such a quick response! Tell me, why did you remove the setToken method? And what alternative to this method?

FZambia commented 6 years ago

Hmm, I have not removed it - could you show where you noticed this?

FZambia commented 6 years ago

All merged - please check it out

danilashamin commented 6 years ago

Hmm, I have not removed it - could you show where you noticed this?

Sorry, I misunderstood the code. Just saw you comment it out.

FZambia commented 6 years ago

@danilashamin did you have a chance to check how it works for you? Can we close this issue?