Class: Xiaomi::Push::Message::IOS
- Defined in:
- lib/xiaomi/push/services/messages/ios.rb
Overview
iOS 数据消息体
Instance Attribute Summary collapse
-
#badge ⇒ Integer
角标, 默认 1.
-
#body ⇒ String
描述(仅适用于 iOS 10 以上设备).
-
#category ⇒ String
iOS 8 以上可设置推送消息快速回复类别.
-
#description ⇒ String
描述(如果设置了 title 或 subtitle 将会启用变为 #body).
-
#image ⇒ String
图片地址(仅适用于 iOS 10 以上设备,填写后自动启用 mutable_content).
-
#mutable_content ⇒ Integer
可变内容,默认 nil 不启用.
-
#sound ⇒ String
声音,默认 default.
-
#subtitle ⇒ String
副标题(仅适用于 iOS 10 以上设备).
-
#title ⇒ String
标题(仅适用于 iOS 10 以上设备).
Attributes inherited from Base
#alias, #extras, #registration_id, #topic, #topic_op, #topics, #user_account
Instance Method Summary collapse
-
#initialize(**params) ⇒ IOS
constructor
A new instance of IOS.
Methods inherited from Base
#android?, #current, #extra, #ios10_struct, #ios10_struct?, #ios?, #to_params, #type
Constructor Details
#initialize(**params) ⇒ IOS
Returns a new instance of IOS.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 18 def initialize(**params) @title = params[:title] @subtitle = params[:subtitle] @description = params[:description] @body = params[:body] || @description @image = params[:image] @mutable_content = params[:mutable_content] @mutable_content = 1 if @image @badge = params[:badge] || 1 @sound = params[:sound] || 'default' @category = params[:category] @extras = params[:extras] || {} end |
Instance Attribute Details
#badge ⇒ Integer
角标, 默认 1
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def badge @badge end |
#body ⇒ String
描述(仅适用于 iOS 10 以上设备)
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def body @body end |
#category ⇒ String
iOS 8 以上可设置推送消息快速回复类别
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def category @category end |
#description ⇒ String
描述(如果设置了 title 或 subtitle 将会启用变为 #body)
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def description @description end |
#image ⇒ String
图片地址(仅适用于 iOS 10 以上设备,填写后自动启用 mutable_content)
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def image @image end |
#mutable_content ⇒ Integer
可变内容,默认 nil 不启用
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def mutable_content @mutable_content end |
#sound ⇒ String
声音,默认 default
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def sound @sound end |
#subtitle ⇒ String
副标题(仅适用于 iOS 10 以上设备)
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def subtitle @subtitle end |
#title ⇒ String
标题(仅适用于 iOS 10 以上设备)
14 15 16 |
# File 'lib/xiaomi/push/services/messages/ios.rb', line 14 def title @title end |