https://github.com/queue-inc/rhyme
A website wrapper for iOS.
https://github.com/queue-inc/rhyme
Last synced: about 1 month ago
JSON representation
A website wrapper for iOS.
- Host: GitHub
- URL: https://github.com/queue-inc/rhyme
- Owner: Queue-inc
- License: mit
- Created: 2020-08-26T10:29:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-04T07:15:12.000Z (over 5 years ago)
- Last Synced: 2025-03-21T09:48:05.892Z (over 1 year ago)
- Language: Swift
- Size: 13.9 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rhyme
[](https://travis-ci.org/subdiox/Rhyme)
[](https://cocoapods.org/pods/Rhyme)
[](https://cocoapods.org/pods/Rhyme)
[](https://cocoapods.org/pods/Rhyme)
Rhyme is a wrapper library for PWA/web applications, implementing push notifications and in-app purchase.
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
- Firebase environment
- A website using rhyme-js
## Installation
Rhyme is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'Rhyme'
```
## Usage
0. Read [Firebase Cloud Messaging Documentation](https://firebase.google.com/docs/cloud-messaging/ios/client) and add `GoogleService-Info.plist` to your Xcode project.
1. Define a view controller which extends `RhymeViewController`, and implement `delegate` and `url` as following:
```swift:ViewController.swift
class ViewController: RhymeViewController {
override func viewDidLoad() {
delegate = self
url = URL(string: "https://www.example.com")
super.viewDidLoad()
}
}
extension ViewController: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
print(response)
}
}
```
2. Add some codes to configure Firebase in `AppDelegate`.
```swift:AppDelegate.swift
import Firebase
import FirebaseMessaging
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
Messaging.messaging().delegate = self
return true
}
}
```
## Author
Queue-inc, info@queue-inc.com
## License
Rhyme is available under the MIT license. See the LICENSE file for more info.