igetui-ruby 0.0.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a319bd46f4da1cc9a7f7353fafa089593d4bbcc
4
- data.tar.gz: bdbec6bddecbac031c233557805ebc07895b8c61
3
+ metadata.gz: 36d4390425acfa869397afb9cdbaa54759d946e1
4
+ data.tar.gz: 90e45aeaf78646e6fa5436cb0c8bef1e5f0ac877
5
5
  SHA512:
6
- metadata.gz: 990a289e47e41c0e2b7b67823ffa5f393b55c04193f0e7cb64bc84fea6a4dbfe9b09ec82ce27ca258dbd4df22454dd0ecd2c42f587e2aaf24d6e5aa0c2491308
7
- data.tar.gz: 1594b11228b9d46a888ca3da086c58c0ce387a69cbe510cdce0e8400c50f7ec5a10ddbb0eff72ecbfdda810eb821fef6dd3db27a2ff777855f65fd7d854589da
6
+ metadata.gz: 61b61636144609df5b6b71b9f13d384289597d6d85efbbb7dde38a97040a0298647f11501afcb85a66a258c990d4bc9bb3d972b68f7fb864caff595f9ef5abf9
7
+ data.tar.gz: 223d8af20626ee9f587a68581450232df706033ee54a899c193eec9b6fbdd0a7ef446e8e01aa15d40baf22b414193b2cd42aa48a72aeb20a66bad298b78b2a38
@@ -2,3 +2,4 @@ require 'igetui/template/base_template'
2
2
  require 'igetui/template/transmission_template'
3
3
  require 'igetui/template/link_template'
4
4
  require 'igetui/template/notification_template'
5
+ require 'igetui/template/noty_pop_load_template'
@@ -12,7 +12,7 @@ module IGeTui
12
12
  @transmission_content = ''
13
13
  @is_ring = true
14
14
  @is_vibrate = true
15
- @is_clearable = false
15
+ @is_clearable = true
16
16
  super
17
17
  end
18
18
 
@@ -12,7 +12,7 @@ module IGeTui
12
12
  @transmission_content = ''
13
13
  @is_ring = true
14
14
  @is_vibrate = true
15
- @is_clearable = false
15
+ @is_clearable = true
16
16
  super
17
17
  end
18
18
 
@@ -0,0 +1,100 @@
1
+ module IGeTui
2
+ class NotyPopLoadTemplate < BaseTemplate
3
+ attr_accessor :title, :text, :logo, :logo_url
4
+ attr_accessor :is_ring, :is_vibrate, :is_clearable
5
+ attr_accessor :pop_title, :pop_text, :pop_image
6
+ attr_accessor :pop_button_1, :pop_button_2
7
+ attr_accessor :load_icon, :load_title, :load_url
8
+ attr_accessor :is_auto_install, :is_active
9
+
10
+ def initialize
11
+ @title = ''
12
+ @text = ''
13
+ @logo = ''
14
+ @logo_url = ''
15
+ @pop_title = ''
16
+ @pop_text = ''
17
+ @pop_image = ''
18
+ @pop_button_1 = ''
19
+ @pop_button_2 = ''
20
+ @load_icon = ''
21
+ @load_title = ''
22
+ @load_url = ''
23
+ @transmission_type = 0
24
+ @transmission_content = ''
25
+ @is_ring = true
26
+ @is_vibrate = true
27
+ @is_clearable = true
28
+ @is_auto_install = false
29
+ @is_active = false
30
+ super
31
+ end
32
+
33
+ def get_action_chain
34
+ # set actionchain
35
+ action_chain_1 = GtReq::ActionChain.new
36
+ action_chain_1.actionId = 1
37
+ action_chain_1.type = GtReq::ActionChain::Type::Goto
38
+ action_chain_1.next = 10000
39
+
40
+ # notification
41
+ action_chain_2 = GtReq::ActionChain.new
42
+ action_chain_2.actionId = 10000
43
+ action_chain_2.type = GtReq::ActionChain::Type::Notification
44
+ action_chain_2.title = title
45
+ action_chain_2.text = text
46
+ action_chain_2.logo = logo
47
+ action_chain_2.logoURL = logo_url
48
+ action_chain_2.ring = is_ring
49
+ action_chain_2.clearable = is_clearable
50
+ action_chain_2.buzz = is_vibrate
51
+ action_chain_2.next = 10010
52
+
53
+ # goto
54
+ action_chain_3 = GtReq::ActionChain.new
55
+ action_chain_3.actionId = 10010
56
+ action_chain_3.type = GtReq::ActionChain::Type::Goto
57
+ action_chain_3.next = 10020
58
+
59
+ action_chain_4 = GtReq::ActionChain.new
60
+
61
+ button_1 = GtReq::Button.new
62
+ button_1.text = pop_button_1
63
+ button_1.next = 10040
64
+ button_2 = GtReq::Button.new
65
+ button_2.text = pop_button_2
66
+ button_2.next = 100
67
+
68
+ action_chain_4.actionId = 10020
69
+ action_chain_4.type = GtReq::ActionChain::Type::Popup
70
+ action_chain_4.title = pop_title
71
+ action_chain_4.text = pop_text
72
+ action_chain_4.img = pop_image
73
+ action_chain_4.buttons = [button_1, button_2]
74
+ action_chain_4.next = 6
75
+
76
+ app_start_up = GtReq::AppStartUp.new(android: '', symbia: '', ios: '')
77
+ action_chain_5 = GtReq::ActionChain.new
78
+ action_chain_5.actionId = 10040
79
+ action_chain_5.type = GtReq::ActionChain::Type::Appdownload
80
+ action_chain_5.name = load_title
81
+ action_chain_5.url = load_url
82
+ action_chain_5.logo = load_icon
83
+ action_chain_5.autoInstall = is_auto_install
84
+ action_chain_5.autostart = is_active
85
+ action_chain_5.appstartupid = app_start_up
86
+ action_chain_5.next = 6
87
+
88
+ # end
89
+ action_chain_6 = GtReq::ActionChain.new
90
+ action_chain_6.actionId = 100
91
+ action_chain_6.type = GtReq::ActionChain::Type::Eoa
92
+
93
+ [action_chain_1, action_chain_2, action_chain_3, action_chain_4, action_chain_5, action_chain_6]
94
+ end
95
+
96
+ def get_push_type
97
+ "NotyPopLoadMsg"
98
+ end
99
+ end
100
+ end
@@ -1,3 +1,3 @@
1
1
  module IGeTui
2
- VERSION = "0.0.2"
2
+ VERSION = "1.0.0"
3
3
  end
data/test/pusher_test.rb CHANGED
@@ -21,6 +21,13 @@ class PusherTest < MiniTest::Unit::TestCase
21
21
  assert_equal ret["result"], "Online"
22
22
  end
23
23
 
24
+ def test_to_single_noty_pop_load
25
+ single_message = IGeTui::SingleMessage.new
26
+ single_message.data = noty_pop_load_template
27
+ ret = @pusher.push_message_to_single(single_message, @client_1)
28
+ assert_equal ret["result"], "ok"
29
+ end
30
+
24
31
  def test_to_single_notification
25
32
  single_message = IGeTui::SingleMessage.new
26
33
  single_message.data = notification_template
@@ -98,4 +105,19 @@ class PusherTest < MiniTest::Unit::TestCase
98
105
  template
99
106
  end
100
107
 
108
+ # attr_accessor :load_icon, :load_title, :load_url
109
+ def noty_pop_load_template
110
+ template = IGeTui::NotyPopLoadTemplate.new
111
+ set_template_base_info(template)
112
+ template.pop_title = "弹框标题"
113
+ template.pop_text = "弹框内容"
114
+ template.pop_image = ""
115
+ template.pop_button_1 = "下载"
116
+ template.pop_button_2 = "取消"
117
+ template.load_icon = "file://icon.png"
118
+ template.load_title = "下载内容"
119
+ template.load_url = "http://gdown.baidu.com/data/wisegame/c95836e06c224f51/weixinxinqing_5.apk"
120
+ template
121
+ end
122
+
101
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: igetui-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Wang
@@ -127,6 +127,7 @@ files:
127
127
  - lib/igetui/template/base_template.rb
128
128
  - lib/igetui/template/link_template.rb
129
129
  - lib/igetui/template/notification_template.rb
130
+ - lib/igetui/template/noty_pop_load_template.rb
130
131
  - lib/igetui/template/transmission_template.rb
131
132
  - lib/igetui/validate.rb
132
133
  - lib/igetui/version.rb