Class: Xiaomi::Push::Message::Android
- Defined in:
- lib/xiaomi/push/services/messages/android.rb
Overview
Android 消息数据体
Instance Attribute Summary collapse
-
#badge ⇒ String
角标, 默认 1.
-
#description ⇒ String
描述.
-
#notify_id ⇒ Integer
提醒,默认情况下,通知栏只显示一条推送消息。如果通知栏要显示多条推送消息,需要针对不同的消息设置不同的 notify_id.
-
#notify_type ⇒ String
提醒类型,取值 DEFAULT_ALL(默认)/DEFAULT_SOUND(提示音)/DEFAULT_VIBRATE(振动)/DEFAULT_LIGHTS(指示灯).
-
#pass_through ⇒ String
是否为穿透, 取值 0(默认,通知栏消息)/1(穿透).
-
#sound ⇒ String
声音,默认 default.
-
#title ⇒ String
标题.
Attributes inherited from Base
#alias, #extras, #registration_id, #topic, #topic_op, #topics, #user_account
Instance Method Summary collapse
-
#initialize(**params) ⇒ Android
constructor
A new instance of Android.
Methods inherited from Base
#android?, #current, #extra, #ios10_struct, #ios10_struct?, #ios?, #to_params, #type
Constructor Details
#initialize(**params) ⇒ Android
Returns a new instance of Android.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/xiaomi/push/services/messages/android.rb', line 16 def initialize(**params) @title = params[:title] @description = params[:description] @badge = params[:badge] || 1 @sound = params[:sound] || 'default' @pass_through = params[:pass_through] || 0 @notify_type = params[:notify_type] || 'DEFAULT_ALL' @notify_id = params[:notify_id] @extras = params[:extras] || {} end |
Instance Attribute Details
#badge ⇒ String
角标, 默认 1
13 14 15 |
# File 'lib/xiaomi/push/services/messages/android.rb', line 13 def badge @badge end |
#description ⇒ String
描述
13 14 15 |
# File 'lib/xiaomi/push/services/messages/android.rb', line 13 def description @description end |
#notify_id ⇒ Integer
提醒,默认情况下,通知栏只显示一条推送消息。如果通知栏要显示多条推送消息,需要针对不同的消息设置不同的 notify_id
13 14 15 |
# File 'lib/xiaomi/push/services/messages/android.rb', line 13 def notify_id @notify_id end |
#notify_type ⇒ String
提醒类型,取值 DEFAULT_ALL(默认)/DEFAULT_SOUND(提示音)/DEFAULT_VIBRATE(振动)/DEFAULT_LIGHTS(指示灯)
13 14 15 |
# File 'lib/xiaomi/push/services/messages/android.rb', line 13 def notify_type @notify_type end |
#pass_through ⇒ String
是否为穿透, 取值 0(默认,通知栏消息)/1(穿透)
13 14 15 |
# File 'lib/xiaomi/push/services/messages/android.rb', line 13 def pass_through @pass_through end |
#sound ⇒ String
声音,默认 default
13 14 15 |
# File 'lib/xiaomi/push/services/messages/android.rb', line 13 def sound @sound end |
#title ⇒ String
标题
13 14 15 |
# File 'lib/xiaomi/push/services/messages/android.rb', line 13 def title @title end |