Permalink
Browse files

convert aliases in push payload to strings

  • Loading branch information...
1 parent 5f1e45f commit 92c74597202e318d57b5e4cee73348e19dd22add Joey Schoblaska committed Mar 18, 2013
Showing with 6 additions and 0 deletions.
  1. +1 −0 lib/urbanairship.rb
  2. +5 −0 spec/urbanairship_spec.rb
View
@@ -151,6 +151,7 @@ def parse_register_options(hash = {})
end
def parse_push_options(hash = {})
+ hash[:aliases] = hash[:aliases].map{|a| a.to_s} unless hash[:aliases].nil?
hash[:schedule_for] = hash[:schedule_for].map{|elem| process_scheduled_elem(elem)} unless hash[:schedule_for].nil?
hash
end
@@ -552,6 +552,11 @@
subject.master_secret = "my_master_secret2"
subject.push.success?.should == false
end
+
+ it "converts aliases to strints" do
+ subject.push(@valid_params.merge(:aliases => [:one, 2]))
+ request_json['aliases'].should == ['one', '2']
+ end
end
describe "::push_to_segment" do

4 comments on commit 92c7459

Contributor

rromanchuk commented on 92c7459 Mar 18, 2013

sweet, i think this will cause a lot less potential headaches. It's less common with device tokens as they are obvious strings, but i know it's pretty common to bind alias <-> resource id so this will help a lot. 👍

strints!

Contributor

joeyschoblaska replied Mar 20, 2013

You don't know about strints??

772828b

Contributor

rromanchuk replied Mar 20, 2013

I hate getting shin strints 👎

Please sign in to comment.