motion-addressbook 1.7.4 → 1.7.5
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 +4 -4
- data/README.md +8 -0
- data/Rakefile +1 -0
- data/lib/motion-addressbook/version.rb +1 -1
- data/motion/address_book.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 245022260d7bb162f617c0b12e8a24375841c7a4
|
|
4
|
+
data.tar.gz: 49991f863cd0ccccf606600db146834539ca816e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4379938eb4368e7682a774a4974c6a0e8a0315a88eea27826b8a83faf90e8c26da8f9f826f51f06250713db27f5b6b6549da76ecfc704774a81b11986207b764
|
|
7
|
+
data.tar.gz: 0b636c2ba64fe8185748c2e6a7439fc3c343456c80657d4133ca97a91b3b04dc2b445a06bf252c63958edea975630fc7c2a5cd8ec433a77fb7235b074028dcc8
|
data/README.md
CHANGED
|
@@ -75,6 +75,14 @@ else
|
|
|
75
75
|
end
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
** NOTE **
|
|
79
|
+
|
|
80
|
+
The API which is used in `AddressBook.request_authorization` is deprecated at iOS 10 and causes a crash.
|
|
81
|
+
Please insert `app.info_plist['NSContactsUsageDescription']` in your Rakefile for authorization instead of using `AddressBook.request_authorization`.
|
|
82
|
+
```
|
|
83
|
+
app.info_plist['NSContactsUsageDescription'] = 'Specifies the reason for your app to access the user’s contacts.'
|
|
84
|
+
```
|
|
85
|
+
|
|
78
86
|
3 - Manually ask the user but do it asynchronously (this is how Apple's API works)
|
|
79
87
|
|
|
80
88
|
```ruby
|
data/Rakefile
CHANGED
|
@@ -13,6 +13,7 @@ Bundler.require
|
|
|
13
13
|
Motion::Project::App.setup do |app|
|
|
14
14
|
# Use `rake config' to see complete project settings.
|
|
15
15
|
app.name = 'AddressBook'
|
|
16
|
+
app.info_plist['NSContactsUsageDescription'] = 'AddressBook will be used for test'
|
|
16
17
|
|
|
17
18
|
if ENV['osx']
|
|
18
19
|
app.specs_dir = "./spec/osx"
|
data/motion/address_book.rb
CHANGED
|
@@ -5,7 +5,8 @@ module AddressBook
|
|
|
5
5
|
if Kernel.const_defined?(:NSApplication)
|
|
6
6
|
ABAddressBook.addressBook
|
|
7
7
|
else # iOS
|
|
8
|
-
|
|
8
|
+
version = UIDevice.currentDevice.systemVersion.to_f
|
|
9
|
+
if version < 6.0
|
|
9
10
|
ios5_create
|
|
10
11
|
else
|
|
11
12
|
ios6_create
|
|
@@ -65,7 +66,8 @@ module AddressBook
|
|
|
65
66
|
end
|
|
66
67
|
|
|
67
68
|
def authorization_status
|
|
68
|
-
|
|
69
|
+
version = UIDevice.currentDevice.systemVersion.to_f
|
|
70
|
+
return :authorized unless version >= 6.0
|
|
69
71
|
|
|
70
72
|
status_map = { KABAuthorizationStatusNotDetermined => :not_determined,
|
|
71
73
|
KABAuthorizationStatusRestricted => :restricted,
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: motion-addressbook
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Rothenberg
|
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
102
102
|
version: '0'
|
|
103
103
|
requirements: []
|
|
104
104
|
rubyforge_project:
|
|
105
|
-
rubygems_version: 2.
|
|
105
|
+
rubygems_version: 2.5.1
|
|
106
106
|
signing_key:
|
|
107
107
|
specification_version: 4
|
|
108
108
|
summary: A RubyMotion wrapper around the iOS & OSX Address Book frameworks
|