是否可以在没有iPhone应用程序的情况下测试Apple推送通知服务?(在Windows上创建模拟器?)
如果不是,我该怎么测试呢?是否有编译的免费样本应用程序?
我创建了服务器提供程序,但我需要测试functionallity.
最近苹果也在模拟器中添加了推送通知。模拟器中未收到我现有的应用程序通知。
如何在模拟器中模拟推送通知?
模拟器支持模拟远程推送通知,包括后台内容获取通知。
参考:https ://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_beta_release_notes
你好颤振新手在这里!我正在使用颤振本地通知并将默认代码添加到我的应用程序中。它适用于Android,但不适用于iOS。知道为什么吗?
我尝试了 iPhone 8 和 iPhone 11 的 iOS 模拟器。它适用于我的 Pixel 3 API 29 android 模拟器。
我还为此应用程序启用了 iOS 中的通知(设置>此应用程序>通知)并授予权限。
对于 Android,我在 AndroidManifest.xml 中添加了权限请求。
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
class AppNotification extends StatefulWidget {
static const String id = 'app_notification';
@override
_AppNotificationState createState() => _AppNotificationState();
}
class _AppNotificationState extends State<AppNotification> {
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
@override
void initState() {
super.initState();
flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
var android = AndroidInitializationSettings('app_icon');
var iOS = IOSInitializationSettings();
var initSettings = InitializationSettings(android, iOS);
flutterLocalNotificationsPlugin.initialize(initSettings,
onSelectNotification: onSelectNotification);
}
Future onSelectNotification(String payload) async …Run Code Online (Sandbox Code Playgroud)