{"id":25932644,"url":"https://github.com/socketmobile/cocoapods-maraca","last_synced_at":"2025-06-21T06:35:39.905Z","repository":{"id":60503714,"uuid":"543064671","full_name":"SocketMobile/cocoapods-maraca","owner":"SocketMobile","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-13T13:16:08.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-25T14:55:47.463Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SocketMobile.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-09-29T10:41:20.000Z","updated_at":"2022-09-30T13:08:53.000Z","dependencies_parsed_at":"2022-09-30T14:20:11.555Z","dependency_job_id":null,"html_url":"https://github.com/SocketMobile/cocoapods-maraca","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocketMobile%2Fcocoapods-maraca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocketMobile%2Fcocoapods-maraca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocketMobile%2Fcocoapods-maraca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocketMobile%2Fcocoapods-maraca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SocketMobile","download_url":"https://codeload.github.com/SocketMobile/cocoapods-maraca/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241763763,"owners_count":20016161,"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":"2025-03-04T00:38:39.205Z","updated_at":"2025-03-04T00:38:39.974Z","avatar_url":"https://github.com/SocketMobile.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Maraca Version 1.0.10 - Cocoapods\n\nMaraca establishes connections between your iOS application using our [iOS CaptureSDK](https://github.com/SocketMobile/cocoapods-capturesdk) and a web application using our [CaptureJS SDK](https://docs.socketmobile.com/capturejs/en/latest/gettingStarted.html). This enables the web application to connect with our scanners and NFC readers with the same flexibilty that our iOS SDK provides.\n\n## Usage\n\nUnder the hood, Maraca is an umbrella for our iOS Capture SDK. So naturally, you need to provide credentials to get started. \n\nThe most important step is to call `observeJavascriptMessageHandlers(_:)`\nYou may provide your own Javascript Message Handler names if you're familiar with [WKUserContentController](https://developer.apple.com/documentation/webkit/wkusercontentcontroller). Otherwise, this can be nil.\nThis function enables messages containing data to be transferred from your web application using CaptureJS to your iOS application.\n\nInside the completion handler of `beging(withAppKey:appId:developerId:completion:)`, create your `WKWebView` using the public `Maraca.shared.webViewConfiguration` configuration\n\n```swift\n\noverride func viewDidLoad() {\n    super.viewDidLoad()\n\n    setupMaraca()\n}\n\nprivate func setupMaraca() {\n    \n    let appKey =        \u003cYour App Key\u003e\n    let appId =         \u003cYour App ID\u003e\n    let developerId =   \u003cYour Developer ID\u003e\n    let bundle = Bundle.main\n    \n    Maraca.shared.injectCustomJavascript(mainBundle: bundle, javascriptFileNames: [\"getInputForDecodedData\"])\n        .observeJavascriptMessageHandlers(YourOwnMessageHandlers.allCases.map { $0.rawValue })\n        .setDelegate(to: self)\n        .begin(withAppKey: appKey,\n               appId: appId,\n               developerId: developerId,\n               completion: { [weak self] (result) in\n\n                    if result == .E_NOERROR {\n                        self?.setupUI()\n                    } else {\n                        // Encountered some error, inspect result\n                    }\n        })\n}\n\n// Initialize WKWebView with Maraca.shared.webViewConfiguration after\n// setting up Maraca\nprivate var webview: WKWebView!\n\nprivate func setupUI() {\n\n    webview = {\n        let w = WKWebView(frame: .zero, configuration: Maraca.shared.webViewConfiguration)\n        w.navigationDelegate = self\n        return w\n    }()\n    \n    view.addSubview(webview)\n    \n    // Set up constraints, etc..\n    \n    let myWebApplicationURLString = .....\n    \n    guard let url = URL(string: myWebApplicationURLString) else {\n        return\n    }\n    \n    loadMyWebApplication(with: url)\n    \n}\n\n```\n\n## Documentation\n\nFull documentation can be found [here](https://docs.socketmobile.com/rumba/en/latest/maraca.html)\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Installation\n\nMaraca is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'MaracaPod'\n```\n\n## License\n\nMaraca is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketmobile%2Fcocoapods-maraca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketmobile%2Fcocoapods-maraca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketmobile%2Fcocoapods-maraca/lists"}