pollfish / flutter-plugin-pollfish Goto Github PK
View Code? Open in Web Editor NEWPollfish Flutter plugin, allows integration of Pollfish surveys into Flutter Android and iOS apps.
License: Other
Pollfish Flutter plugin, allows integration of Pollfish surveys into Flutter Android and iOS apps.
License: Other
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
duplicate symbol __channel in:
/app_location/build/ios/Debug-iphonesimulator/firebase_admob/libfirebase_admob.a(FLTMobileAd.o)
/app_location/build/ios/Debug-iphonesimulator/flutter_pollfish/libflutter_pollfish.a(FlutterPollfishPlugin.o)
ld: 1 duplicate symbol for architecture x86_64
The iOS plugin hard crashes the app when attempting to init the pollfish sdk. Works on Android
My init code
Future<void> initPollfish() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String id = prefs.getString("id");
FlutterPollfish.instance.init(
apiKey: 'KEY',
requestUUID: id,
rewardMode: true,
offerwallMode:false,
releaseMode: true);
FlutterPollfish.instance.setPollfishReceivedSurveyListener(onPollfishSurveyReveived);
FlutterPollfish.instance.setPollfishCompletedSurveyListener(onPollfishSurveyCompleted);
FlutterPollfish.instance.setPollfishSurveyOpenedListener(onPollfishSurveyOpened);
FlutterPollfish.instance.setPollfishSurveyClosedListener(onPollfishSurveyClosed);
FlutterPollfish.instance.setPollfishSurveyNotAvailableSurveyListener(onPollfishSurveyNotAvailable);
FlutterPollfish.instance.setPollfishUserRejectedSurveyListener(onPollfishUserRejectedSurvey);
FlutterPollfish.instance.setPollfishUserNotEligibleListener(onPollfishUserNotEligible);
}
The crash
flutter: invokeMethod FlutterPollfish.init()...
2019-08-20 09:59:55.288736-0500 Runner[20954:901316] -[NSNull integerValue]: unrecognized selector sent to instance 0x11302ef28
2019-08-20 09:59:55.329920-0500 Runner[20954:901316] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull integerValue]: unrecognized selector sent to instance 0x11302ef28'
*** First throw call stack:
(
0 CoreFoundation 0x0000000112dbc1bb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000011235a735 objc_exception_throw + 48
2 CoreFoundation 0x0000000112ddaf44 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000112dc0ed6 ___forwarding___ + 1446
4 CoreFoundation 0x0000000112dc2da8 _CF_forwarding_prep_0 + 120
5 Runner 0x000000010a3953bf -[FlutterPollfishPlugin callInitialize:result:] + 943
6 Runner 0x000000010a394e8f -[FlutterPollfishPlugin handleMethodCall:result:] + 191
7 Flutter 0x000000010d40769e __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 115
8 Flutter 0x000000010d3a7016 _ZNK7flutter21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 166
9 Flutter 0x000000010d3aa52c _ZN7flutter15PlatformViewIOS21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 38
10 Flutter 0x000000010d401f07 _ZNSt3__110__function6__funcIZN7flutter5Shell29OnEngineHandlePlatformMessageEN3fml6RefPtrINS2_15PlatformMessageEEEE4$_27NS_9allocatorIS8_EEFvvEEclEv + 57
11 Flutter 0x000000010d3b72cb _ZN3fml15MessageLoopImpl10FlushTasksENS_9FlushTypeE + 123
12 Flutter 0x000000010d3bbb16 _ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0_ + 26
13 CoreFoundation 0x0000000112d21f34 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
14 CoreFoundation 0x0000000112d21b32 __CFRunLoopDoTimer + 1026
15 CoreFoundation 0x0000000112d2139a __CFRunLoopDoTimers + 266
16 CoreFoundation 0x0000000112d1ba1c __CFRunLoopRun + 2252
17 CoreFoundation 0x0000000112d1ae11 CFRunLoopRunSpecific + 625
18 GraphicsServices 0x000000011524f1dd GSEventRunModal + 62
19 UIKitCore 0x000000011ae7781d UIApplicationMain + 140
20 Runner 0x000000010a0398f0 main + 112
21 libdyld.dylib 0x000000011374a575 start + 1
22 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
How to change language of the survey ? thank you
Hi guys,
Could you advise how soon the plugin will move to Flutter 2 (and null safety)?
Unfortunately it's blocking migration of our app to Flutter 2.
Thanks, Tom
We noticed that you can the back button press during a survey and it instantly goes back without asking or somethig like that. That even happends when it was accedently, which is kind of bad for the user experience. It would be nice to have an option to disable that or it's disabled from the beginning.
Hello, I push pollfish on my android APP, with no problem. I try to migrate this in my iOS app but I have this error.
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Finding Podfile changes
A Pollfish
A flutter_pollfish
- Flutter
- app_review
- audioplayers
- firebase_admob
- firebase_core
- firebase_core_web
- flutter_barcode_scanner
- flutter_email_sender
- flutter_rounded_progress_bar
- flutter_youtube_view
- in_app_purchase
- package_info
- path_provider
- screenshot_share_image
- sensors
- shared_preferences
- unique_identifier
- url_launcher
- vibration
- webview_media
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `app_review` from `.symlinks/plugins/app_review/ios`
-> Fetching podspec for `audioplayers` from `.symlinks/plugins/audioplayers/ios`
-> Fetching podspec for `firebase_admob` from `.symlinks/plugins/firebase_admob/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `firebase_core_web` from `.symlinks/plugins/firebase_core_web/ios`
-> Fetching podspec for `flutter_barcode_scanner` from `.symlinks/plugins/flutter_barcode_scanner/ios`
-> Fetching podspec for `flutter_email_sender` from `.symlinks/plugins/flutter_email_sender/ios`
-> Fetching podspec for `flutter_pollfish` from `.symlinks/plugins/flutter_pollfish/ios`
-> Fetching podspec for `flutter_rounded_progress_bar` from `.symlinks/plugins/flutter_rounded_progress_bar/ios`
-> Fetching podspec for `flutter_youtube_view` from `.symlinks/plugins/flutter_youtube_view/ios`
-> Fetching podspec for `in_app_purchase` from `.symlinks/plugins/in_app_purchase/ios`
-> Fetching podspec for `package_info` from `.symlinks/plugins/package_info/ios`
-> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
-> Fetching podspec for `screenshot_share_image` from `.symlinks/plugins/screenshot_share_image/ios`
-> Fetching podspec for `sensors` from `.symlinks/plugins/sensors/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `unique_identifier` from `.symlinks/plugins/unique_identifier/ios`
-> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
-> Fetching podspec for `vibration` from `.symlinks/plugins/vibration/ios`
-> Fetching podspec for `webview_media` from `.symlinks/plugins/webview_media/ios`
Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "Pollfish":
In Podfile:
Pollfish
flutter_pollfish (from `.symlinks/plugins/flutter_pollfish/ios`) was resolved to 1.0.1, which depends on
Pollfish (~> 5.2.5)
Specs satisfying the `Pollfish, Pollfish (~> 5.2.5)` dependency were found, but they required a higher minimum deployment target.
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:257:in `process_topmost_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/resolver.rb:88:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer/analyzer.rb:939:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer/analyzer.rb:937:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer/analyzer.rb:118:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:398:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:221:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:220:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command/install.rb:51:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
There is no additional modification between android and iOS in the description of the package. Why this error ? thank you
When you do plan to implement "Passing a custom user id upon survey completion "as it renders this rather useless without that.
When using .show() it only shows one survey at a time, and have to restart the app to show another.
Im not sure if its an intended feature or an issue with SDK, please let me know if any code is required to show the issue.
Hello. I am trying to verify if a survey is going to get paid for by pollfish because I need to confirm this before rewarding users. But while talking with pollfish customer support they said the only 100% way to verify whether a survey is going to be paid for is by using a server to server callback. And I use firebase and I dont know how to do this. Is it possible if the plugin could help us with this. If we pass in the reqeust uuid somewhere?.. Please help... Thanks.. Love your plugin
FlutterPollfish.instance.setPollfishSurveyClosedListener(onPollfishSurveyClosed);
void onPollfishSurveyClosed() {
FlutterPollfish.instance.hide();
ExtendedNavigator.rootNavigator.pushReplacementNamed(Routes.introPage);
}
This works well on Android but on iOS it does not respond to the listener, on the console it says
Unknown method pollfishSurveyClosedSurvey
I get the message bellow every now and then if the app goes in the background.
I/chromium(30840): [INFO:CONSOLE(1)] "Uncaught ReferenceError: Pollfish is not defined", source: (1)
This is on an Android Simulator, Pixel 4, with Android 30.
I'm not sure what it means, but I hope is nothing that breaks the package.
On some Android 12 and 13, Samsung devices using flutter_pollfish 4.2.0
in crash logs I can see the following:
Fatal Exception: android.util.AndroidRuntimeException: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:382)
at android.webkit.WebView.getFactory(WebView.java:2599)
at android.webkit.WebView.ensureProviderCreated(WebView.java:2593)
at android.webkit.WebView.setOverScrollMode(WebView.java:2661)
at android.view.View.<init>(View.java:5648)
at android.view.View.<init>(View.java:5823)
at android.view.ViewGroup.<init>(ViewGroup.java:707)
at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:59)
at android.webkit.WebView.<init>(WebView.java:426)
at android.webkit.WebView.<init>(WebView.java:368)
at android.webkit.WebView.<init>(WebView.java:350)
at android.webkit.WebView.<init>(WebView.java:337)
at android.webkit.WebView.<init>(WebView.java:327)
at com.pollfish.internal.c4.<init>(c4.java:1)
at com.pollfish.internal.t5.c(t5.java:1)
at com.pollfish.internal.u5.invoke(u5.java:1)
at com.pollfish.internal.c0.a(c0.java:1)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Using flutter_pollfish 4.1.3 several crash reports can be seen in crashlytics.
It occurs on Android 10 and Oppo devices.
Couldn't reproduce it locally, I hope the logs help.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.ComponentName.getClassName()' on a null object reference
at android.webkit.WebView.(WebView.java:449)
at android.webkit.WebView.(WebView.java:366)
at android.webkit.WebView.(WebView.java:349)
at android.webkit.WebView.(WebView.java:336)
at android.webkit.WebView.(WebView.java:326)
at com.pollfish.internal.c4.(c4.java)
at com.pollfish.internal.t5.c(t5.java:7)
at com.pollfish.internal.u5.invoke(u5.java:6)
at com.pollfish.internal.c0.a(c0.java)
at com.pollfish.internal.c0$$InternalSyntheticLambda$0$4403c88533a63ccabaefcb54da7cd2aa6fee30cd5d9f7add6af9587efba665b5$0.run(c0.java:2)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:240)
at android.app.ActivityThread.main(ActivityThread.java:7829)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)
In our app a user earns points for an account. A user may have several accounts. When a poll is completed points are assigned to the correct account.
Two questions
Btw, plugin was really easy to integrate, nice work!
Using flutter_pollfish 4.0.7 several crash reports can be seen in crashlytics.
It occurs on Android 8, 9, 10, 11.
Couldn't reproduce it locally yet, I hope the logs help.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void t8.p1.n()' on a null object reference
at com.pollfish.internal.PollfishOverlayActivity.onBackPressed(PollfishOverlayActivity.java:5)
at android.app.Activity.onKeyUp(Activity.java:3645)
at android.view.KeyEvent.dispatch(KeyEvent.java:2825)
at android.app.Activity.dispatchKeyEvent(Activity.java:3969)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:387)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5454)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5322)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4829)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4882)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4848)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4988)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4856)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5045)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4829)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4882)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4848)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4856)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4829)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4882)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4848)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5021)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5182)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3064)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2607)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2598)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3041)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:143)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:343)
at android.os.Looper.loop(Looper.java:188)
at android.app.ActivityThread.main(ActivityThread.java:7617)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
We found a bug within the new version (2.0^) that the flutter plugin resets when the phone is in standby mode during a survey. I think it would be nice if you can take a short break during the survey, because it worked in the old version. But now the survey is just gone after going back in. Also, the plugin crashes when you tab out of the app and tab back in while pollfish is active. (e.g. You are in the middle of a survey and you get a message on WhatsApp you have to answer, then you leave the app and come back and the survey is gone and the plugin has to be reinitialized to work again). The plugin crashes in every state of activity, so during initialization, when it is already initialized or if you have the offer wall open.
Also if you leave the app with the back button and you go in and want to reinitialize it, it doesn't work anymore and you have to destroy the app that it's possible to initialize the plugin again.
In the older SDK version (1.*) of pollfish both cases don't happen.
I made a list view, and each item was initialized and listened to the results, but only the last one was valid.
I/flutter (18616): ======2=========
I/flutter (18616): ======3=========
I/flutter (18616): ======1=========
I/System.out(18616): (HTTPLog)-Static: isSBSettingEnabled false
I/chatty (18616): uid=11693(com.bbdzy.ern) pool-183-thread identical 2 lines
I/System.out(18616): (HTTPLog)-Static: isSBSettingEnabled false
W/System (18616): A resource failed to call end.
I/chatty (18616): uid=11693(com.bbdzy.ern) FinalizerDaemon identical 2 lines
W/System (18616): A resource failed to call end.
I/flutter (18616): ========onPollfishSurveyReceived====1===
I/System.out(18616): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(18616): (HTTPLog)-Static: isSBSettingEnabled false
onPollfishSurveyReceived Only the last one is printed
After switching to release mode, onPollfishSurveyNotAvailable listener is not working. It was working in debug mode.
FlutterPollfish.instance.init(
apiKey: _api_key,
pollfishPosition: 5,
indPadding: 40,
rewardMode: true,
releaseMode: true,
requestUUID: _unique_id_public,
offerwallMode:true);
FlutterPollfish.instance.setPollfishSurveyNotAvailableSurveyListener(onPollfishSurveyNotAvailable);
void onPollfishSurveyNotAvailable() => setState(() {
debugPrint('survey not available'); //this one never called in release mode but works in debug mode.
});
Other callbacks are working properly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.