Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当应用程序处于后台时,Xamarin iOS通知显示NotificationHub而不调用DidReceiveMemoteNotification_Ios_Xamarin_Push Notification_Azure Notificationhub - Fatal编程技术网

当应用程序处于后台时,Xamarin iOS通知显示NotificationHub而不调用DidReceiveMemoteNotification

当应用程序处于后台时,Xamarin iOS通知显示NotificationHub而不调用DidReceiveMemoteNotification,ios,xamarin,push-notification,azure-notificationhub,Ios,Xamarin,Push Notification,Azure Notificationhub,我正在用xamarin创建一个应用程序,使用通知中心发送通知 当应用程序位于前台时,我可以通过在WillPresentNotification方法中实现UnuseNotificationCenterDelegate来处理通知,并显示正确的标题和其他数据 当应用程序处于backgorund或inactive状态时,通知将显示,而不通过任何方法,因此我无法格式化它 我已经尝试添加“content available”(内容可用)作为参数,结果是首先显示格式不正确的普通通知,然后触发DidReceiv

我正在用xamarin创建一个应用程序,使用通知中心发送通知

当应用程序位于前台时,我可以通过在WillPresentNotification方法中实现UnuseNotificationCenterDelegate来处理通知,并显示正确的标题和其他数据

当应用程序处于backgorund或inactive状态时,通知将显示,而不通过任何方法,因此我无法格式化它


我已经尝试添加“content available”(内容可用)作为参数,结果是首先显示格式不正确的普通通知,然后触发DidReceiveMemoteNotification,并发出另一个通知,使用正确的格式显示

iOS根据应用程序是在前台还是后台处理通知的方式不同

前台应用程序: 通过
DidReceiveRemoteNotification
运行

后台应用程序: 不会立即通过DidReceiveRemoteNotification运行。操作系统生成并显示通知。选择通知后,应用程序将通过DidReceiveRemoteNotification运行


请参见

谢谢,我现在明白了,您知道有没有办法拦截或停止自动显示?现在,我正在尝试根据您链接的文档使用静默通知,但也许有更好的方法听起来像您想要的。这是一个通知,仅用于您的应用程序处理,不会向用户显示。