更新的上下文:
\n当我尝试运行 flutter 项目时,但出现此错误\nError: To set up CocoaPods for ARM macOS, run: arch -x86_64 sudo gem install ffi
我会跑arch -x86_64 sudo gem install ffi
,但仍然遇到同样的问题。
这是信息
\nyomate@Mac-mini yomate % sudo gem install ffi\n/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /Users/yomate/FlutterDev/flutter/bin in PATH, mode 040777\nBuilding native extensions. This could take a while...\nSuccessfully installed ffi-1.15.5\nParsing documentation for ffi-1.15.5\nDone installing documentation for ffi after 3 seconds\n1 gem installed\n
Run Code Online (Sandbox Code Playgroud)\n如何解决这个问题呢?arch: posix_spawnp: gem: 可执行文件中的 CPU 类型错误,环境:Mini M1
\n当我想使用这个推荐时 …
如何解决这个问题呢?Error (Xcode): Framework not found Flutter
我尝试了更多方法,
\n尝试删除 ios 然后 pod install...
\n试图扑干净...
\n尝试创建新项目等。
\n但还是无法解决。
\nLaunching lib/main.dart on iPhone 13 Pro Max in debug mode...\n/Users/pin-chientseng/Desktop/yomate/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 56 / JSON error:\nJSON text did not start with array or object and option to allow fragments not set. around line 1, column 0.\nXcode build done. 221.1s\nFailed to build iOS app\nError output from Xcode build:\n\xe2\x86\xb3\n ** BUILD FAILED **\n\n\nXcode\'s …
Run Code Online (Sandbox Code Playgroud) 如何解决这个问题呢?
ArgumentError (Invalid argument(s): iOS settings must be set when targeting iOS platform.)
我已经添加了通知,但是当我运行 iOS 模拟器时出现此错误How can solve this issues? ArgumentError (Invalid argument(s): iOS settings must be set when targeting iOS platform.)
但它可以在真实设备上运行,只是不能在iOS模拟器上运行
iOS上使用flutter开发时收不到firebase的通知
我已授予许可并使用邮递员进行测试。
首先,我会得到令牌
Restarted application in 516ms.
flutter: User granted permission
flutter: This token is eWQJLcN1zEQ_rQ79sBqXI6:APA91bHMnuhkPaf8JpcTbLQavxqq5erUIeRTQYPv9NAhsdfasdfasdaDSA0BTXgVb2RseAmUsi5uAa5SDvGWA7wgIcWPP5xDqTyo4s3xEdWkhHoQc77G59GGZptafaxNIW5QG
Run Code Online (Sandbox Code Playgroud)
Secode:当我去postman测试时,我获得了成功
{
"multicast_id": 2305740741419558081,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:1654957148235526%2734e82c2734e82c"
}
]
}
Run Code Online (Sandbox Code Playgroud)
但我仍然没有收到任何通知。
哪里有问题?
这是代码。
late int _totalNotifications;
late final FirebaseMessaging _messaging;
PushNotification? _notificationInfo;
void requestAndRegisterNotification() async {
await Firebase.initializeApp();
_messaging = FirebaseMessaging.instance;
FirebaseMessaging.onBackgroundMessage(_firebaseMessageingBackgroundHandler);
NotificationSettings settings = await _messaging.requestPermission(
alert: true,
badge: true,
provisional: false,
sound: true,
);
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
print('User granted permission');
String? token …
Run Code Online (Sandbox Code Playgroud) firebase flutter firebase-notifications flutter-notification