CallbackURLKit alternatives and similar libraries
Based on the "Utility" category.
Alternatively, view CallbackURLKit alternatives based on common mentions on social networks and blogs.
-
SwifterSwift
A handy collection of more than 500 native Swift extensions to boost your productivity. -
SwiftGen-Storyboard
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
SwiftGen
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
R.swift
Strong typed, autocompleted resources like images, fonts and segues in Swift projects -
Dollar
A functional tool-belt for Swift Language similar to Lo-Dash or Underscore.js in Javascript -
swift-protobuf
Plugin and runtime library for using protobuf with Swift -
ExSwift
a set of Swift extensions for standard types and classes. -
EZSwiftExtensions
:smirk: How Swift standard types and classes were supposed to work. -
DifferenceKit
💻 A fast and flexible O(n) difference algorithm framework for Swift collection. -
Result
Swift type modelling the success/failure of arbitrary operations. -
DeepDiff
🦀Amazingly incredible extraordinary lightning fast diffing in Swift -
Device
Light weight tool for detecting the current device and screen size written in swift. -
SwiftLinkPreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images. -
WhatsNew
Showcase new features after an app update similar to Pages, Numbers and Keynote. -
Codextended
Extensions giving Swift's Codable API type inference super powers 🦸♂️🦹♀️ -
Popsicle
Delightful, extensible Swift value interpolation framework. -
SwiftyJSONAccelerator
macOS app to generate Swift 5 code for models from JSON (with Codeable) -
Playbook
📘A library for isolated developing UI components and automatically taking snapshots of them. -
ReadabilityKit
Preview extractor for news, articles and full-texts in Swift -
ObjectiveKit
Swift-friendly API for a set of powerful Objective C runtime functions. -
Compass
:earth_africa: Compass helps you setup a central navigation system for your application -
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift -
Solar
A Swift micro library for generating Sunrise and Sunset times. -
Pythonic.swift
Pythonic tool-belt for Swift – a Swift implementation of selected parts of Python standard library. -
SwiftyUtils
All the reusable code that we need in each project -
Rugby
🏈 Cache CocoaPods for faster rebuild and indexing Xcode project -
Prototope
Swift library of lightweight interfaces for prototyping, bridged to JS.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of CallbackURLKit or a related project?
README
CallbackURLKit - Inter app communication
Starting to integrate URL scheme in an app, why not be compliant with x-callback-url.
CallbackURLKit.register(action: "play") { parameters, ... in
self.player.play()
}
Want to interact with one of the numerous other applications which implement already x-callback-url, you can also use this framework.
CallbackURLKit.perform(action: "open", urlScheme: "googlechrome-x-callback",
parameters: ["url": "http://www.google.com"])
Usage
Perform action on other applications
Anywhere in your code after imported CallbackURLKit you can call
try CallbackURLKit.perform(action: "actionName", urlScheme: "applicationName",
parameters: ["key1": "value1"])
You can also use a new Manager
or the shared instance
try Manager.shared.perform(action: "actionName", urlScheme: "application-name",
parameters: ["key1": "value1"])
Declare targeted applications URL schemes in iOS9
You must whitelist any URL schemes your app wants to query in Info.plist under the LSApplicationQueriesSchemes key (an array of strings)
Create a client class
Alternatively you can create a new Client
object where you can define the targeted app URL scheme.
let client = Client(urlScheme: "application-url-scheme")
try client.perform(action:(..)
or create a new Client
class to add some utility methods which hide implementation details and allow to make some parameters check.
class GoogleChrome: Client {
init() {
super.init(urlScheme:"googlechrome-x-callback")
}
func open(url: String, ...) {
self.perform(action: "open", parameters: ["url": url], ...)
}
}
see full sample into Clients directory. (You can PR to add new Client
classes)
You can check that an application respond to the URL scheme using client.appInstalled
Use callback closure
Callbacks allow you to receive data from the target applications, but before doing this you need to add x-callback-url support to your app.
Then you can specify one of the 3 x-callbacks: success, failure and cancel.
try client.perform(action: "actionName",
onSuccess: { parameters in
},
onFailure: { error in
},
onCancel: {
}
)
Add x-callback-url support to your app
Register your URL scheme
Apps can declare any custom URL schemes they support. Use the URL Types section of the Info tab to specify the custom URL schemes that your app handles.
Or register your URL Scheme directly into Info.plist file:
- Add URL Types, then within Item 0
- Set Document Role to Editor.
- URL Identifier to your app bundle ID.
- Create a URL Schemes field and set Item 0 to the URL Scheme you want to use.
Apple documentation: Using URL Schemes to Communicate with Apps.
Setup framework with URL scheme
Then you must set the scheme to this framework manager
let manager = Manager.shared
manager.callbackURLScheme = "my-application-scheme"
// or get the first from Info.plist using utility method
manager.callbackURLScheme = Manager.urlSchemes?.first
Handle incoming URLs
And finally to handle incoming URLs, your application delegate should implement the following methods below.
On iOS
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
manager.handleOpen(url: url)
return true
}
On OSX if you have no other need with URL events you can let manager do all the job by calling into applicationDidFinishLaunching
the method Manager.instance.registerToURLEvent()
Add new action
The client application will interact with your application using the following URL Structure.
[url-scheme]://x-callback-url/[action]?[x-callback parameters]&[action parameters]
An action is defined by its name (the url path), and optional action parameters
.
manager["myActionName"] = { parameters, success, failure, cancel in
// action code, using or not the parameters
...
// notify the client app with one of the callback
success(nil) // or failure(exception)
}
You can also register an action on shared Manager
instance using
CallbackURLKit.register(action: "myActionName") { parameters, success, failure, cancel in
}
Installation
Using CocoaPods
CocoaPods is a centralized dependency manager for Objective-C and Swift. Go here to learn more.
Add the project to your Podfile.
use_frameworks! pod 'CallbackURLKit'
Run
pod install
and open the.xcworkspace
file to launch Xcode.
Clients
To get an already implemented Clients use one of the subspec
pod 'CallbackURLKit/GoogleChrome'
pod 'CallbackURLKit/Ulysses' // https://ulyssesapp.com
Links
*Note that all licence references and agreements mentioned in the CallbackURLKit README section above
are relevant to that project's source code only.