开发者资源
Flutter Push 开发者资源
FLUTTER PUSH 功能
围绕通知生命周期构建
设备注册
- 连接推送接收者
- 处理配置错误
通知回调
- 响应通知点击
- 在您的应用内跳转
平台投递
- 配置原生通道
- 测试授权和应用状态
注册、接收与响应
注册、点击处理与接收者查询。精选官方 SDK API 的针对性代码片段。
注册
注册测试设备
完成平台配置和授权流程后,接入 Flutter 推送通知。
阅读文档push.dart
import 'package:tencent_cloud_chat_push/tencent_cloud_chat_push.dart';
void onNotificationClicked({
required String ext, String? userID, String? groupID,
}) {
// Validate ext before opening an authorized screen.
}
TencentCloudChatPush().registerPush(
onNotificationClicked: onNotificationClicked,
sdkAppId: sdkAppId,
appKey: pushClientKey,
apnsCertificateID: apnsCertificateID,
);处理点击
打开正确页面
跳转前验证通知载荷并检查账户访问权限。
阅读文档push.dart
void onNotificationClicked({
required String ext, String? userID, String? groupID,
}) {
// Validate ext and account access before navigation.
}
// Pass this callback to registerPush, as shown in Register.识别接收者
获取注册 ID
使用已注册的接收者进行受控的控制台或服务器测试。
阅读文档push.dart
// Retrieve the recipient after registration succeeds.
TencentCloudChatPush().getRegistrationID();开始使用
逐步发送您的第一条通知
- 01
- 02
- 03
Flutter Push SDK
终端
flutter pub add tencent_cloud_chat_pushpush.dart
import 'package:tencent_cloud_chat_push/tencent_cloud_chat_push.dart';
void onNotificationClicked({
required String ext, String? userID, String? groupID,
}) {
// Validate ext before opening an authorized screen.
}
TencentCloudChatPush().registerPush(
onNotificationClicked: onNotificationClicked,
sdkAppId: sdkAppId,
appKey: pushClientKey,
apnsCertificateID: apnsCertificateID,
);Flutter 推送通知 常见问题
如何为应用添加 Flutter 推送通知?
除 Dart 包外,还需完成原生 Android application 和 iOS delegate 配置。配置 APNs 及使用的 Android 投递通道,然后在真实设备上测试。
这些代码片段是完整应用吗?
这些是针对性的集成节选。请按完整指南补充包导入、原生项目配置、生命周期处理与错误行为。VERSION 表示您选择的版本,不是字面上的包版本号。
应用关闭时通知还能送达吗?
受支持的离线通道可以投递通知,但受操作系统策略、授权、网络条件及设备设置影响。请测试实际支持的设备与应用状态。
Flutter 推送通知如何发送给正确的用户?
注册设备并获取注册 ID,在后端维护接收者与账户的关联。用户切换时更新关联,打开目标页面时验证访问权限。
Flutter 推送通知费用是多少?
App Push 提供免费和付费套餐,包含的 MAU、队列与功能各不相同。选择生产套餐前,请查看当前套餐及超额计费规则。
如何用 Dart 集成 Flutter 推送通知?
安装文档指定的 Flutter 包,并完成每个目标平台的原生项目配置。结合底层 iOS 与 Android 行为测试 widget 生命周期。
发布应用前如何测试 Flutter 推送通知?
在前台、后台与已终止状态下测试接收者注册及通知点击回调。
如何自定义 Flutter 推送通知界面?
处理文档说明的通知载荷与点击回调。应用负责验证目标页面访问权限,并控制打开的页面。

