Class: UnderOs::Sharing::Instagram
- Inherits:
-
UIActivity
- Object
- UIActivity
- UnderOs::Sharing::Instagram
- Defined in:
- lib/under_os/receivers/instagram.rb
Instance Method Summary collapse
- #activityImage ⇒ Object
- #activityTitle ⇒ Object
- #activityType ⇒ Object
- #canPerformWithActivityItems(items) ⇒ Object
- #performActivity ⇒ Object
- #prepareWithActivityItems(items) ⇒ Object
Instance Method Details
#activityImage ⇒ Object
12 13 14 |
# File 'lib/under_os/receivers/instagram.rb', line 12 def activityImage UIImage.imageNamed("instagram.png") end |
#activityTitle ⇒ Object
8 9 10 |
# File 'lib/under_os/receivers/instagram.rb', line 8 def activityTitle "Instagram" end |
#activityType ⇒ Object
4 5 6 |
# File 'lib/under_os/receivers/instagram.rb', line 4 def activityType "com.under-os.share.instagram" end |
#canPerformWithActivityItems(items) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/under_os/receivers/instagram.rb', line 16 def canPerformWithActivityItems(items) instagram_installed? && items.each do |item| if item_is_large_enough_image?(item) return true end end false end |
#performActivity ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/under_os/receivers/instagram.rb', line 33 def performActivity return activityDidFinish(false) if ! @image_url @image_title = {"InstagramCaption" => @image_title} if @image_title @interaction = UnderOs::Sharing::Interaction.new("com.instagram.exclusivegram") @interaction.open @image_url, @image_title do |result| activityDidFinish result end end |
#prepareWithActivityItems(items) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/under_os/receivers/instagram.rb', line 26 def prepareWithActivityItems(items) items.each do |item| @image_title = item if item.is_a?(String) @image_url = save(item) if item.is_a?(UIImage) end end |