Karamunting.Android.Swisyn.AdBlockerDetector 1.0.0

Detect most of ad blockers on Android

Install-Package Karamunting.Android.Swisyn.AdBlockerDetector -Version 1.0.0
dotnet add package Karamunting.Android.Swisyn.AdBlockerDetector --version 1.0.0
<PackageReference Include="Karamunting.Android.Swisyn.AdBlockerDetector" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Karamunting.Android.Swisyn.AdBlockerDetector --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Simple Usage

[Activity(Label = "AdBlocker Detector", MainLauncher = true)]
public class MainActivity : AppCompatActivity
{
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        SetContentView(R.Layout.activity_main);

        Task.Delay(3000).Wait();
        CheckAdBlocker();
    }

    private void CheckAdBlocker()
    {
      new AdBlockerDetector(this).DetectAdBlockers(
          new Constants.AdBlockerCallback(
              (adBlockerFound, info) =>
              {
                  // Show your information dialog here to user
                  var msg = adBlockerFound ? "AdBlocker Found!" : "It's safe";
                  Toast.MakeText(this, msg, ToastLength.Short).Show();
              }
          )
      );
    }
}

A bit shorter, you can also use it like this:

new AdBlockerDetector(this).DetectAdBlockers(
    (adBlockerFound, info) =>
    {
        // Show your information dialog here to user
        var msg = adBlockerFound ? "Action: AdBlocker Found!" : "It's safe";
        Toast.MakeText(this, msg, ToastLength.Short).Show();
    }
);

Licence

The MIT License (MIT)

Copyright (c) 2016 Cüneyt Ayyıldız

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Simple Usage

[Activity(Label = "AdBlocker Detector", MainLauncher = true)]
public class MainActivity : AppCompatActivity
{
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        SetContentView(R.Layout.activity_main);

        Task.Delay(3000).Wait();
        CheckAdBlocker();
    }

    private void CheckAdBlocker()
    {
      new AdBlockerDetector(this).DetectAdBlockers(
          new Constants.AdBlockerCallback(
              (adBlockerFound, info) =>
              {
                  // Show your information dialog here to user
                  var msg = adBlockerFound ? "AdBlocker Found!" : "It's safe";
                  Toast.MakeText(this, msg, ToastLength.Short).Show();
              }
          )
      );
    }
}

A bit shorter, you can also use it like this:

new AdBlockerDetector(this).DetectAdBlockers(
    (adBlockerFound, info) =>
    {
        // Show your information dialog here to user
        var msg = adBlockerFound ? "Action: AdBlocker Found!" : "It's safe";
        Toast.MakeText(this, msg, ToastLength.Short).Show();
    }
);

Licence

The MIT License (MIT)

Copyright (c) 2016 Cüneyt Ayyıldız

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

  • MonoAndroid 4.4

    • No dependencies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 425 4/16/2018