{"id":21994763,"url":"https://github.com/allow2/allow2ios","last_synced_at":"2025-04-30T17:06:05.215Z","repository":{"id":8310014,"uuid":"9856054","full_name":"Allow2/Allow2iOS","owner":"Allow2","description":"Allow2 Swift SDK for OpenSource Parental Freedom","archived":false,"fork":false,"pushed_at":"2018-11-17T23:13:42.000Z","size":610,"stargazers_count":13,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T17:05:52.702Z","etag":null,"topics":["child","children","cocoapods","control","controls","family","freedom","gaming","limit","limits","parent","parental","parental-control","quota","social","social-network","time","time-limit"],"latest_commit_sha":null,"homepage":"https://Allow2.github.io","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Allow2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-04T15:36:56.000Z","updated_at":"2025-02-10T21:48:18.000Z","dependencies_parsed_at":"2022-07-22T18:47:21.767Z","dependency_job_id":null,"html_url":"https://github.com/Allow2/Allow2iOS","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2FAllow2iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2FAllow2iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2FAllow2iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2FAllow2iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Allow2","download_url":"https://codeload.github.com/Allow2/Allow2iOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748947,"owners_count":21637418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["child","children","cocoapods","control","controls","family","freedom","gaming","limit","limits","parent","parental","parental-control","quota","social","social-network","time","time-limit"],"created_at":"2024-11-29T21:10:23.541Z","updated_at":"2025-04-30T17:06:05.184Z","avatar_url":"https://github.com/Allow2.png","language":"Swift","readme":"# Allow2iOS\n\n[![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)\n\nAllow2 makes it easy to add parental controls to your apps.\n\n1. [Why should you use Allow2?](#why-should-you-use-allow2)\n2. [What's it look like?](#whats-it-look-like)\n3. [Requirements](#requirements)\n4. [Integration](#integration)\n\nrefer to https://github.com/Allow2/Allow2.github.io/wiki for more details.\n\n## Why should you use Allow2?\n\nParental 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.\n\nAllow2 solves the problem once and for all:\n\n1. Leverage the powerful Allow2 platform completely for free (no developer licensing fees)\n2. Add parental controls in a matter of hours and don't worry about implementing heaps of interfaces.\n3. Show your community responsibility and support parents, this helps to bring more users to your apps.\n\nReally, 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.\n\nWith Allow2 all you have to do to check if something can be used and record it's usage is:\n\n```swift\nlet allow2Activities = [\n    Allow2.Allow2Activity(activity: Allow2.Activity.Internet, log: true), // this is an internet based app\n    Allow2.Allow2Activity(activity: Allow2.Activity.Gaming, log: true),   // and it's gaming related, can also use \"Messaging\", \"Social\", \"Electricity\" and more...\n]\nAllow2.shared.check(allow2Activities)\n```\n\nAnd don't worry about having to tell other parts of your app. It's done for you automatically (just listen for the Allow2CheckResultNotification)!\n\n```swift\nfunc Allow2CheckResultNotification(notification:NSNotification) {\n    guard let userInfo = notification.userInfo,\n    let result  = userInfo[\"result\"] as? Allow2CheckResult else {\n        print(\"No Allow2CheckResult found in notification\")\n        return\n    }\n\n    dispatch_async(dispatch_get_main_queue()) {\n        self.allow2View.hidden = result.allowed\n\n        if (!result.allowed) {\n            // configure the block screen to explain the issue\n            self.allow2View.result = result\n        }\n    }\n}\n\n```\n\n## What's it look like?\n\n| Screenshot | Description |\n| --- | --- |\n| \u003cimg src=\"https://github.com/Allow2/Allow2iOS/blob/master/Screenshots/pairing.jpg\" alt=\"Pairing\" width=\"150\"/\u003e | Pairing \u003cbr\u003e Initial Setup |\n| \u003cimg src=\"https://github.com/Allow2/Allow2iOS/blob/master/Screenshots/select.jpg\" alt=\"Choose Child\" width=\"150\"/\u003e | When there is more than one child, and the app can be used by any child |\n| \u003cimg src=\"https://github.com/Allow2/Allow2iOS/blob/master/Screenshots/pin.jpg\" alt=\"Enter Pin\" width=\"150\"/\u003e | Before a child can use the app, they need to enter their pin \u003cbr\u003e (if more than one child) |\n| \u003cimg src=\"https://github.com/Allow2/Allow2iOS/blob/master/Screenshots/banned.jpg\" alt=\"Banned\" width=\"150\"/\u003e | If usage is not allowed at that time, or they ran out of quota, or have been banned. |\n| \u003cimg src=\"https://github.com/Allow2/Allow2iOS/blob/master/Screenshots/request.jpg\" alt=\"Request\" width=\"150\"/\u003e | Children can request changes directly from within your game or app |\n\n## Requirements\n\n- iOS 8.0+ | macOS 10.10+ | tvOS 9.0+ | watchOS 2.0+\n- Xcode 8\n\n## Integration\n\n#### CocoaPods (iOS 9+)\n\nYou can use [CocoaPods](http://cocoapods.org/) to install `Allow2` by adding it to your `Podfile`:\n\n```ruby\nplatform :ios, '9.0'\nuse_frameworks!\n\ntarget 'MyApp' do\n    pod 'Allow2'\nend\n```\n\nNote that this requires CocoaPods version 36, and your iOS deployment target to be at least 9.0:\n\n\n#### Carthage (iOS 9+)\n\nYou can use [Carthage](https://github.com/Carthage/Carthage) to install `Allow2` by adding it to your `Cartfile`:\n\n```\ngithub \"Allow2/Allow2Framework\"\n```\n\n#### Swift Package Manager\n\nYou can use [The Swift Package Manager](https://swift.org/package-manager) to install `Allow2` by adding the proper description to your `Package.swift` file:\n\n```swift\nimport PackageDescription\n\nlet package = Package(\nname: \"YOUR_PROJECT_NAME\",\ntargets: [],\ndependencies: [\n.Package(url: \"https://github.com/Allow2/allow2iOS.git\", versions: Version(1,0,0)..\u003cVersion(2, .max, .max)),\n]\n)\n```\n\nNote that the [Swift Package Manager](https://swift.org/package-manager) is still in early design and development, for more information checkout its [GitHub Page](https://github.com/apple/swift-package-manager)\n\n#### Manually (iOS 9+)\n\nTo use this library in your project manually you may:  \n\n1. drag in the whole Allow2Framework.xcodeproj\n\n## Usage\n\n#### Initialization\n\n```swift\nimport Allow2\n```\n\nThere are some basic options required to get started and some optional ones.\n\n#### Create the app or device and get a token - REQUIRED\n\nFirst of all, you need to set up the device in the developer portal, so head over there, signup (all free), and create your app/device:\n\n[https://developer.allow2.com/](https://developer.allow2.com/)\n\nthen you need to set the token in the library before you can use any functions:\n\n```swift\nfunc application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n    ...\n    \n    Allow2.shared.deviceToken = \"\u003cDEVICE TOKEN GOES HERE\u003e\"\n    \n    ...\n}\n```\n\n#### Set the environment - OPTIONAL\n\nBy 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.\n\nHowever, 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!\n\n```swift\nfunc application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n    ...\n\n    Allow2.shared.env = .sandbox\n\n    ...\n}\n```\n\n#### Convenience setup - OPTIONAL\n\nAllow2 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:\n\n```xml\n\u003ckey\u003eAllow2\u003c/key\u003e\n\u003cdict\u003e\n    \u003ckey\u003eDeviceToken\u003c/key\u003e\n    \u003cstring\u003eDEVICETOKEN\u003c/string\u003e\n    \u003ckey\u003eEnvironment\u003c/key\u003e\n    \u003cstring\u003estaging\u003c/string\u003e\n\u003c/dict\u003e\n```\n\nThen you can pass this straight in from your Bundle:\n\n```swift\nfunc application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n    ...\n\n    Allow2.shared.setPropsFromBundle(Bundle.main.infoDictionary?[\"Allow2\"])\n\n    ...\n}\n```\n\nAny 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.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallow2%2Fallow2ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallow2%2Fallow2ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallow2%2Fallow2ios/lists"}