Giter Club home page Giter Club logo

facebook_audience_network's People

Contributors

dharmesh304 avatar dipinarora9 avatar idan-bm avatar juliocbcotta avatar palkesh22 avatar rilindnuka avatar ritheshsalyan avatar sachinganesh avatar surajshettigar avatar venkata-reddy-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facebook_audience_network's Issues

PlayStore Published App Crashes on Launch if Native Ads are used

If the app uses Native Ads, it will crash on launch

    Process: com.example.app, PID: 21546
    java.lang.RuntimeException: java.io.FileNotFoundException: audience_network.dex
        at com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory.makeLoader(DynamicLoaderFactory.java:109)
        at com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory$1.run(DynamicLoaderFactory.java:83)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.io.FileNotFoundException: audience_network.dex
        at android.content.res.AssetManager.nativeOpenAsset(Native Method)
        at android.content.res.AssetManager.open(AssetManager.java:755)
        at android.content.res.AssetManager.open(AssetManager.java:732)
        at com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory.createInMemoryClassLoader(DynamicLoaderFactory.java:160)
        at com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory.makeAdsSdkClassLoader(DynamicLoaderFactory.java:123)
        at com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory.makeLoader(DynamicLoaderFactory.java:101)
        at com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory$1.run(DynamicLoaderFactory.java:83) 
        at java.lang.Thread.run(Thread.java:764) ```

App Size Increases

After add plugin my app size increased by 1.3MB.
Everything works fine, but can we reduce plugin size?

Please consider creating an AppoDeal Flutter Plugin

This Facebook Plugin is great. It would be amazing if you guys could create an AppoDeal widget also.

Is this something you would consider?

Even if it just supported Interstitials to begin with. Banners etc could be added later.

Trying to create an already created platform view

I've downloaded the example app and I'm getting two type of issues:

  • When I reload the app and tap some ads I'm getting the following exception:
E/flutter (24489): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create an already created platform view, view id: 3
E/flutter (24489): 	at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:85)
E/flutter (24489): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:96)
E/flutter (24489): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:60)
E/flutter (24489): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/flutter (24489): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/flutter (24489): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/flutter (24489): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (24489): 	at android.os.MessageQueue.next(MessageQueue.java:323)
E/flutter (24489): 	at android.os.Looper.loop(Looper.java:135)
E/flutter (24489): 	at android.app.ActivityThread.main(ActivityThread.java:5525)
E/flutter (24489): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (24489): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
E/flutter (24489): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
E/flutter (24489): , null)
E/flutter (24489): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (24489): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (24489): <asynchronous suspension>
E/flutter (24489): #2      AndroidViewController._create (package:flutter/src/services/platform_views.dart:640:54)
E/flutter (24489): #3      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:557:14)
E/flutter (24489): #4      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:174:29)
E/flutter (24489): #5      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:155:5)
E/flutter (24489): #6      RenderObject.layout (package:flutter/src/rendering/object.dart:1703:9)
E/flutter (24489): #7      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (24489): #8      RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (24489): #9      RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
E/flutter (24489): #10     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (24489): #11     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:392:13)
E/flutter (24489): #12     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (24489): #13     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
E/flutter (24489): #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (24489): #15     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
E/flutter (24489): #16     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (24489): #17     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:392:13)
E/flutter (24489): #18     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (24489): #19     RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:806:17)
E/flutter (24489): #20     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
E/flutter (24489): #21     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:163:11)
E/flutter (24489): #22     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:477:7)
E/flutter (24489): #23     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:232:7)
E/flutter (24489): #24     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:391:14)
E/flutter (24489): #25     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1584:7)
E/flutter (24489): #26     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:844:18)
E/flutter (24489): #27     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:344:19)
E/flutter (24489): #28     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:774:13)
E/flutter (24489): #29     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:283:5)
E/flutter (24489): #30     SchedulerBinding._invokeFrameCallback (package:flutter/s
  • When I close the Rewarded or Interstitial ads and I tap the corresponding button again, the ad doesn't loads.

Couldn't retrieve video information. Error not catched and app crashed

This error not catched and throwed to listener. So the screen just freezing until app-not-responding dialog shows up.

Couldn't retrieve video information
java.lang.RuntimeException: failure code: -38
at android.media.MediaPlayer.invoke(MediaPlayer.java:710)
at android.media.MediaPlayer.getInbandTrackInfo(MediaPlayer.java:2239)
at android.media.MediaPlayer.getTrackInfo(MediaPlayer.java:2221)
at com.facebook.ads.internal.tv.d(SourceFile:680)
at com.facebook.ads.internal.rp.k(SourceFile:431)
at com.facebook.ads.internal.np$9.a(SourceFile:162)
at com.facebook.ads.internal.np$9.a(SourceFile:156)
at com.facebook.ads.internal.he.a(SourceFile:1143)
at com.facebook.ads.internal.rp$2.run(SourceFile:191)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)

My code

FacebookInterstitialAd.destroyInterstitialAd().then((bool success){
    FacebookInterstitialAd.loadInterstitialAd(
        placementId: "MY_PLACEMENT_ID",
        listener: (InterstitialAdResult result, value) {
            if(result == InterstitialAdResult.LOADED) FacebookInterstitialAd.showInterstitialAd(delay: 5000);
            else if(result == InterstitialAdResult.DISMISSED) onDismissed();
            else if(result == InterstitialAdResult.ERROR) onError();
        }
    );
});

Unable to refresh Banner Ad

How to refresh Banner ads? I am trying to just set previous instance of FacebookBannerAd to null create a new instance of FacebookBannerAd since it looks like the banner doesn't get refreshed on there own. But none of the listener events are getting triggered on the 2nd instance so I am not seeing it loading.

FacebookBannerAd(
placementId: "YOUR_PLACEMENT_ID",
bannerSize: BannerSize.STANDARD,
listener: (result, value) {
switch (result) {
case BannerAdResult.ERROR:
print("Error: $value");
break;
case BannerAdResult.LOADED:
print("Loaded: $value");
break;
case BannerAdResult.CLICKED:
print("Clicked: $value");
break;
case BannerAdResult.LOGGING_IMPRESSION:
print("Logging Impression: $value");
break;
}
},
),

Test device id is not printed

Tried multiple pugins for admob and facebook,but none of them are printing my device id.
Even i tried to create an dummy Native Android app in Android studio but the test device id is not printed,Some of the apps which are in playstore shows different ids for different apps.This plugin also not printing my test device id

ads does not show in Release apk in android

Hope all is well.

I understand you are having some issues with your Android property and Ads status stuck in Idle.

After having a look into your account, I can confirm that the reason traffic has been stopped on your property is because your Android SDK is currently running an outdated and unsupported version.

We kindly ask you to update your Android SDK in order to receive Ads traffic on your platform.

Best regards,

George
Facebook Partners Support Analyst

Build Failing

build failing on running app with following error:

Execution failed for task ':app:preDebugBuild'.

Android dependency 'com.google.android.exoplayer:exoplayer-dash:r2.4.2' is set to compileOnly/provided which is not supported

Server Issue [iOS Platform]

I got server issue when integrating git dependency block in pubspec.yaml file.
Any help will be appreciated. Thanks!!

Test Ad Crash

When I disable useClearTextTrafic.

E/ProxyCache: Error reading ping response
com.facebook.ads.redexgen.X.Ms: Error opening connection for http://127.0.0.1:39539/ping with offset 0
at com.facebook.ads.redexgen.X.N5.A05(:36314)
at com.facebook.ads.redexgen.X.N5.A6S(:36320)
at com.facebook.ads.redexgen.X.N2.A0K(:36155)
at com.facebook.ads.redexgen.X.N2.A0L(:36164)
at com.facebook.ads.redexgen.X.My.A00(:36009)
at com.facebook.ads.redexgen.X.My.call(:36010)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:764)
Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:485)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:434)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:565)
at com.facebook.ads.redexgen.X.N5.A02(:36284)
at com.facebook.ads.redexgen.X.N5.A05(:36308)
at com.facebook.ads.redexgen.X.N5.A6S(:36320) 
at com.facebook.ads.redexgen.X.N2.A0K(:36155) 
at com.facebook.ads.redexgen.X.N2.A0L(:36164) 
at com.facebook.ads.redexgen.X.My.A00(:36009) 
at com.facebook.ads.redexgen.X.My.call(:36010) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
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:764) 
2020-02-02 13:13:36.814 16837-17042/com.nanotricks.engaarea I/CrashlyticsCore: Crashlytics report upload complete: 5E367D9F0090-0001-41C5-40E690B657DA
2020-02-02 13:13:37.013 16837-17515/com.nanotricks.engaarea E/ProxyCache: Shutdown server... Error pinging server [attempts: 3, max timeout: 1200].
2020-02-02 13:13:37.013 16837-17515/com.nanotricks.engaarea I/ProxyCache: Shutdown proxy server
2020-02-02 13:13:37.026 16837-17520/com.nanotricks.engaarea E/ProxyCache: HttpProxyCacheServer error
com.facebook.ads.redexgen.X.Mp: Error during waiting connection
at com.facebook.ads.redexgen.X.N2.A07(:36095)
at com.facebook.ads.redexgen.X.N2.A0B(:36107)
at com.facebook.ads.redexgen.X.N1.A03(:36025)
at com.facebook.ads.redexgen.X.27.run(:2549)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.net.SocketException: Socket closed
at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:205)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:451)
at java.net.ServerSocket.implAccept(ServerSocket.java:547)
at java.net.ServerSocket.accept(ServerSocket.java:515)
at com.facebook.ads.redexgen.X.N2.A07(:36091)
at com.facebook.ads.redexgen.X.N2.A0B(:36107) 
at com.facebook.ads.redexgen.X.N1.A03(:36025) 
at com.facebook.ads.redexgen.X.27.run(:2549) 
at java.lang.Thread.run(Thread.java:764) 

Any ad request causes a crash on Amazon Fire HD 10"

I am using a new Fire HD 10" for testing on tablets. Although it may not be the best choice as normally google play services, etc are not even installed. I added those manually. However if I ever want to release my app on the Amazon store obviously my app wouldn't have to not crash on startup on Amazon tablets.

I have been using the tablet for testing all other parts of my app without issues. For some reason I get a serious app crash making any calls to any facebook ads. I have not been able to find another flutter library that doesn't do the same thing. I was just attempting a Facebook banner ad.

My concern is if this issue can happen with other devices if it happens on the Fire HD. My fire HD is OS 7.3.1.2 which is based on Android 9

The app just shuts down with this trace.

E/System (20111): TRACE Starting certificate trust
D/CRLSetManager(20111): getInstance binder: android.os.BinderProxy@6533f88
I/mali (20111): [MALI] @eglSetDamageRegionKHR: surf->buffer_age_queried_this_frame == MALI_FALSE (EGL_BAD_ACCESS)
F/OpenGLRenderer(20111): Failed to set damage region on surface 0xebb4c5e0, error=EGL_BAD_ACCESS
F/google-breakpad(20803): Microdump skipped (uninteresting)
W/google-breakpad(20111): ### ### ### ### ### ### ### ### ### ### ### ### ###
W/google-breakpad(20111): Chrome build fingerprint:
W/google-breakpad(20111): 70.amazon-webview-v70-3538.3538.110.137
W/google-breakpad(20111): 60071632
W/google-breakpad(20111): ### ### ### ### ### ### ### ### ### ### ### ### ###
F/libc (20111): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 20269 (RenderThread), pid 20111 (.myapp)


Build fingerprint: 'Amazon/maverick/maverick:7.0/PS7312/1271N:user/amz-p,release-keys'
Revision: '0'
ABI: 'arm'
pid: 20111, tid: 20269, name: RenderThread >>> com.myapp <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'Failed to set damage region on surface 0xebb4c5e0, error=EGL_BAD_ACCESS'
r0 00000000 r1 00004f2d r2 00000006 r3 00000008
r4 00004e8f r5 00004f2d r6 c8567254 r7 0000010c
r8 c45cc694 r9 00003e28 r10 c8567798 r11 c85677a8
ip c85671f0 sp c8567240 lr f3feaee1 pc f3fe2d2e
backtrace:
#00 pc 0001cd2e /system/lib/libc.so (abort+58)
#1 pc 00006d11 /system/lib/liblog.so (__android_log_assert+156)
#2 pc 0036e411 /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::damageFrame(android::uirenderer::renderthread::Frame const&, SkRect const&)+100)
#3 pc 0036a0af /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::draw(android::uirenderer::renderthread::Frame const&, SkRect const&, SkRect const&, android::uirenderer::FrameBuilder::LightGeometry const&, android::uirenderer::LayerUpdateQueue*, android::uirenderer::Rect const&, bool, bool, android::uirenderer::BakedOpRenderer::LightInfo const&, std::__1::vector<android::spandroid::uirenderer::RenderNode, std::__1::allocator<android::spandroid::uirenderer::RenderNode>
#4 pc 000a106b /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+154)
#5 pc 0036d835 /system/lib/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+576)
#6 pc 00336d09 /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+124)
#7 pc 000a9c63 /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+178)
#8 pc 0000c08b /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
#9 pc 00063385 /system/lib/libc.so (__pthread_start(void*)+22)
#10 pc 0001def1 /system/lib/libc.so (__start_thread+24)
Lost connection to device.

Listener when ad is loaded and closed

Sometimes we need to display ad more than once after single user activity. For example in my case, user may click on a button to display ad, and some app's event afterward will want to show the ad once again but not if the ad is already shown. I assumed FacebookInterstitialAd.showInterstitialAd().then() will be triggered only when the ad is closed, but it's not. So I can't find any way how to do it using the plugin.

Please update to the last SDK

I'm using

facebook_audience_network: ^0.6.2

result :

InterstitialAdResult.ERROR

error_message :

The SDK version in the ad request is no longer supported for new apps. Please upgrade to one of the latest versions of the SDK, error_code: 1203, invalidated: true

iOS build failing

I am having trouble building my project after adding the integration in iOs on Android, everything works fine, but when trying to build for iOS I get this:

  /dev/flutter/.pub-cache/hosted/pub.dartlang.org/facebook_audience_network-0.6.2/ios/Classes/FacebookAudienceNetworkPlugin.m:2:9: fatal error:
    'facebook_audience_network/facebook_audience_network-Swift.h' file not found
    #import <facebook_audience_network/facebook_audience_network-Swift.h>

Any ideas?

Getting error for height in IOS but works totally fine in Android

Hi
I am getting this error in IOS, but in Android, it works fine.

The following _TypeError was thrown building FacebookNativeAd(dirty, dependencies: [MediaQuery], state: _FacebookNativeAdState#fefd9):
type 'int' is not a subtype of type 'double'

Here is the code

class FacebookNativeBannerAdWidget extends StatefulWidget{
  final double width;
  final double height;
  final Color backgroundColor;
  final Color titleColor ;
  final Color descriptionColor;
  final Color buttonColor;
  final Color buttonTitleColor;
  final Color buttonBorderColor;

  const FacebookNativeBannerAdWidget({Key key,@required this.width,@required this.backgroundColor,
          @required this.titleColor,@required this.descriptionColor,@required this.buttonColor,@required this.buttonTitleColor,
          @required this.buttonBorderColor,@required this.height}) : super(key: key);

  @override
  _FacebookNativeBannerAdWidgetState createState() => _FacebookNativeBannerAdWidgetState();
}

class _FacebookNativeBannerAdWidgetState extends State<FacebookNativeBannerAdWidget> {

  @override
  void initState() {
    super.initState();

    FacebookAudienceNetwork.init(
      // puting device-id for testing only
      // IOS
      testingId: "7d1416eb-c8c4-4b81-b1a8-4e0c8045bb76",
      // Android Emulator
      // testingId: "d18eeefd-1ab0-4bca-a479-4bfc6073379e",
    );
  }

  @override
  Widget build(BuildContext context) {
    return FacebookNativeAd(
      adType: NativeAdType.NATIVE_BANNER_AD,
      placementId: Platform.isAndroid ? '603201673930615_606066876977428' : '603201673930615_606067633644019',
      width: widget.width,
      height: widget.height < 50.0 ? 50.0 : widget.height > 50.0 && widget.height < 120.0 ? 100.0 : 120.0 ,
      bannerAdSize: widget.height < 50.0 ? NativeBannerAdSize.HEIGHT_50 : widget.height > 50.0 && widget.height < 120.0 ? NativeBannerAdSize.HEIGHT_100 : NativeBannerAdSize.HEIGHT_120,
      backgroundColor: widget.backgroundColor,
      titleColor: widget.titleColor,
      descriptionColor: widget.descriptionColor,
      buttonColor: widget.buttonColor,
      buttonTitleColor: widget.buttonTitleColor,
      buttonBorderColor: widget.buttonBorderColor,
      keepExpandedWhileLoading: false,
      listener: (result, value) {
        print("Native Ad: $result --> $value");   
        }
      );
  }

Remove blank black color

Thanks for the plugin, I have been waiting for admob alternatif plugin for flutter,

Can the blank black color in native ads changed with custom color or a loading indicator / shimmer before the ad is loaded? And what if the device doesnt have facebook installed? The ad wont show, so it would be good if there is a fallback view instead showing blank black space.

UPDATE IOS to 5.10.1

I saw the released version containing the updates.

But the ios versions are not included in the .podspec file.

Really easy fix.

Unable to test ads in IOS platform

Hi I am unable to test banner ad in Ios platform . same code worked in Android Platform
Can someone Please help me on this Issue

Printed log:

flutter: Loaded: {placement_id: my own id, invalidated: true}

Violation of Usage of Android Advertising ID policy and section 4.8 of the Developer Distribution Agreement

I've received an email from Google Play Team saying

Hi developers at ...,

After review, ..., com..., has been removed from Google Play due to a policy violation. This app won’t be available to users until you submit a compliant update.

Issue: Violation of Usage of Android Advertising ID policy and section 4.8 of the Developer Distribution Agreement

Google Play requires developers to provide a valid privacy policy when the app requests or handles sensitive user or device information. We’ve identified that your app collects and transmits the Android advertising identifier, which is subject to a privacy policy requirement. If your app collects the Android advertising ID, you must provide a valid privacy policy in both the designated field in the Play Console, and from within the app.

Next steps: Submit your app for another review

Read through the Usage of Android Advertising ID and User Data policies, as well as the Developer Distribution Agreement, and make appropriate changes to your app. If you decide to collect sensitive user information, be sure to abide by the above policies, and include a link to a valid privacy policy on your app's store listing page and within your app.
Make sure that your app is compliant with all other Developer Program Policies. Additional enforcement could occur if there are further policy violations.
Sign in to your Play Console and submit the update to your app.
Alternatively, you may opt-out of this requirement by removing any requests for sensitive permissions or user data.

If approved, your app will again be available with all installs, ratings, and reviews intact.

If you’ve reviewed the policy and feel this removal may have been in error, please reach out to our policy support team. One of my colleagues will get back to you within 2 business days.

Thanks for helping us provide a clear and transparent experience for Google Play users.

Regards,

The Google Play Team

Native Banner Ad blank space if Ad not loaded

The fill rate inside my app is less than 30% these days thats why most of the users see a blank space instead of ad. Is there any way i can show a custom ad to promote my other app or atleast hide that blank space?

This is the sole reason I have removed native banner ads from the app for now because the empty space make the UI look ugly :(

Update to Latest Audience Network SDK

Hello,

About a month ago facebook audience network released SDK 5.11 but the plugin still depends on 5.7. Please bump up to the latest sdk version.

Thanks

error: module 'facebook_audience_network' not found

I'm getting this error whenever I try to build or run the app.

1 error generated.
    /Users/-/-/-/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal
    error: module 'facebook_audience_network' not found
    @import facebook_audience_network;

Test ads are working but real ads are not appearing

Hi, the test ads are appearing perfectly. But when I add my placement id, ads are not appearing. .

D/FBAudienceNetwork(21439): SDK dex loading time: 87
I/ProxyCache(21439): Proxy cache server started. Ping it...
D/ProxyCache(21439): Open connection  to http://127.0.0.1:42043/ping
E/ProxyCache(21439): Error reading ping response
E/ProxyCache(21439): com.facebook.ads.internal.kd: Error opening connection for http://127.0.0.1:42043/ping with offset 0
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:66)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg.a(SourceFile:131)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg$c.a(SourceFile:1060)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg$c.call(SourceFile:396)
E/ProxyCache(21439):    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/ProxyCache(21439):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/ProxyCache(21439):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/ProxyCache(21439):    at java.lang.Thread.run(Thread.java:764)
E/ProxyCache(21439): Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
E/ProxyCache(21439):    at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:538)
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:145)
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:61)
E/ProxyCache(21439):    ... 7 more
E/FBAudienceNetwork(21439): You don't call AudienceNetworkAds.initialize(). Some functionality may not work properly.
D/AdInternalSettings(21439): Test mode device hash: deb67081-d21d-4208-989c-ac24fcd2cc8a
D/AdInternalSettings(21439): When testing your app with Facebook's ad units you must specify the device hashed ID to ensure the delivery of test ads, add the following code before loading an ad: AdSettings.addTestDevice("deb67081-d21d-4208-989c-ac24fcd2cc8a");
E/FBAudienceNetwork(21439): You are using custom Application class and don't call AudienceNetworkAds.isInAdsProcess(). Multi-process support will be disabled. Please call AudienceNetworkAds.isInAdsProcess() if you want to support multi-process mode.
D/ProxyCache(21439): Open connection  to http://127.0.0.1:42043/ping
E/ProxyCache(21439): Error reading ping response
E/ProxyCache(21439): com.facebook.ads.internal.kd: Error opening connection for http://127.0.0.1:42043/ping with offset 0
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:66)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg.a(SourceFile:131)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg$c.a(SourceFile:1060)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg$c.call(SourceFile:396)
E/ProxyCache(21439):    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/ProxyCache(21439):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/ProxyCache(21439):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/ProxyCache(21439):    at java.lang.Thread.run(Thread.java:764)
E/ProxyCache(21439): Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
E/ProxyCache(21439):    at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:538)
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:145)
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:61)
E/ProxyCache(21439):    ... 7 more
I/flutter (21439): Native Banner Ad: NativeAdResult.ERROR --> {error_message: No fill, error_code: 1001, invalidated: true, placement_id: 383262725809870_384072102395599}
D/ProxyCache(21439): Open connection  to http://127.0.0.1:42043/ping
E/ProxyCache(21439): Error reading ping response
E/ProxyCache(21439): com.facebook.ads.internal.kd: Error opening connection for http://127.0.0.1:42043/ping with offset 0
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:66)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg.a(SourceFile:131)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg$c.a(SourceFile:1060)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg$c.call(SourceFile:396)
E/ProxyCache(21439):    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/ProxyCache(21439):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/ProxyCache(21439):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/ProxyCache(21439):    at java.lang.Thread.run(Thread.java:764)
E/ProxyCache(21439): Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
E/ProxyCache(21439):    at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
E/ProxyCache(21439):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:538)
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:145)
E/ProxyCache(21439):    at com.facebook.ads.internal.ki.a(SourceFile:61)
E/ProxyCache(21439):    ... 7 more
I/flutter (21439): Native Ad: NativeAdResult.ERROR --> {error_message: No fill, error_code: 1001, invalidated: true, placement_id: 383262725809870_384038435732299}
E/ProxyCache(21439): Shutdown server... Error pinging server [attempts: 3, max timeout: 1200].
I/ProxyCache(21439): Shutdown proxy server
E/ProxyCache(21439): HttpProxyCacheServer error
E/ProxyCache(21439): com.facebook.ads.internal.km: Error during waiting connection
E/ProxyCache(21439):    at com.facebook.ads.internal.kg$g.run(SourceFile:1267)
E/ProxyCache(21439):    at java.lang.Thread.run(Thread.java:764)
E/ProxyCache(21439): Caused by: java.net.SocketException: Socket closed
E/ProxyCache(21439):    at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:205)
E/ProxyCache(21439):    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:451)
E/ProxyCache(21439):    at java.net.ServerSocket.implAccept(ServerSocket.java:547)
E/ProxyCache(21439):    at java.net.ServerSocket.accept(ServerSocket.java:515)
E/ProxyCache(21439):    at com.facebook.ads.internal.kg$g.run(SourceFile:1262)
E/ProxyCache(21439):    ... 1 more

I am getting ad requests but no fill rate
image

Any help is appreciated

refresh native banner ads

I use the native banner, is it possible to refresh the ads as on admob? Because my advertising is never refreshed, which limits the number of printing.
Thank You

iOS Integration Issue

I really appreciate the work being put in to allow for iOS integration, but I'm running into a bit of an issue that's preventing my project from running. When I try to run the project, the following error is printed to the console:

Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running pod install...                                              1.0s
CocoaPods' output:
↳
  Preparing
Analyzing dependencies
Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `connectivity` from `.symlinks/plugins/connectivity/ios`
-> Fetching podspec for `connectivity_macos` from `.symlinks/plugins/connectivity_macos/ios`
-> Fetching podspec for `facebook_audience_network` from `.symlinks/plugins/facebook_audience_network/ios`
-> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
-> Fetching podspec for `path_provider_macos` from `.symlinks/plugins/path_provider_macos/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `shared_preferences_macos` from `.symlinks/plugins/shared_preferences_macos/ios`
-> Fetching podspec for `shared_preferences_web` from `.symlinks/plugins/shared_preferences_web/ios`
-> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: all_pods_versions_f_4_e.txt exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/f/4/e/FMDB/2.7.5/FMDB.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: all_pods_versions_c_7_9.txt exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/c/7/9/Reachability/3.2/Reachability.podspec.json exists! Returning local because checking is only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "facebook_audience_network":
  In Podfile:
    facebook_audience_network (from `.symlinks/plugins/facebook_audience_network/ios`)
Specs satisfying the `facebook_audience_network (from `.symlinks/plugins/facebook_audience_network/ios`)` dependency were found, but they required a higher minimum deployment target.
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/resolver.rb:94:in `resolve'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:986:in `block in resolve_dependencies'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:984:in `resolve_dependencies'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:410:in `analyze'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:234:in `block in resolve_dependencies'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:233:in `resolve_dependencies'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:156:in `install!'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:52:in `run'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/bin/pod:23:in `load'
/Users/danielsmith/.rvm/rubies/ruby-2.4.6/bin/pod:23:in `<main>'
/Users/danielsmith/.rvm/gems/ruby-2.4.6/bin/ruby_executable_hooks:24:in `eval'
/Users/danielsmith/.rvm/gems/ruby-2.4.6/bin/ruby_executable_hooks:24:in `<main>'
Error output from CocoaPods:
↳
[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone 11 Pro.
Exited (sigterm)

0.3.3 is not androidX compatible

I am getting compile time error when using version 0.3.3. The error says that it couldn't find

androidx.recyclerview:recyclerview:27.1.0

I think this is because the plugin in not using androidX libraries.

Please can the plugin be changed to support androidX rather than support libraries?

com.facebook.ads has been deprecated

  1. InstreamVideoAdListener in com.facebook.ads has been deprecated
    import com.facebook.ads.InstreamVideoAdListener;

  2. InstreamVideoAdView in com.facebook.ads has been deprecated
    import com.facebook.ads.InstreamVideoAdView;

  3. InstreamVideoAdListener in com.facebook.ads has been deprecated
    class FacebookInStreamVideoAdView implements PlatformView, InstreamVideoAdListener {

  4. InstreamVideoAdView in com.facebook.ads has been deprecated
    private final InstreamVideoAdView adView;

  5. InstreamVideoAdView in com.facebook.ads has been deprecated
    adView = new InstreamVideoAdView(context, (String) args.get("id"), getSize(args));

  6. withAdListener(InstreamVideoAdListener) in InstreamVideoLoadConfigBuilder has been deprecated
    InstreamVideoAdView.InstreamVideoLoadAdConfig loadAdConfig = adView.buildLoadAdConfig().withAdListener(this).build();

  7. build() in InstreamVideoLoadConfigBuilder has been deprecated
    InstreamVideoAdView.InstreamVideoLoadAdConfig loadAdConfig = adView.buildLoadAdConfig().withAdListener(this).build();

  8. loadAd(InstreamVideoLoadAdConfig) in InstreamVideoAdView has been deprecated
    adView.loadAd(loadAdConfig);

  9. isAdLoaded() in InstreamVideoAdView has been deprecated
    if (adView == null || !adView.isAdLoaded())

  10. show() in InstreamVideoAdView has been deprecated
    adView.show();

How to Fix it ?

"Rejecting attempt to make a View its own child"

Excellent package and have FacebookNativeAd running great on both Android and iOS -
However when running on Android - the terminal relentlessly logs:

"Rejecting attempt to make a View its own child"

No error, just this logged.

Widget causing the error:

FacebookNativeAd(
                                placementId: "IMG_16_9_APP_INSTALL#2312433698835503_2964952163583650",
                                adType: NativeAdType.NATIVE_AD,
                                width: double.infinity,
                                height: 250.0,
                                backgroundColor:
                                    Theme.of(context).backgroundColor,
                                titleColor:
                                    Theme.of(context).textTheme.bodyText1.color,
                                descriptionColor:
                                    Theme.of(context).textTheme.bodyText1.color,
                                buttonColor: Theme.of(context).primaryColor,
                                buttonTitleColor:
                                    Theme.of(context).textTheme.headline1.color,
                                buttonBorderColor:
                                    Theme.of(context).primaryColor,
                                listener: (result, value) {
                                  print("Native Ad: $result --> $value");
                                },
                                keepAlive: true,
                                keepExpandedWhileLoading: true,
                                expandAnimationDuraion: 1000,
                              ),

Flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.22.0-2.0.pre.36, on Mac OS X 10.15.6 19G2021, locale en-GB)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.48.1)
[✓] Connected device (2 available)

• No issues found!

Has anyone seen this before?

Error installing FBAudienceNetwork

pod intsall
Analyzing dependencies
Downloading dependencies
Installing FBAudienceNetwork (5.9.0)

[!] Error installing FBAudienceNetwork
[!] /usr/bin/curl -f -L -o /var/folders/3b/h8gsb_ss03ndfm49x4ydb9pr0000gn/T/d20200804-23451-fe4ly4/file.zip https://developers.facebook.com/resources/FBAudienceNetwork-5.9.0.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.9.3 cocoapods-downloader/1.4.0'

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
Warning: Transient problem: HTTP error Will retry in 1 seconds. 2 retries
Warning: left.
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
Warning: Transient problem: HTTP error Will retry in 2 seconds. 1 retries
Warning: left.
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 500

Ad didn't get opened when clicked (Android)

In my App when a user click on the Facebook Audience Network it didn't open.

Error log:

E/Parcel  ( 1218): Reading a NULL string not supported here.
V/SensorManager( 1218): RegisterListener BMI160 Gyroscope type:4 delay:200000us by com.facebook.ads.redexgen.X.Fl
E/Parcel  ( 1218): Reading a NULL string not supported here.
V/SensorManager( 1218): unRegisterListener by com.facebook.ads.redexgen.X.Fk
E/Parcel  ( 1218): Reading a NULL string not supported here.
V/SensorManager( 1218): unRegisterListener by com.facebook.ads.redexgen.X.Fl

Code is similar to readme file:

@override
  void initState() {
    super.initState();
  FacebookAudienceNetwork.init(
      
    );
}


// in build
children: <Widget>[
                Container(
                    // color: Colors.grey[100],
                    child: Column(
                  children: <Widget>[
                    SizedBox(
                      height: 10,
                    ),
                    FacebookNativeAd(
                      placementId: "2327707714024530_2329615307167104",
                      adType: NativeAdType.NATIVE_AD,
                      width: double.infinity,
                      height: 300,
                      backgroundColor: Colors.black,
                      titleColor: Colors.white,
                      descriptionColor: Colors.white,
                      buttonColor: allColorsNamed['green'],
                      buttonTitleColor: Colors.white,
                      buttonBorderColor: Colors.white,
                      listener: (result, value) {
                        print("Native Ad: $result --> $value");
                      },
                    ),

Error is showing up when building a release version.

Error is showing up when building a release version for example app

Cannot find a version of 'com.android.support:support-annotations' that satisfies the version constraints: 
   Dependency path 'android:app:unspecified' --> 'com.android.support.test:runner:1.0.2' --> 'com.android.support:support-annotations:27.1.1'
   Constraint path 'android:app:unspecified' --> 'com.android.support:support-annotations:{strictly 25.2.0}' because of the following reason: debugRuntimeClasspath uses version 25.2.0
   Constraint path 'android:app:unspecified' --> 'com.android.support:support-annotations:{strictly 25.2.0}' because of the following reason: debugRuntimeClasspath uses version 25.2.0
   Dependency path 'android:app:unspecified' --> 'com.android.support.test:runner:1.0.2' --> 'com.android.support.test:monitor:1.0.2' --> 'com.android.support:support-annotations:27.1.1'
   Constraint path 'android:app:unspecified' --> 'com.android.support:support-annotations:{strictly 25.2.0}' because of the following reason: debugRuntimeClasspath uses version 25.2.0
   Constraint path 'android:app:unspecified' --> 'com.android.support:support-annotations:{strictly 25.2.0}' because of the following reason: debugRuntimeClasspath uses version 25.2.0
   Constraint path 'android:app:unspecified' --> 'com.android.support:support-annotations:{strictly 25.2.0}' because of the following reason: debugRuntimeClasspath uses version 25.2.0
   Dependency path 'android:app:unspecified' --> 'com.dsi.facebook_audience_network:facebook_audience_network:1.0-SNAPSHOT' --> 'com.facebook.android:audience-network-sdk:5.3.0' --> 'com.google.android.gms:play-services-basement:11.0.4' --> 'com.android.support:support-v4:25.2.0' --> 'com.android.support:support-compat:25.2.0' --> 'com.android.support:support-annotations:25.2.0'
   Dependency path 'android:app:unspecified' --> 'com.dsi.facebook_audience_network:facebook_audience_network:1.0-SNAPSHOT' --> 'com.facebook.android:audience-network-sdk:5.3.0' --> 'com.google.android.gms:play-services-basement:11.0.4' --> 'com.android.support:support-v4:25.2.0' --> 'com.android.support:support-media-compat:25.2.0' --> 'com.android.support:support-annotations:25.2.0'
   Dependency path 'android:app:unspecified' --> 'com.dsi.facebook_audience_network:facebook_audience_network:1.0-SNAPSHOT' --> 'com.facebook.android:audience-network-sdk:5.3.0' --> 'com.google.android.gms:play-services-basement:11.0.4' --> 'com.android.support:support-v4:25.2.0' --> 'com.android.support:support-core-utils:25.2.0' --> 'com.android.support:support-annotations:25.2.0'
   Dependency path 'android:app:unspecified' --> 'com.dsi.facebook_audience_network:facebook_audience_network:1.0-SNAPSHOT' --> 'com.facebook.android:audience-network-sdk:5.3.0' --> 'com.google.android.gms:play-services-basement:11.0.4' --> 'com.android.support:support-v4:25.2.0' --> 'com.android.support:support-core-ui:25.2.0' --> 'com.android.support:support-annotations:25.2.0'


Please bump Facebook SDK Version

Hi there,

The current version of the SDK is quite old and there have been a lot of changes since 5.7.

Could you please bump the version of the Facebook SDK to the latest version?

It is now 5.10.0.

Thanks.

Version 0.6.0 iOS not building

Hi, thanks for this great plugin.

I used the git version for IOS and it was working correctly, i updated now to version 0.6.0 but can't get the build to work. i tried with pod deintegrate pod update, deleting the pods folder, podfile.lock, but to no avail.

The error i get is:

`
=== BUILD TARGET facebook_audience_network OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/davidbarbieri/development/flutter/.pub-cache/hosted/pub.dartlang.org/facebook_audience_network-0.6.0/ios/Classes/FacebookAudienceNetworkPlugin.m:3:9: fatal error: 'facebook_audience_network-Swift.h' file not found
#import "facebook_audience_network-Swift.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
`

Thanks!

Application attempted to call on a destroyed WebView - Flutter Facebook Ads doesn't loaded when open another screen

I am trying to create banner ad in my 5-10 screens. I am using following method to create banner ad in each flutter app screen. So whichever screen i open for the first time it loads ad successfully. But, when i go to another screen then it doesn't load ads anyway. I have also implemented logic that ad requests are made throughout the app after 30 seconds. Still i am not able to load ads on other screens once loaded in first screen.

createBannerAd() {
    _currentAd = Container(
      alignment: Alignment(0.5, 1),
      child: FacebookBannerAd(
        placementId:  IMG_16_9_APP_INSTALL#2312433698835503_2964944860251047,
        bannerSize: BannerSize.STANDARD,
        listener: (result, value) {
          switch (result) {
            case BannerAdResult.ERROR:
              _adShown = false;
              print("Error: $value");
              break;
            case BannerAdResult.LOADED:
              print("Loaded: $value");
              break;
            case BannerAdResult.CLICKED:
              print("Clicked: $value");
              break;
            case BannerAdResult.LOGGING_IMPRESSION:
              print("Logging Impression: $value");
              break;
          }
        },
      ),
    );
    setState(() {});
  }

I am not getting what is the issue with this code. I have followed the proper documentation as well.

So can anyone suggest me a proper solution for this.

Thanks.

Error log :

D/EgretLoader(25084): EgretLoader(Context context)
D/EgretLoader(25084): The context is not activity
W/cr_AwContents(25084): Application attempted to call on a destroyed WebView
W/cr_AwContents(25084): java.lang.Throwable
W/cr_AwContents(25084): at org.chromium.android_webview.AwContents.a(PG:126)
W/cr_AwContents(25084): at TA0.loadingStateChanged(PG:2)
W/cr_AwContents(25084): at android.os.MessageQueue.nativePollOnce(Native Method)
W/cr_AwContents(25084): at android.os.MessageQueue.next(MessageQueue.java:325)
W/cr_AwContents(25084): at android.os.Looper.loop(Looper.java:148)
W/cr_AwContents(25084): at android.app.ActivityThread.main(ActivityThread.java:6634)
W/cr_AwContents(25084): at java.lang.reflect.Method.invoke(Native Method)
W/cr_AwContents(25084): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
W/cr_AwContents(25084): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:822)
I/flutter (25084): Error: {error_message: No Fill, error_code: 1001, invalidated: false, placement_id: IMG_16_9_APP_INSTALL#2312433698835503_2964944860251047}

Consent for EU countries

Hi! In EU we have to display a popup to have the user give consent for the Ads? how does it work with facebook?
On Admob there was a field at init time to pass the consent flag, is there something like this in Audience Network?

1001 Invalidate error

I received this error when I navigated to another scaffold widget.
Should I do FacebookAudienceNetwork.init() for every screen.
It doesn't work either way.

Error: {error_message: No Fill, error_code: 1001, invalidated: false, placement_id: [my_placement_id]}

Thanks

Fill rate of 0 for iOS

I implemented this framework into my flutter app that is available for both iOS and Android. It's been live for a bit over a week now, and for some reason, despite having many ad requests for iOS, none of them have been filled. I've had fewer requests for the Android version, because it has fewer Android users, but the fill rate for that version is around 75%, which makes sense. Do you have any ideas regarding what could be causing this?

i Found bug in iOS. See below detailed resolution.

File FacebookAudienceNetworkInterstitialAd.swift
Line no:- 106
func interstitialAdDidClose(_ interstitialAd: FBInterstitialAd) { print("InterstitialAdView > interstitialAdDidClose") // You need to forgot dismissed event. //Here is the code you need to add let placement_id: String = interstitialAd.placementID let invalidated: Bool = interstitialAd.isAdValid let arg: [String: Any] = [ FANConstant.PLACEMENT_ID_ARG: placement_id, FANConstant.INVALIDATED_ARG: invalidated, ] self.channel.invokeMethod(FANConstant.DISMISSED_METHOD, arguments: arg) }

Second Bug
Function Line No:- 48
func showAD(_ call: FlutterMethodCall) -> Bool {
// You need to comment line no 56 in this function. because you wrote two time.it will cause error while displaying ads second time. because ad was not loaded.
}

Resolved full function

`func showAD(_ call: FlutterMethodCall) -> Bool {
if !self.interstitialAd.isAdValid {
print("FacebookAudienceNetworkInterstitialAdPlugin > showAD > not AdVaild")
return false
}
let args: NSDictionary = call.arguments as! NSDictionary
let delay: Int = args["delay"] as! Int
//MARK:- Need to remove because already called below using delay
//self.interstitialAd.show(fromRootViewController: UIApplication.shared.keyWindow?.rootViewController)

    print("@@@ delay %d", delay)
    
    if 0 < delay {
        let time = DispatchTime.now() + .seconds(delay)
        DispatchQueue.main.asyncAfter(deadline: time) {
            self.interstitialAd.show(fromRootViewController: UIApplication.shared.keyWindow?.rootViewController)
        }
    } else {
        self.interstitialAd.show(fromRootViewController: UIApplication.shared.keyWindow?.rootViewController)
    }
    return true
}`

Native banner for iOS

I tried adding native banner for iOS but not receiving any ads. Is this currently supported? Using v0.6.2

FacebookNativeAd(
                placementId: AdProvider.nativeBannerId,
                adType: NativeAdType.NATIVE_BANNER_AD,
                bannerAdSize: NativeBannerAdSize.HEIGHT_50,
                height: AdProvider.bannerHeight,
                width: double.infinity,
                backgroundColor: TGColors.adGray,
                titleColor: TGColors.gray,
                descriptionColor: TGColors.gray,
                buttonTitleColor: Colors.white,
                buttonColor: TGColors.darkBlue,
                buttonBorderColor: TGColors.darkBlue,
                expandAnimationDuraion: 200,
                keepExpandedWhileLoading: false,
              ),

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.