motion-takeoff 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -9
- data/lib/project/messages.rb +1 -1
- data/lib/project/reminders.rb +1 -1
- data/lib/project/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36d1a7021acb70fdd7682c051d70107226c7e281
|
4
|
+
data.tar.gz: c7c3c6a64a3e321561abbf624bf0e4439096717b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d34035e2141b19b6138e404ffbeec2e9510914430445fa320d8c8446d9d2db4f43ce02b5d52011c322d68f93a9b7696c8cf75263882d7bf57c084e84fe77d29f
|
7
|
+
data.tar.gz: 49a3f1c4bb2a7e9391c212dad2178ab2db7dabb32e279e8dd3b64a53b05f16033bbb30bc9566987f26a692743e480fbcf3f297e2ab003e7d20f65c8575eade2b
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# motion-takeoff
|
1
|
+
# motion-takeoff [![Build Status](https://travis-ci.org/MohawkApps/motion-takeoff.png)](https://travis-ci.org/MohawkApps/motion-takeoff) [![Code Climate](https://codeclimate.com/github/MohawkApps/motion-takeoff.png)](https://codeclimate.com/github/MohawkApps/motion-takeoff) [![Gem Version](https://badge.fury.io/rb/motion-takeoff.png)](http://badge.fury.io/rb/motion-takeoff)
|
2
2
|
|
3
|
-
A RubyMotion specific iOS gem that helps you do things at launch. Currently, there
|
3
|
+
A RubyMotion specific iOS gem that helps you do things at launch. Currently, there are two modules in this gem: `Messages` & `Reminders`.
|
4
4
|
|
5
5
|
The `Messages` module will allow you to schedule alerts to users at certain launch counts.
|
6
6
|
|
@@ -22,7 +22,7 @@ Open your app delegate and in your `applicationDidBecomeActive:` method do somet
|
|
22
22
|
|
23
23
|
```ruby
|
24
24
|
def applicationDidBecomeActive(application)
|
25
|
-
messages =
|
25
|
+
messages = Takeoff::Messages.new
|
26
26
|
messages.schedule launch:1, title:"Welcome to #{App.name}!", message:"Thanks for checking it out!"
|
27
27
|
messages.schedule launch:3, title:"Quick Tip:", message:"This is the 3rd time you've launched this application!"
|
28
28
|
messages.schedule launch:500, title:"Quick Tip:", message:"This is the 500th time you've launched this application!"
|
@@ -39,7 +39,7 @@ You should always reset all local notifications when your app becomes active:
|
|
39
39
|
|
40
40
|
```ruby
|
41
41
|
def applicationDidBecomeActive(application)
|
42
|
-
|
42
|
+
Takeoff::Reminders.reset
|
43
43
|
end
|
44
44
|
```
|
45
45
|
|
@@ -47,19 +47,19 @@ And here's how to set multiple reminders when your app enters the background:
|
|
47
47
|
|
48
48
|
```ruby
|
49
49
|
def applicationDidEnterBackground(application)
|
50
|
-
|
50
|
+
Takeoff::Reminders.schedule(
|
51
51
|
body: "Fires 20 seconds after the user closes your app.",
|
52
52
|
fire_date: 20 #seconds
|
53
53
|
)
|
54
54
|
|
55
|
-
|
55
|
+
Takeoff::Reminders.schedule(
|
56
56
|
body: "Fires 10 seconds later.",
|
57
57
|
fire_date: Time.now + 30 #Time object in the future
|
58
58
|
)
|
59
59
|
end
|
60
60
|
```
|
61
61
|
|
62
|
-
The `
|
62
|
+
The `Takeoff::Reminders.schedule` method takes a hash of options that are send to the `UILocalNotification`. `body` and `fire_date` are required and will raise an exception if you try to schedule a notification without those teo options. Here's all the default options:
|
63
63
|
|
64
64
|
```ruby
|
65
65
|
{
|
@@ -77,9 +77,9 @@ The `MotionTakeoff::Reminders.schedule` method takes a hash of options that are
|
|
77
77
|
}
|
78
78
|
```
|
79
79
|
|
80
|
-
You can read about what each of these does in
|
80
|
+
You can read about what each of these does in Apple's `UILocalNotification` Documentation, but I've implemented all of Apple's defaults that you can override if needed.
|
81
81
|
|
82
|
-
If you pass a `NSCalendarUnit` for the `repeat` option, we'll automatically assume you want to use `NSCalendar.currentCalendar` as the repeat calendar. Possible values of `repeat` are as found in the
|
82
|
+
If you pass a `NSCalendarUnit` for the `repeat` option, we'll automatically assume you want to use `NSCalendar.currentCalendar` as the repeat calendar. Possible values of `repeat` are as found in the `NSCalendarUnit` documentation.
|
83
83
|
|
84
84
|
## Future plans
|
85
85
|
|
@@ -92,3 +92,6 @@ I'd like it to be able to be a multi-purpose tool for doing things at launch oth
|
|
92
92
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
93
93
|
4. Push to the branch (`git push origin my-new-feature`)
|
94
94
|
5. Create new Pull Request
|
95
|
+
|
96
|
+
---
|
97
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/MohawkApps/motion-takeoff/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
data/lib/project/messages.rb
CHANGED
data/lib/project/reminders.rb
CHANGED
data/lib/project/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = '0.0.
|
1
|
+
module Takeoff
|
2
|
+
VERSION = '0.0.4'
|
3
3
|
end
|