如何避免此错误:“显示自定义通知的时间太长.回到静态."? [英] How to avoid this error: "Took too long to show custom notification. Falling back to static."?

查看:17
本文介绍了如何避免此错误:“显示自定义通知的时间太长.回到静态."?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Apple Watch 模拟器上测试自定义长查看通知时遇到问题.调试器记录此错误:

Having issues testing out the custom long look notification on the apple watch simulator. The debugger log this error:

WatchKit Extension[5230:156324] Took too long to show custom notification. Falling back to static.

如何解决这个问题?

推荐答案

我在 Xcode 设置的默认代码中遇到了这个问题.我在didReceiveRemoteNotification里面没有做任何操作,但是还是出现了错误.

I had exactly this problem with the default code set up by Xcode. I didn't do any operations inside didReceiveRemoteNotification, but the error still occured.

原来它失败的原因是我的 WKUserNotificationInterfaceController 子类没有连接到我的故事板文件中的动态接口控制器.

Turns out the reason it failed was that my WKUserNotificationInterfaceController subclass was not connected to the Dynamic interface Controller in my storyboard file.

解决方案:

  1. 转到 watchkit 应用的故事板文件.
  2. 点击您的动态界面控制器
  3. 单击身份检查器(右侧窗格中的中间选项卡)
  4. 在类"字段中,选择您的WKUserNotificationInterfaceController 子类(xcode 已经命名我的通知控制器)
  5. 瞧!

这篇关于如何避免此错误:“显示自定义通知的时间太长.回到静态."?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆