Code Monkey home page Code Monkey logo

android-sdk-pollfish's Introduction

Prodege Android SDK

Prodege ad serving platform.

Prerequisites

  • Android 21 or higher
  • Java version 1.8
  • Kotlin 1.9.0

Quick Quide

  1. Obtain a Publisher Account
  2. Create a new App and copy the given API key
  3. Create a new placement and copy the given placement id
  4. Add Prodege SDK in your project
  5. Initialize Prodge SDK
  6. Load a Placement
  7. Show the placement
  8. Update you privacy policy and publish your app
  9. Request your account to get verified

Documentation

You can see a step by step guide on how to integrate at the official Documentation page

android-sdk-pollfish's People

Contributors

fotism23 avatar fotismit avatar kaspanvo avatar rahulsdeshpande avatar thanosfisherman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

android-sdk-pollfish's Issues

Please always update the build.gradle file with the latest Pollfish dependency version

Current sample project is having the Pollfish dependency verion as 4.3.1 as below:

compile 'com.pollfish:pollfish:4.3.1:googleplayRelease@aar'

Due to this, many UserProperties class' subclasses are missing.

Please update this to whatever the latest lib version is, as it might create a confusion among the Pollfish devs about the latest stable Pollfish lib.

:)

Cheers Pollfish !!

NullPointerException

NullPointerException: Attempt to invoke virtual method 'com.pollfish.classes.b com.pollfish.b.a.getPanelObj()' on a null object reference
at com.pollfish.main.PollFish.isPollfishPresent

kotlin version of sample app when launch and after few seconds app get crashed

Device Info : Huawei 8x, android 10
Logs along with crash message at the end :

FATAL EXCEPTION: main Process: com.prodege.sample, PID: 8240 java.lang.NullPointerException: throw with null exception at com.prodege.internal.j4.a(SourceFile:6) at com.prodege.internal.e3.a(SourceFile:2) at com.prodege.internal.e3$b.invoke(SourceFile:15) at com.prodege.internal.d1.a(SourceFile:32) at com.prodege.internal.d1$$ExternalSyntheticLambda2.run(Unknown Source:4) at android.os.Handler.handleCallback(Handler.java:888) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8178) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)

channel '161b7e9 com.prodege.sample/com.prodege.sample.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! notifyActivityState pkg:com.prodege.sample/com.prodege.sample.MainActivity state:20 fg:false mUid:11110

Pollfish causes issue with code-shrinker r8 in android

I am using pollfish SDK to show survey in the app. When I enable code-shrinker r8, then the pollfish does not open the survey and there is no any event callbacks happening. If I remove the code-shrinker then pollfish works fine.

I tried to ignore the pollfish classes in proguard but still no luck with that.

-keep class com.pollfish.**

Please let me know how to solve this problem.

Incompatible with AWSMobileClient

I use AWSMobileClient and when I make a release build I get this error message.

Process: xxxxxxxxxxxx PID: 14924
java.lang.RuntimeException: Unable to create application xxxxxxxxxxxx.XXXApplication: java.lang.RuntimeException: Failed to read awsconfiguration.json please check that it is correctly formed.
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
    at android.app.ActivityThread.access$1300(ActivityThread.java:237)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
 Caused by: java.lang.RuntimeException: Failed to read awsconfiguration.json please check that it is correctly formed.
    at com.amazonaws.mobile.config.AWSConfiguration.<init>(AWSConfiguration.java:13)
    at xxxxxxxxxxxx.onCreate(xxxxxxxxxxxx.kt:31)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
    at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
    at android.os.Handler.dispatchMessage(Handler.java:106) 
    at android.os.Looper.loop(Looper.java:223) 
    at android.app.ActivityThread.main(ActivityThread.java:7656) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
 Caused by: org.json.JSONException: End of input at character 0 of
    at org.json.JSONTokener.syntaxError(JSONTokener.java:460)
    at org.json.JSONTokener.nextValue(JSONTokener.java:101)
    at org.json.JSONObject.<init>(JSONObject.java:165)
    at org.json.JSONObject.<init>(JSONObject.java:182)
    at com.amazonaws.mobile.config.AWSConfiguration.<init>(AWSConfiguration.java:12)
    xxxxxxxxxxxx.onCreate(xxxxxxxxxxxx.kt:31) 
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192) 
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712) 
    at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
    at android.os.Handler.dispatchMessage(Handler.java:106) 
    at android.os.Looper.loop(Looper.java:223) 
    at android.app.ActivityThread.main(ActivityThread.java:7656) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 

2021-12-09 15:27:06.759 14924-14960/? V/FA: Connecting to remote service

Maybe there is a conflict between dependencies but I don't know why it works on debug builds. I also added the proguard rules as specified.

FYI: Disabling proguard fixes this issue.

Set the rewardInfo

Hi, I have a little problem. I just testing your SDK. I init Pollfish with params:

val params = Params.Builder(apiKey)
.releaseMode(false)
.rewardMode(true)
.rewardInfo(RewardInfo("my_reward", 1.0)) // reward name
.build()

But when I receive the survey in "onPollfishSurveyCompleted" callback the reward name is still "Points". Maybe it is why I test the app in the developer mode?

Section from documentation 5.3.1.9 "An object passing information during initialization regarding the reward settings, overriding the values as speciefied on the Publisher's Dashboard"

Parameter "rewardName" Overrides the reward name as specified in the Publisher's Dashboard.

But in my tests, it doesn't override the reward name.
screen

Error when upgrading to 6.2.3

Hi!

Currently our app is running with Pollfish v6.1.5, now trying to upgrade to v6.2.3, we're getting:

The binary version of its metadata is 1.6.0, expected version is 1.4.2.
The class is loaded from /root/.gradle/caches/transforms-3/e1f4ffecf7f54c1cb2513e58154184a3/transformed/jetified-kotlin-stdlib-1.6.10.jar!/kotlin/Unit.class
> Task :app:compileDebugKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.

If I downgrade to v.6.1.5, the app build with no issues. Do you know what could be the cause?

Crashlytics error

I recently incorporated pollfish into my app, and had couple of errors

Fatal Exception: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@e370b56 rejected from java.util.concurrent.ThreadPoolExecutor@d6837d7[Shutting down, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]
       at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2086)
       at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)
       at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394)
       at java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:242)
       at com.pollfish.internal.z1.a(z1.java:13)
       at com.pollfish.internal.a1.a(a1.java:1)
       at com.pollfish.internal.x1.run(x1.java:4)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:919)

What may be the reason of it?

Not getting any call back sometime in my samsung device

Hello,

Some time I am not getting any call back from survey

initializing by this

PollFish.ParamsBuilder paramsBuilder = new PollFish.ParamsBuilder("a803d8fe-accf-4f80-bd24-e4ebee6e7d3d")
.indicatorPadding(5)
.customMode(true)
.releaseMode(false)
.build();
PollFish.initWith(mActivity, paramsBuilder);

my call back listener are

@OverRide
public void onPollfishClosed() {
CommonUtils.showLog("Pollfish", "onPollfishSurveyClose()");
if (withdrawAmountBinder!=null)
withdrawAmountBinder.onPollfishClosed();
}

@Override
public void onPollfishSurveyCompleted(boolean b, int i) {
    CommonUtils.showLog("Pollfish", "onPollfishSurveyCompleted()");
    if (withdrawAmountBinder!=null)
        withdrawAmountBinder.onPollfishSurveyCompleted(b,  i);
}

@Override
public void onPollfishSurveyNotAvailable() {
    CommonUtils.showLog("Pollfish", "onPollfishSurveyNotAvailable()");
    if (withdrawAmountBinder!=null)
        withdrawAmountBinder.onPollfishSurveyNotAvailable();
}

@Override
public void onPollfishSurveyReceived(boolean b, int i) {
    CommonUtils.showLog("Pollfish", "onPollfishSurveyReceived()");
    if (withdrawAmountBinder!=null)
        withdrawAmountBinder.onPollfishSurveyReceived(b,i);
}

@Override
public void onUserNotEligible() {
    CommonUtils.showLog("Pollfish", "onUserNotEligible()");
    if (withdrawAmountBinder!=null)
        withdrawAmountBinder.onUserNotEligible();
}

but some time i am not getting any call back from survey

onPollfishSurveyNotAvailable

Hello,

I have integrated in my project and I have got survey once per device after once I am getting callback all ways in this method onPollfishSurveyNotAvailable.

can you guide me how can i fix this issue.

Thanks,
Amit Pal

PollFish.show() not start a survey from different context.

I have to show PollFish ads from 7-8 different place, so I have created a common class to load the PollFish survey but issue is ,Suppose I have requested PollFish SDK to load Ads(loadPollFish()) from ActivityHome and try to display(show()) from ActivityNew it will not open the survey.

I have tested if I will update the activity context it's working, How to resolve this issue.
Want to load Survey Globally, and use it in any activity.

public class RewardPollFishHelper implements PollfishSurveyCompletedListener, PollfishClosedListener, PollfishOpenedListener, PollfishSurveyReceivedListener, PollfishUserNotEligibleListener {

    private static RewardPollFishHelper rewardPollFishHelper;
    private RewardBaseHelper.RewardAccessStatus rewardAccessStatus;
    private Activity activity;

    private RewardPollFishHelper(Activity activity) {
        this.activity = activity;
        loadPollFish(activity);
    }

    public static RewardPollFishHelper getInstance(Activity activity) {
        if (rewardPollFishHelper == null)
		{ 
			rewardPollFishHelper = new RewardPollFishHelper(activity);
			rewardPollFishHelper.loadPollFish(activity);
        }   
		else if(!isPollFishLoaded())
		{
			rewardPollFishHelper.loadPollFish(activity);
		}
			
        rewardPollFishHelper.activity = activity;
        return rewardPollFishHelper;
    }

    public static boolean isPollFishLoaded() {
        return PollFish.isPollfishPresent() && PollFish.isPollfishPresent();
    }

    private void loadPollFish(Activity activity) {
        PollFish.ParamsBuilder paramsBuilder = new PollFish.ParamsBuilder(activity.getString(R.string.poll_fish_key))
                .pollfishSurveyCompletedListener(this)
                .pollfishClosedListener(this)
                .pollfishOpenedListener(this)
                .pollfishSurveyReceivedListener(this)
                .pollfishUserNotEligibleListener(this)
                .releaseMode(false)
                .customMode(true)
                .build();

        // set release mode
        PollFish.initWith(activity, paramsBuilder);
        PollFish.hide();
    }


    public boolean show(RewardBaseHelper.RewardAccessStatus rewardAccessStatus) {


        this.rewardAccessStatus = rewardAccessStatus;

        LogUtils.debug("PollFishShow Favorite show " + activity);
        if (isPollFishLoaded()) {
            PollFish.show();
            return true;
        }
        return false;
    }


    @Override
    public void onPollfishSurveyCompleted(boolean b, int i) {
        LogUtils.debug("PollFish Favorite onPollfishSurveyCompleted " + rewardAccessStatus);
        if (rewardAccessStatus != null) {
            rewardAccessStatus.rewarded(RewardBaseHelper.ACCESS_FOR_NUMBER_OF_HOUR_24);
        }

    }

    @Override
    public void onPollfishClosed() {
        LogUtils.debug("PollFish Favorite onPollfishClosed " + rewardAccessStatus);
        if (rewardAccessStatus != null) {
            rewardAccessStatus.closed();
        }

    }

    @Override
    public void onPollfishOpened() {
        LogUtils.debug("PollFish Favorite onPollfishOpened " + rewardAccessStatus);

    }

    @Override
    public void onPollfishSurveyReceived(boolean b, int i) {
        LogUtils.debug("PollFish Favorite onPollFishSurveyReceived" + b + " == " + i);
     
    }

    @Override
    public void onUserNotEligible() {
        LogUtils.debug("PollFish Favorite onUserNotEligible");
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.