lukaspili / Reactive-Billing

Lightweight reactive wrapper around In App Billing API v3 for Android
https://play.google.com/store/apps/details?id=com.github.lukaspili.reactivebilling.sample
MIT License
246 stars 33 forks source link

Some updates to make things a bit easier to integrate. #14

Closed rharter closed 7 years ago

rharter commented 7 years ago

I'm sorry that this includes more than one update, but I wanted to send my changes upstream, and needed to release :)

Updates logger to be customizable

It's general practice to make logging customizable, instead of building in debug logging to a library. This previously used the ReactiveBillingLogger class, which prevents users from using their own logging mechanisms. In my case, I use Timber to capture logs, including sending error logs to my error reporting tool, and that was not doable with the ReactiveBillingLogger, which made the assumption that I'm only interested in logging to android.util.Log.

This update provides a simple Logger interface that users can implement to provide whatever logging they wish, and defaults to no logging.

Updates gradle-mvn-push script to be included locally

This ensures compatibility in case the remote script is updated, and ensures that you can always build, even when Github is down.

Adds nullability annotations

This is helpful for integrating with Kotlin. There is also an update to remove the varargs methods and replace them with collections, to match modern coding standards (and make them work in many coding styles).

Fixes NPE in billing service

There was an NPE in the BillingService class which I've fixed.

lukaspili commented 7 years ago

@rharter Many thanks for the contribution!