Latest 0.1.0
Homepage https://github.com/awareframework/com.aware.ios.sensor.connectivity
License Apache2
Platforms ios 10.0
Dependencies com.aware.ios.sensor.core, ReachabilitySwift
Frameworks CoreLocation, Foundation, UserNotifications, CoreBluetooth
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

com.aware.ios.sensor.connectivity is available through CocoaPods.

  1. To install it, simply add the following line to your Podfile:

    pod 'com.aware.ios.sensor.connectivity'
  2. Import com.aware.ios.sensor.connectivity library into your source code.

    import com_aware_ios_sensor_connectivity
  3. Add UIRequiresPersistentWiFi to Info.plist

Example Use

connectivity = ConnectivitySensor.init(ConnectivitySensor.Config().apply{config in
    config.debug  = true
    config.dbType = .REALM
    config.sensorObserver = Observer()
})
connectivity?.start()
class Observer:ConnectivityObserver {
    func onInternetON() {
        // Your code here
    }

    func onInternetOFF() {
        // Your code here
    }

    func onGPSON() {
        // Your code here
    }

    func onGPSOFF() {
        // Your code here
    }

    func onBluetoothON() {
        // Your code here
    }

    func onBluetoothOFF() {
        // Your code here
    }

    func onBackgroundRefreshON() {
        // Your code here
    }

    func onBackgroundRefreshOFF() {
        // Your code here
    }

    func onLowPowerModeON() {
        // Your code here
    }

    func onLowPowerModeOFF() {
        // Your code here
    }

    func onPushNotificationOn() {
        // Your code here
    }

    func onPushNotificationOff() {
        // Your code here
    }

    func onWiFiON() {
        // Your code here
    }

    func onWiFiOFF() {
        // Your code here
    }
}

Author

Yuuki Nishiyama, [email protected]

License

Copyright (c) 2018 AWARE Mobile Context Instrumentation Middleware/Framework (http://www.awareframework.com)

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

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.

Latest podspec

{
    "name": "com.aware.ios.sensor.connectivity",
    "version": "0.1.0",
    "summary": "A short description of com.aware.ios.sensor.connectivity.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/awareframework/com.aware.ios.sensor.connectivity",
    "license": {
        "type": "Apache2",
        "file": "LICENSE"
    },
    "authors": {
        "tetujin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/awareframework/com.aware.ios.sensor.connectivity.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "4.2",
    "source_files": "com.aware.ios.sensor.connectivity/Classes/**/*",
    "frameworks": [
        "CoreLocation",
        "Foundation",
        "UserNotifications",
        "CoreBluetooth"
    ],
    "dependencies": {
        "com.aware.ios.sensor.core": [],
        "ReachabilitySwift": []
    }
}

Pin It on Pinterest

Share This