ably-java
ably-java copied to clipboard
Proposal: Remove setAndroidContext, take it at push.activate() instead
In order for push activation to work, you need to do this:
rest.setAndroidContext(context)
rest.push.activate(useCustomRegistrar)
(Which, by the way, is really poorly documented currently.)
If you do push.activate without doing setAndroidContext first, it crashes.
So, why not just:
rest.push.activate(useCustomRegistrar, androidContext)
We use the context exclusively for push, now and for the foreseeable future, so I think it makes sense we take it there.
@paddybyers WDYT?
We use the context exclusively for push, now and for the foreseeable future, so I think it makes sense we take it there.
Not quite, because it's also used to subscribe for platform network changes (cf RTN20 from memory)