Skip to content

Commit 775268e

Browse files
author
Yuuki Nishiyama
committed
first commit
1 parent ad9f6a5 commit 775268e

10 files changed

Lines changed: 739 additions & 36 deletions

File tree

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ Carthage/Build
3434
# Note: if you ignore the Pods directory, make sure to uncomment
3535
# `pod install` in .travis.yml
3636
#
37-
# Pods/
37+
Pods/
38+
39+
Example/Podfile.lock
40+
Example/Pods/
41+
Example/com.awareframework.ios.sensor.connectivity.xcworkspace/

Example/Tests/Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import XCTest
2-
import com.awareframework.ios.sensor.connectivity
2+
import com_awareframework_ios_sensor_connectivity
33

44
class Tests: XCTestCase {
55

Example/com.awareframework.ios.sensor.connectivity.xcodeproj/project.pbxproj

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/* End PBXContainerItemProxy section */
2929

3030
/* Begin PBXFileReference section */
31-
002893713DF50844A1DE2AD3 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = "<group>"; };
31+
002893713DF50844A1DE2AD3 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
3232
2931FEA6F95A1D4D67209E2C /* Pods_com_awareframework_ios_sensor_connectivity_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_com_awareframework_ios_sensor_connectivity_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3333
31B4237B3F0BC5FE710EAD5F /* Pods_com_awareframework_ios_sensor_connectivity_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_com_awareframework_ios_sensor_connectivity_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3434
607FACD01AFB9204008FA782 /* com.awareframework.ios.sensor.connectivity_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = com.awareframework.ios.sensor.connectivity_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -41,8 +41,8 @@
4141
607FACE51AFB9204008FA782 /* com.awareframework.ios.sensor.connectivity_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = com.awareframework.ios.sensor.connectivity_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4242
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4343
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
44-
739B654F8D1FA19153764CC2 /* com.awareframework.ios.sensor.connectivity.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = com.awareframework.ios.sensor.connectivity.podspec; path = ../com.awareframework.ios.sensor.connectivity.podspec; sourceTree = "<group>"; };
45-
8135A6C1CA4A9B3E2BB7B73F /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
44+
739B654F8D1FA19153764CC2 /* com.awareframework.ios.sensor.connectivity.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = com.awareframework.ios.sensor.connectivity.podspec; path = ../com.awareframework.ios.sensor.connectivity.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
45+
8135A6C1CA4A9B3E2BB7B73F /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
4646
8A10FF8DFB963F659DE74BB8 /* Pods-com.awareframework.ios.sensor.connectivity_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.connectivity_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.connectivity_Tests/Pods-com.awareframework.ios.sensor.connectivity_Tests.debug.xcconfig"; sourceTree = "<group>"; };
4747
8F9EBCB0CF256C3082D76394 /* Pods-com.awareframework.ios.sensor.connectivity_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.connectivity_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.connectivity_Example/Pods-com.awareframework.ios.sensor.connectivity_Example.debug.xcconfig"; sourceTree = "<group>"; };
4848
BF4F6DFF7A1AA75671334B23 /* Pods-com.awareframework.ios.sensor.connectivity_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.connectivity_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.connectivity_Example/Pods-com.awareframework.ios.sensor.connectivity_Example.release.xcconfig"; sourceTree = "<group>"; };
@@ -212,6 +212,7 @@
212212
TargetAttributes = {
213213
607FACCF1AFB9204008FA782 = {
214214
CreatedOnToolsVersion = 6.3.1;
215+
DevelopmentTeam = FH352PYMNC;
215216
LastSwiftMigration = 0900;
216217
};
217218
607FACE41AFB9204008FA782 = {
@@ -314,13 +315,25 @@
314315
);
315316
inputPaths = (
316317
"${SRCROOT}/Pods/Target Support Files/Pods-com.awareframework.ios.sensor.connectivity_Example/Pods-com.awareframework.ios.sensor.connectivity_Example-frameworks.sh",
318+
"${BUILT_PRODUCTS_DIR}/Networking/Networking.framework",
319+
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
320+
"${BUILT_PRODUCTS_DIR}/Realm/Realm.framework",
321+
"${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework",
322+
"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework",
317323
"${BUILT_PRODUCTS_DIR}/com.awareframework.ios.sensor.connectivity/com_awareframework_ios_sensor_connectivity.framework",
324+
"${BUILT_PRODUCTS_DIR}/com.awareframework.ios.sensor.core/com_awareframework_ios_sensor_core.framework",
318325
);
319326
name = "[CP] Embed Pods Frameworks";
320327
outputFileListPaths = (
321328
);
322329
outputPaths = (
330+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Networking.framework",
331+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
332+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework",
333+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework",
334+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework",
323335
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/com_awareframework_ios_sensor_connectivity.framework",
336+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/com_awareframework_ios_sensor_core.framework",
324337
);
325338
runOnlyForDeploymentPostprocessing = 0;
326339
shellPath = /bin/sh;
@@ -422,7 +435,7 @@
422435
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
423436
GCC_WARN_UNUSED_FUNCTION = YES;
424437
GCC_WARN_UNUSED_VARIABLE = YES;
425-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
438+
IPHONEOS_DEPLOYMENT_TARGET = 10;
426439
MTL_ENABLE_DEBUG_INFO = YES;
427440
ONLY_ACTIVE_ARCH = YES;
428441
SDKROOT = iphoneos;
@@ -468,7 +481,7 @@
468481
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
469482
GCC_WARN_UNUSED_FUNCTION = YES;
470483
GCC_WARN_UNUSED_VARIABLE = YES;
471-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
484+
IPHONEOS_DEPLOYMENT_TARGET = 10;
472485
MTL_ENABLE_DEBUG_INFO = NO;
473486
SDKROOT = iphoneos;
474487
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -481,7 +494,9 @@
481494
baseConfigurationReference = 8F9EBCB0CF256C3082D76394 /* Pods-com.awareframework.ios.sensor.connectivity_Example.debug.xcconfig */;
482495
buildSettings = {
483496
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
497+
DEVELOPMENT_TEAM = FH352PYMNC;
484498
INFOPLIST_FILE = com.awareframework.ios.sensor.connectivity/Info.plist;
499+
IPHONEOS_DEPLOYMENT_TARGET = 10;
485500
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
486501
MODULE_NAME = ExampleApp;
487502
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
@@ -496,7 +511,9 @@
496511
baseConfigurationReference = BF4F6DFF7A1AA75671334B23 /* Pods-com.awareframework.ios.sensor.connectivity_Example.release.xcconfig */;
497512
buildSettings = {
498513
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
514+
DEVELOPMENT_TEAM = FH352PYMNC;
499515
INFOPLIST_FILE = com.awareframework.ios.sensor.connectivity/Info.plist;
516+
IPHONEOS_DEPLOYMENT_TARGET = 10;
500517
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
501518
MODULE_NAME = ExampleApp;
502519
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";

LICENSE

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
1-
Copyright (c) 2018 tetujin <tetujin@ht.sfc.keio.ac.jp>
1+
Copyright (c) 2018 AWARE Mobile Context Instrumentation Middleware/Framework (http://www.awareframework.com)
22

3-
Permission is hereby granted, free of charge, to any person obtaining a copy
4-
of this software and associated documentation files (the "Software"), to deal
5-
in the Software without restriction, including without limitation the rights
6-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7-
copies of the Software, and to permit persons to whom the Software is
8-
furnished to do so, subject to the following conditions:
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
94

10-
The above copyright notice and this permission notice shall be included in
11-
all copies or substantial portions of the Software.
12-
13-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
THE SOFTWARE.
5+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

README.md

Lines changed: 87 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# com.awareframework.ios.sensor.connectivity
1+
# Aware Connectivity
22

33
[![CI Status](https://img.shields.io/travis/tetujin/com.awareframework.ios.sensor.connectivity.svg?style=flat)](https://travis-ci.org/tetujin/com.awareframework.ios.sensor.connectivity)
44
[![Version](https://img.shields.io/cocoapods/v/com.awareframework.ios.sensor.connectivity.svg?style=flat)](https://cocoapods.org/pods/com.awareframework.ios.sensor.connectivity)
@@ -10,20 +10,102 @@
1010
To run the example project, clone the repo, and run `pod install` from the Example directory first.
1111

1212
## Requirements
13+
iOS 10 or later
1314

1415
## Installation
1516

16-
com.awareframework.ios.sensor.connectivity is available through [CocoaPods](https://cocoapods.org). To install
17-
it, simply add the following line to your Podfile:
17+
com.awareframework.ios.sensor.connectivity is available through [CocoaPods](https://cocoapods.org).
1818

19+
1. To install it, simply add the following line to your Podfile:
1920
```ruby
2021
pod 'com.awareframework.ios.sensor.connectivity'
2122
```
2223

24+
2. Import com.awareframework.ios.sensor.connectivity library into your source code.
25+
```swift
26+
import com_awareframework_ios_sensor_connectivity
27+
```
28+
29+
3. Add `UIRequiresPersistentWiFi` to `Info.plist`
30+
31+
## Example usage
32+
```swift
33+
let connectivity = ConnectivitySensor.init(ConnectivitySensor.Config().apply{config in
34+
config.debug = true
35+
config.dbType = .REALM
36+
config.sensorObserver = Observer()
37+
})
38+
connectivity?.start()
39+
```
40+
41+
```swift
42+
class Observer:ConnectivityObserver {
43+
func onInternetON() {
44+
// Your code here
45+
}
46+
47+
func onInternetOFF() {
48+
// Your code here
49+
}
50+
51+
func onGPSON() {
52+
// Your code here
53+
}
54+
55+
func onGPSOFF() {
56+
// Your code here
57+
}
58+
59+
func onBluetoothON() {
60+
// Your code here
61+
}
62+
63+
func onBluetoothOFF() {
64+
// Your code here
65+
}
66+
67+
func onBackgroundRefreshON() {
68+
// Your code here
69+
}
70+
71+
func onBackgroundRefreshOFF() {
72+
// Your code here
73+
}
74+
75+
func onLowPowerModeON() {
76+
// Your code here
77+
}
78+
79+
func onLowPowerModeOFF() {
80+
// Your code here
81+
}
82+
83+
func onPushNotificationOn() {
84+
// Your code here
85+
}
86+
87+
func onPushNotificationOff() {
88+
// Your code here
89+
}
90+
91+
func onWiFiON() {
92+
// Your code here
93+
}
94+
95+
func onWiFiOFF() {
96+
// Your code here
97+
}
98+
}
99+
```
100+
23101
## Author
24102

25-
tetujin, tetujin@ht.sfc.keio.ac.jp
103+
Yuuki Nishiyama, tetujin@ht.sfc.keio.ac.jp
26104

27105
## License
28106

29-
com.awareframework.ios.sensor.connectivity is available under the MIT license. See the LICENSE file for more info.
107+
Copyright (c) 2018 AWARE Mobile Context Instrumentation Middleware/Framework (http://www.awareframework.com)
108+
109+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
110+
111+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

com.awareframework.ios.sensor.connectivity.podspec

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'com.awareframework.ios.sensor.connectivity'
11-
s.version = '0.1.0'
11+
s.version = '0.1.1'
1212
s.summary = 'A short description of com.awareframework.ios.sensor.connectivity.'
1313

1414
# This description is used to generate tags and improve search results.
@@ -21,15 +21,17 @@ Pod::Spec.new do |s|
2121
TODO: Add long description of the pod here.
2222
DESC
2323

24-
s.homepage = 'https://github.com/tetujin/com.awareframework.ios.sensor.connectivity'
24+
s.homepage = 'https://github.com/awareframework/com.awareframework.ios.sensor.connectivity'
2525
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
26-
s.license = { :type => 'MIT', :file => 'LICENSE' }
26+
s.license = { :type => 'Apache2', :file => 'LICENSE' }
2727
s.author = { 'tetujin' => 'tetujin@ht.sfc.keio.ac.jp' }
28-
s.source = { :git => 'https://github.com/tetujin/com.awareframework.ios.sensor.connectivity.git', :tag => s.version.to_s }
28+
s.source = { :git => 'https://github.com/awareframework/com.awareframework.ios.sensor.connectivity.git', :tag => s.version.to_s }
2929
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
3030

31-
s.ios.deployment_target = '8.0'
32-
31+
s.ios.deployment_target = '10.0'
32+
33+
s.swift_version = '4.2'
34+
3335
s.source_files = 'com.awareframework.ios.sensor.connectivity/Classes/**/*'
3436

3537
# s.resource_bundles = {
@@ -38,5 +40,7 @@ TODO: Add long description of the pod here.
3840

3941
# s.public_header_files = 'Pod/Classes/**/*.h'
4042
# s.frameworks = 'UIKit', 'MapKit'
41-
# s.dependency 'AFNetworking', '~> 2.3'
43+
s.frameworks = 'CoreLocation', 'Foundation', 'UserNotifications', 'CoreBluetooth'
44+
s.dependency 'com.awareframework.ios.sensor.core'
45+
s.dependency 'ReachabilitySwift'
4246
end

0 commit comments

Comments
 (0)