javiersantos/PiracyChecker

allow() function never get called if I use enableGooglePlayLicensing with the correct key.

yarik1988 opened this issue · 3 comments

  • I have verified there are no duplicate active or recent bugs, questions, or requests.
  • I have verified that I am using the latest version of PiracyChecker.
  • I have given my issue a non-generic title.
  • I have read over the documentation (before asking questions on how to do something).
Details
  • PiracyChecker version: 1.2.8
  • Device OS version: API 24
  • Device Manufacturer: Google
  • Device Name: Pixel 3 (emulator)
Builder
        new PiracyChecker(this)
                .enableGooglePlayLicensing("MY KEY")
                .callback(new PiracyCheckerCallback() {
                    @Override
                    public void allow() {
                        Log.e("Pirate Checker","Access granted");
                    }

                    @Override
                    public void doNotAllow(@NonNull PiracyCheckerError error, @Nullable PirateApp app) {
                        Log.e("Pirate Checker","Access declined");
                    }

                    @Override
                    public void onError(@NonNull PiracyCheckerError error) {
                        // This method is not required to be implemented/overridden but...
                        // You can either do something specific when an error occurs while checking the license,
                        // Or manage the error, using the 'error' parameter, yourself (Check errors at {@link PiracyCheckerError}).
                    }
                })
                .display(Display.ACTIVITY).start();

logs

I/LibraryChecker: Binding to licensing service.
I/LibraryChecker: Calling checkLicense on service for com.magicart.waterpaint.premium
I/LibraryChecker: Start monitoring timeout.
I/LibraryChecker: Received response.
I/LibraryChecker: Clearing timeout.
Reproduction Steps
  1. Paste above code into onCreate method of activity
Expected Result
  1. allow() function get called
Actual Result

allow() function never get called.

I suppose that PiracyChecker creates some thread that never ends.

are you installing the app from play store while testing?

It seems I figured out why it's happening. I have two apps in google play, the first is published (everything works nice with this app), second still in review for internal testing, that's the reason I think.

Everything is ok now, Piracy Checker works perfectly