Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/allow2/allow2ios
Allow2 Swift SDK for OpenSource Parental Freedom
https://github.com/allow2/allow2ios
child children cocoapods control controls family freedom gaming limit limits parent parental parental-control quota social social-network time time-limit
Last synced: about 1 month ago
JSON representation
Allow2 Swift SDK for OpenSource Parental Freedom
- Host: GitHub
- URL: https://github.com/allow2/allow2ios
- Owner: Allow2
- License: other
- Created: 2013-05-04T15:36:56.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-11-17T23:13:42.000Z (about 6 years ago)
- Last Synced: 2024-11-06T12:03:11.249Z (about 2 months ago)
- Topics: child, children, cocoapods, control, controls, family, freedom, gaming, limit, limits, parent, parental, parental-control, quota, social, social-network, time, time-limit
- Language: Swift
- Homepage: https://Allow2.github.io
- Size: 596 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Allow2iOS
[![Travis CI](https://travis-ci.org/Allow2/allow2iOS.svg?branch=master)](https://travis-ci.org/Allow2/allow2iOS) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) ![CocoaPods](https://img.shields.io/cocoapods/v/Allow2.svg) ![Platform](https://img.shields.io/badge/platforms-iOS10.0+-333333.svg)
Allow2 makes it easy to add parental controls to your apps.
1. [Why should you use Allow2?](#why-should-you-use-allow2)
2. [What's it look like?](#whats-it-look-like)
3. [Requirements](#requirements)
4. [Integration](#integration)refer to https://github.com/Allow2/Allow2.github.io/wiki for more details.
## Why should you use Allow2?
Parental controls are incredibly complex and difficult to get correct and for a parent, there is nothing worse than having to log in or open up yet another parental control interface on another app and reconfigure it every other day.
Allow2 solves the problem once and for all:
1. Leverage the powerful Allow2 platform completely for free (no developer licensing fees)
2. Add parental controls in a matter of hours and don't worry about implementing heaps of interfaces.
3. Show your community responsibility and support parents, this helps to bring more users to your apps.Really, you should be able to add extensive and powerful parental controls to your apps in a matter of hours or (at most) a couple of days.
With Allow2 all you have to do to check if something can be used and record it's usage is:
```swift
let allow2Activities = [
Allow2.Allow2Activity(activity: Allow2.Activity.Internet, log: true), // this is an internet based app
Allow2.Allow2Activity(activity: Allow2.Activity.Gaming, log: true), // and it's gaming related, can also use "Messaging", "Social", "Electricity" and more...
]
Allow2.shared.check(allow2Activities)
```And don't worry about having to tell other parts of your app. It's done for you automatically (just listen for the Allow2CheckResultNotification)!
```swift
func Allow2CheckResultNotification(notification:NSNotification) {
guard let userInfo = notification.userInfo,
let result = userInfo["result"] as? Allow2CheckResult else {
print("No Allow2CheckResult found in notification")
return
}dispatch_async(dispatch_get_main_queue()) {
self.allow2View.hidden = result.allowedif (!result.allowed) {
// configure the block screen to explain the issue
self.allow2View.result = result
}
}
}```
## What's it look like?
| Screenshot | Description |
| --- | --- |
| | Pairing
Initial Setup |
| | When there is more than one child, and the app can be used by any child |
| | Before a child can use the app, they need to enter their pin
(if more than one child) |
| | If usage is not allowed at that time, or they ran out of quota, or have been banned. |
| | Children can request changes directly from within your game or app |## Requirements
- iOS 8.0+ | macOS 10.10+ | tvOS 9.0+ | watchOS 2.0+
- Xcode 8## Integration
#### CocoaPods (iOS 9+)
You can use [CocoaPods](http://cocoapods.org/) to install `Allow2` by adding it to your `Podfile`:
```ruby
platform :ios, '9.0'
use_frameworks!target 'MyApp' do
pod 'Allow2'
end
```Note that this requires CocoaPods version 36, and your iOS deployment target to be at least 9.0:
#### Carthage (iOS 9+)
You can use [Carthage](https://github.com/Carthage/Carthage) to install `Allow2` by adding it to your `Cartfile`:
```
github "Allow2/Allow2Framework"
```#### Swift Package Manager
You can use [The Swift Package Manager](https://swift.org/package-manager) to install `Allow2` by adding the proper description to your `Package.swift` file:
```swift
import PackageDescriptionlet package = Package(
name: "YOUR_PROJECT_NAME",
targets: [],
dependencies: [
.Package(url: "https://github.com/Allow2/allow2iOS.git", versions: Version(1,0,0).. Bool {
...
Allow2.shared.deviceToken = ""
...
}
```#### Set the environment - OPTIONAL
By default, the system will ALWAYS connect to the production environment. You can safely set up new apps in the developer portal and design and use them in the production system without any issues and this will be the most anyone will want to do.
However, the Allow2 platfom is also updated on a regular basis and as changes are bought to realisation, they flow through a standard release process that we allow developers to paticipate in. At this time, we allow developers to test in the "sandbox" environment (essentially "beta") and in the "staging" environment (essentially "alpha"). So you CAN set the system to use one of these environments, BUT use them at your own peril!
```swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
...Allow2.shared.env = .sandbox
...
}
```#### Convenience setup - OPTIONAL
Allow2 for iOS provides a convenience setup in case you are building into multiple environments yourself, you can pass a plist (directly out of your bundle if you wish!) into the convience property setter to handle one line config and easily manage multiple build targets:
```xml
Allow2DeviceToken
DEVICETOKEN
Environment
staging```
Then you can pass this straight in from your Bundle:
```swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
...Allow2.shared.setPropsFromBundle(Bundle.main.infoDictionary?["Allow2"])
...
}
```Any parameter that is not recognised will be ignored, so Environment: Invalid will essentially leave it as the default or whatever it was set to earlier.