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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e8cc5964dc93254dd6daa37e210928a6ee4b881
4
- data.tar.gz: fa6ba42ab41a6b365185aca1e30517791639bebd
3
+ metadata.gz: 245022260d7bb162f617c0b12e8a24375841c7a4
4
+ data.tar.gz: 49991f863cd0ccccf606600db146834539ca816e
5
5
  SHA512:
6
- metadata.gz: 8bbc20f804a6de90d9b79b93f6421c58d5dbb32de68454465e8da3ba7fb6a7dd0fbcbaa04190d5bba855d5f0c21666340e150a36829e5befa30df40c41bdbb91
7
- data.tar.gz: a65a9af3fe0b5a258d4dcf5643076637654f6bafea5b57db0b98336e6163ea03c4a1d5901ee1fc930aecb510fdb6cfac5a79617cb43e531e0e0f125832a95a0b
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"
@@ -1,5 +1,5 @@
1
1
  module Motion
2
2
  module Addressbook
3
- VERSION = "1.7.4"
3
+ VERSION = "1.7.5"
4
4
  end
5
5
  end
@@ -5,7 +5,8 @@ module AddressBook
5
5
  if Kernel.const_defined?(:NSApplication)
6
6
  ABAddressBook.addressBook
7
7
  else # iOS
8
- if UIDevice.currentDevice.systemVersion =~ /5/
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
- return :authorized unless UIDevice.currentDevice.systemVersion >= '6'
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
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.4.3
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