flutter - Facebook Audience Network 和 Flutter facebook 广告在 fkutter 中不起作用
问题描述
我正在开发颤振的 facebook 受众网络库 [https://pub.dev/packages/facebook_audience_network]。一切都很好,但发布广告不起作用。卡在 Facebook 仪表板中的接收广告状态。
[main.dart]
void main(){
FacebookAudienceNetwork.init();
}
[view_screen.dart]
class FaceBookAdScreen extends StatefulWidget {
@override
_FaceBookAdScreenState createState() => _FaceBookAdScreenState();
}
class _FaceBookAdScreenState extends State<FaceBookAdScreen> {
@override
void initState() {
// TODO: implement initState
super.initState();
FacebookAudienceNetwork.init(
//testingId: "353da801-f840-4041-8610-10ca1ad1abe1", //optional
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('facebook ad'),
Container(
alignment: const Alignment(0.5, 1),
child: FacebookNativeAd(
placementId: '1088107105005052_1088109968338099',//'1088107105005052_1088109968338099',
adType: NativeAdType.NATIVE_AD,
height: 300,
backgroundColor: Colors.orange,
titleColor: Colors.white,
descriptionColor: Colors.white,
buttonColor: Colors.orange,
buttonTitleColor: Colors.white,
buttonBorderColor: Colors.white,
keepAlive: true, //set true if you do not want adview to refresh on widget rebuild
keepExpandedWhileLoading: false, // set false if you want to collapse the native ad view when the ad is loading
expandAnimationDuraion: 300, //in milliseconds. Expands the adview with animation when ad is loaded
listener: (result, value) {
print("Native Ad: $result --> $value");
},
),
)
],
),
);
}
}
测试版广告有效,但发布版无效。为什么?
解决方案
推荐阅读
- python - 包含列表python输出的html下拉列表
- android - AWS AppSync 错误 - 空对象引用上的 AWSMobileClientStore.get(String)
- gatsby - 如何通过 gatsby-transformer-asciidoc 从本地目录获取图像文件?
- python-3.x - 按日期分组到星期
- php - Docker配置虚拟域名错误,无法访问
- opendaylight - 醒酒器框架在 OpenDaylight Karaf shell 中无法按预期工作
- jquery - 自动完成选择名称并将 id 插入隐藏输入
- unit-testing - 在 Jest 中模拟模块时如何断言默认导出函数被调用?
- sql - 计算内部连接的所有记录
- php - 如何根据房间类型和时间用户输入显示房间可用性?我必须加入 2 张桌子