Wat is the difference between static notification and dynamic notification?

被刻印的时光 ゝ 提交于 2019-12-23 10:49:37

问题


Wat is the difference between static notification and dynamic notification? could anyone help me


回答1:


Notifications come in 2 flavours Short and Long (as per iOS 8.2). The Long ones can be Static or Dynamic. All of them have a system "Dismiss" button.

Short You can't customise these at all. They show your app logo, the title of the notification payload and your app name.

Long - Static You can customise these on the Storyboard. You can't add buttons directly on the Storyboard but you can have them if defined properly on the Notification payload (.apns file). You can add images if they are in the bundle only.

Long - Dynamic Everything Static ones can do but you have here the chance to update the UI elements with new data not coming on the Notification payload or even update the UI elements like graphics from the hosted app (maybe a map screenshot). Again, you can't put buttons from the Storyboard but you can have them if defined on the Notification payload. Try to avoid using these if you can do what you want with Static ones as the Watch will default to Static ones in some cases (low battery...)




回答2:


WatchKit notifications come in two forms:

Static UI
A default notification interface native to WatchKit. Primarily shown if an iOS application doesn't have a WatchKit application. These allow all notifications from iOS to appear on Apple Watch from day 1 without extra effort. Their UI is very stock standard and minimal, hence static.

Dynamic UI
WatchKit applications allow developers to create dynamic notification interfaces at design-time in Xcode. They're dynamic because you have the ability to present a unique UI to your user based on the contents of the notification, such as images.

Although WatchKit does fall back to a static UI in certain cases if needed (watch disconnects from phone or internet).

This Getting Started With WatchKit video goes into greater detail, I highly recommend it. And the relevant section in Apple's WatchKit Programming Guide.




回答3:


Static notification you can simple think it like a backup stage for you. Incase of your app don't have a dynamic notification of your dynamic notification take too long to load, the apple watch will load the static notification to show the information to users.



来源:https://stackoverflow.com/questions/28381491/wat-is-the-difference-between-static-notification-and-dynamic-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!