Skip to content

Instantly share code, notes, and snippets.

@tosik
Created January 2, 2013 11:23
Show Gist options
  • Select an option

  • Save tosik/4433928 to your computer and use it in GitHub Desktop.

Select an option

Save tosik/4433928 to your computer and use it in GitHub Desktop.
local notification by rubymotion
module Helper
module Notification
def setup(args)
time = args[:time]
text = args[:text]
opts = args[:opts]
UILocalNotification.alloc.init.tap do |notif|
notif.fireDate = NSDate.dateWithString( time.to_s )
notif.alertBody = text
notif.soundName = UILocalNotificationDefaultSoundName
notif.applicationIconBadgeNumber = 1
notif.userInfo = opts
UIApplication.sharedApplication.scheduleLocalNotification(notif)
end
end
module_function :setup
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment