从 iOS 15 开始,我注意到越来越多的聊天应用程序以新的方式发送推送通知。该图像不是在右侧显示带有方形个人资料图片的常规通知,而是在左侧显示为圆形,替换了应用图标,并且应用图标位于图像的右下角。\n
\n我首先在消息中注意到这一点,并认为这只是苹果可以做的事情,但现在 Snapchat 和 WhatsApp 也有这些通知。今天,TikTok 表示以同样的方式发送通知,我\xe2\x80\x99m 决定找出如何在我的应用程序中做到这一点。尽管我看过一些关于具有这些通知的应用程序的文章,但我还没有找到任何有关如何实现它们的信息。这是某些应用程序独有的吗?另外,如果这适用于所有应用程序,是否有办法通过 Firebase Cloud Messaging 发送这些内容?
我记得过去曾经遇到过这个问题,但不记得我是如何解决的。我有一个相当简单的功能来允许用户更新他们的个人资料图片,但第一步失败了final XFile? image = await ImagePicker().pickImage(source: ImageSource.gallery);
这是第一个错误:
2022-08-13 13:21:44.215616+0300 Runner[3940:211672] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)""
2022-08-13 13:21:44.230196+0300 Runner[3940:211673] [PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x2806da5b0> accessor:<<PAApplication 0x282ab0500 identifierType:auditToken identifier:{pid:3940, version:11538}>> identifier:EF438868-FF12-4741-9ACF-88D57992D9BE kind:intervalEnd timestampAdjustment:0 tccService:kTCCServicePhotos, error=Error Domain=PAErrorDomain Code=10 "Possibly incomplete access interval automatically ended by daemon"
Run Code Online (Sandbox Code Playgroud)
iOS 中此包所需的唯一设置是在我已完成的 info.plist 文件中添加权限。这也是该函数在 pub 包中的显示方式,因此它没有理由不工作。下面我将显示的错误意味着我正在使用maxWidth、maxHeight、 或尝试压缩图像,但我没有使用任何这些参数。图像文件似乎也被称为null,这就是为什么我认为上述错误是问题所在。我见过的任何其他类似问题都没有答案,大多数都在使用这些参数。我很欣赏任何想法。
错误2:
2022-08-13 13:21:44.243912+0300 Runner[3940:211261] image_picker: compressing is not supported for type (null). Returning the …Run Code Online (Sandbox Code Playgroud) 由于 Flutter 中没有实现 AdSense 的包,所以我决定创建一个本地插件。这非常简单,小部件是一个IFrameElement. 我确保在创建插件时指定它仅支持 Web,因为IFrameElement需要import 'dart:html',但每当我尝试编译/构建移动版本时,它都会失败,因为它尝试将插件与dart:html. 我怎样才能解决这个问题?
插入:
import 'dart:html' as html show window;
import 'dart:html';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'adsense_platform_interface.dart';
/// A web implementation of the AdsensePlatform of the Adsense plugin.
class AdsenseWeb extends AdsensePlatform {
/// Constructs a AdsenseWeb
AdsenseWeb();
static void registerWith(Registrar registrar) {
AdsensePlatform.instance = AdsenseWeb();
}
Widget adsenseAdsView(double width, double height) {
ui.platformViewRegistry.registerViewFactory(
'adViewBlock',
(int viewID) => IFrameElement()
..width = …Run Code Online (Sandbox Code Playgroud) dart-html flutter flutter-plugin flutter-platform-channel flutter-html