Cordova/PhoneGap plugin to allow integration of Pollfish surveys into Android and iOS apps.
Pollfish is a mobile monetization platform delivering surveys instead of ads through mobile apps. Developers get paid per completed surveys through their apps.
- Android 21+ using Google Play Services
- iOS version 9.0+
- Apache Cordova v3.0.4+
Note: Apps designed for Children and Families program should not be using Pollfish SDK, since Pollfish does not collect responses from users less than 16 years old
Note: Pollfish iOS SDK utilizes Apple's Advertising ID (IDFA) to identify and retarget users with Pollfish surveys. As of iOS 14 you should initialize Pollfish Cordova/Ionic plugin in iOS only if the relevant IDFA permission was granted by the user
- Create Pollfish developer account, create new app and grap it's API key
- Install Pollfish plugin and call init function
- Set to Release mode and release in Store
- Update your app's privacy policy
- Request your account to get verified from Pollfish Dashboard
Register as a Developer at www.pollfish.com
Login at www.pollfish.com and add a new app at Pollfish panel in section My Apps and copy the given API key for this app to use later in your init function in your app.
To add Pollfish plugin just type:
cordova plugin add https://github.com/pollfish/cordova-plugin-pollfish.git
To remove Pollfish plugin type:
cordova plugin remove com.pollfish.cordova
In iOS if pollfish framework is not added automatically you may need to add it manually to your XCode project. In Xcode, select the target that you want to use and in the Build Phases tab expand the Link Binary With Libraries section. Press the + button, and press Add other… In the dialog box that appears, go to the Pollfish framework’s location (located in /src/ios/framework) and select it. The project will appear at the top of the Link Binary With Libraries section and will also be added to your project files (left-hand pane). The framework is a folder and you should add the whole folder into your project.
Init function takes the following parameters:
- releaseMode: - Choose Debug or Release Mode
- rewardMode: - Init in reward mode (skip Pollfish indicator to show a custom prompt)
- api_key: - Your API Key (from step 2)
- pos: - The Position where you wish to place the Pollfish indicator. There are four different options {Position.TOP_LEFT, Position.BOTTOM_LEFT, Position.MIDDLE_LEFT, Position.TOP_RIGHT, Position.BOTTOM_RIGHT, Position.MIDDLE_RIGHT}
- padding: - The padding (in dp) from top or bottom according to Position of the indicator specified before (0 is the default value – |*if used in MIDDLE position, padding is calculating from top).
- request_uuid: - Sets a unique id to identify a user and be passed through server-to-server callbacks
- offerwallMode: - Sets Pollfish to offerwall mode.
For example:
var releaseMode = false;
var rewardMode = false;
var api_key = "YOUR_API_KEY";
var pos = pollfishplugin.Position.TOP_LEFT;
var padding = 50;
var request_uuid = "my_id";
var offerwallMode = true;
pollfishplugin.init(releaseMode,rewardMode,api_key,pos,padding,request_uuid, offerwallMode);
You can use Pollfish either in Debug or in Release mode.
- Debug mode is used to show to the developer how Pollfish will be shown through an app (useful during development and testing).
- Release mode is the mode to be used for a released app (start receiving paid surveys).
Note: In Android debugMode parameter is ignored. Your app turns into debug mode once it is signed with a debug key. If you sign your app with a release key it automatically turns into Release mode.
Note: Be careful to turn the releaseMode parameter to true when you release your app in a relevant app store!!
Reward mode false during initialization enables controlling the behavior of Pollfish in an app from Pollfish panel. Enabling reward mode ignores Pollfish behavior from Pollfish panel. It always skips showing Pollfish indicator (small button) and always force open Pollfish view to app users. This method is usually used when app developers want to incentivize first somehow their users before completing surveys to increase completion rates.
You can send attributes that you receive from your app regarding a user, in order to receive a better fill rate and higher priced surveys.
You can see a detailed list of the user attributes you can pass with their keys at the following link
For example:
var userAttributes = {};
userAttributes['gender'] = '1';
userAttributes['year_of_birth'] = '1974';
pollfishplugin.initWithUserAttributes(releaseMode,rewardMode,api_key,pos,padding,request_uuid,offerwallMode,userAttributes);
“Survey Serving Technology
This app uses Pollfish SDK. Pollfish is an on-line survey platform, through which, anyone may conduct surveys. Pollfish collaborates with Publishers of applications for smartphones in order to have access to users of such applications and address survey questionnaires to them. When a user connects to this app, a specific set of user's device data (including Advertising ID, Device ID, other available electronic identifiers and further response meta-data is automatically sent, via our app, to Pollfish servers, in order for Pollfish to discern whether the user is eligible for a survey. For a full list of data received by Pollfish through this app, please read carefully the Pollfish respondent terms located at https://www.pollfish.com/terms/respondent. These data will be associated with your answers to the questionnaires whenever Pollfish sends such questionnaires to eligible users. Pollfish may share such data with third parties, clients and business partners, for commercial purposes. By downloading the application, you accept this privacy policy document and you hereby give your consent for the processing by Pollfish of the aforementioned data. Furthermore, you are informed that you may disable Pollfish operation at any time by visiting the following link https://www.pollfish.com/respondent/opt-out. We once more invite you to check the Pollfish respondent's terms of use, if you wish to have more detailed view of the way Pollfish works and with whom Pollfish may further share your data."
If you have any question, like why you do not see surveys on your own device in release mode, please have a look in our FAQ page
| Note: Please bear in mind that the first time a user is introduced to the platform, when no paid surveys are available, a standalone demographic survey will be shown, as a way to increase the user's exposure in our clients' survey inventory. This survey returns no payment to app publishers, since it is part of the process users need to go through in order to join the platform. Bear in mind that if a paid survey is available at that point of time, the demographic questions will be inserted at the begining of the survey, before the actual survey questions. Our aim is to provide advanced targeting solutions to our customers and to do that we need to have this information on the available users. Targeting by marital status or education etc. are highly popular options in the survey world and we need to keep up with the market. A vast majority of our clients are looking for this option when using the platform. Based on previous data, over 80% of the surveys designed on the platform require this new type of targeting.
In our efforts to include publishers in this process and be as transparent as possible we provide full control over the process. We let publishers decide if their users are served these standalone surveys or not, in 2 different ways. Firstly by monitoring the process in code and excluding any users by listening to the relevant noitifications (Pollfish Survey Received, Pollfish Survey Completed) and checking the Pay Per Survey (PPS) field which will be 0 USD cents. Secondly, publishers can disable the standalone demographic surveys through the Pollfish Developer Dashboard in the Settings area of an app. You can read more on demographic surveys here.
After your app is published on an app store you should request your account to get verified from your Pollfish Developer Dashboard.
When your account is verified you will be able to start receiving paid surveys from Pollfish clients.
In this section we will list several options that can be used to control Pollfish surveys behaviour, how to listen to several notifications or how be eligible to more targeted (high-paid) surveys. All these steps are optional.
If your app supports both orientations you should listen for the orientation event and initialise Pollfish again.
For example:
document.addEventListener("orientationchange", app.updateOrientation,false);
updateOrientation: function () {
pollfishplugin.init(releaseMode,rewardMode,api_key,pos,padding,request_uuid, offerwallMode);
}
You should handle the event when your app is entering to foreground in order to initialise Pollfish again by listening to the relevant event.
For example:
document.addEventListener("resume", app.onResume, false);
onResume: function () {
pollfishplugin.init(releaseMode,rewardMode,api_key,pos,padding,request_uuid, offerwallMode);
}
You can be notified when a Pollfish survey is received.
For example:
pollfishplugin.setEventCallback('onPollfishSurveyReceived',app.surveyReceivedEvent);
surveyReceivedEvent: function(id) {
try{
console.log("Pollfish Survey Received - CPA: " + id.survey_cpa + " IR: " + id.survey_ir + " LOI: " + id.survey_loi + " Survey Class: " + id.survey_class+ " Reward Name: " + id.reward_name + " Reward Value: " + id.reward_value);
}catch(e){}
}
You can be notified when a Pollfish survey is completed.
For example:
pollfishplugin.setEventCallback('onPollfishSurveyCompleted',app.surveyCompletedEvent);
surveyCompletedEvent: function(id) {
try{
console.log("Pollfish Survey Completed - CPA: " + id.survey_cpa + " IR: " + id.survey_ir + " LOI: " + id.survey_loi + " Survey Class: " + id.survey_class + " Reward Name: " + id.reward_name + " Reward Value: " + id.reward_value);
}catch(e){}
}
You can be notified when a user is not eligible for a Pollfish survey.
For example:
pollfishplugin.setEventCallback('onPollfishUserNotEligible',app.userNotEligibleEvent);
userNotEligibleEvent: function(id) {
console.log("Pollfish User Not Eligible");
}
You can be notified when a Pollfish survey is not available
For example:
pollfishplugin.setEventCallback('onPollfishSurveyNotAvailable',app.surveyNotAvailableEvent);
surveyNotAvailableEvent: function(id) {
console.log("Pollfish Survey not available");
}
You can be notified when Pollfish survey panel is open
For example:
pollfishplugin.setEventCallback('onPollfishOpened',app.pollfishPanelOpenEvent);
pollfishPanelOpenEvent: function(id) {
console.log("Pollfish Survey panel is open");
}
You can be notified when Pollfish survey panel is closed
For example:
pollfishplugin.setEventCallback('onPollfishOpened',app.pollfishPanelClosedEvent);
pollfishPanelClosedEvent: function(id) {
console.log("Pollfish Survey panel is closed");
}
You can manually hide and show Pollfish from your various UIVIewControllers. by calling anywhere after initialization:
For example:
pollfishplugin.showPollfish();
or
pollfishplugin.hidePollfish();
If you want to have a look at sample code on how you can call and use Pollfish plugin in your app, you can a review files located at test/index.js and test/index.html
For more information on setting up Cordova see the documentation