{"id":19371915,"url":"https://github.com/chatsecure/chatsecure-push-ios","last_synced_at":"2025-07-25T11:03:02.729Z","repository":{"id":34725708,"uuid":"38703383","full_name":"ChatSecure/ChatSecure-Push-iOS","owner":"ChatSecure","description":"The iOS SDK for ChatSecure-Push-Server","archived":false,"fork":false,"pushed_at":"2019-10-27T20:25:39.000Z","size":114,"stargazers_count":16,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-23T06:18:13.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChatSecure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-07T17:24:29.000Z","updated_at":"2020-04-29T17:23:19.000Z","dependencies_parsed_at":"2022-08-28T11:11:28.992Z","dependency_job_id":null,"html_url":"https://github.com/ChatSecure/ChatSecure-Push-iOS","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChatSecure%2FChatSecure-Push-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChatSecure%2FChatSecure-Push-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChatSecure%2FChatSecure-Push-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChatSecure%2FChatSecure-Push-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChatSecure","download_url":"https://codeload.github.com/ChatSecure/ChatSecure-Push-iOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250470882,"owners_count":21435855,"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":[],"created_at":"2024-11-10T08:20:30.090Z","updated_at":"2025-04-23T16:31:39.750Z","avatar_url":"https://github.com/ChatSecure.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatSecure-Push-iOS\nThe iOS SDK for [ChatSecure-Push-Server](https://github.com/ChatSecure/ChatSecure-Push-Server).\n\n## Getting Started\n\n### Install\n```ruby\npod 'ChatSecure-Push-iOS', :git =\u003e 'https://github.com/ChatSecure/ChatSecure-Push-iOS'\n```\n\n### Usage\n\n### 1. Setup\nIf it's the first launch and there is no account.\n```swift\nlet client = Client(baseUrl: NSURL(string: urlString)!, urlSessionConfiguration: NSURLSessionConfiguration.defaultSessionConfiguration(), account: nil)\n```\nOr if you already have an account. You'll need to store the `username` and `token` to make API requests.\n```swfit\nlet client = Client(baseUrl: NSURL(string: urlString)!, urlSessionConfiguration: NSURLSessionConfiguration.defaultSessionConfiguration(), account: account)\n```\n\n### 2. Create account\n```swift\nclient.registerNewUser(username, password: password, email: nil, completion: { (account, error) -\u003e Void in\n  //Save account here\n  })\n```\n\n### 3. Register new device\nIn order to register a new device first get an APNS token.\n\n```swift\nvar settings = UIUserNotificationSettings(forTypes: (UIUserNotificationType.Badge | UIUserNotificationType.Sound | UIUserNotificationType.Alert), categories: nil)\napplication.registerUserNotificationSettings(settings)\n```\nOnce you've recieved the token in the `AppDelegate`.\n\n```swift\nself.client.registerDevice(apnsToken, name: \"New device name\", deviceID: nil, completion: { (device, error) -\u003e Void in\n  //Save device here\n  })\n```\n\n### 4. Get whitelist token to hand out to a friend\n```swift\nself.client.createToken(apnsToken, name: \"New token\", completion: { (token, error) -\u003e Void in\n  //Save and send to friend\n})\n```\n\n### 5. Send a push message to a friend\n\nOnce you receive a `token` from a friend you can send them a push message.\n\n`data` needs to be a dictionary that is serializable to JSON.\n\n```swift\nvar message = Message(token: token, data: nil)\nself.client.sendMessage(message, completion: { (msg, error) -\u003e Void in\n  println(\"Message: \\(msg)\")\n  })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatsecure%2Fchatsecure-push-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchatsecure%2Fchatsecure-push-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatsecure%2Fchatsecure-push-ios/lists"}