Skip to content

mdab121/swift-fcm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift FCM

Build Status Latest Release Platforms Package Managers License: MIT Twitter Follow

Simple framework for sending Firebase Cloud Messages.

❓ Why?

Do you want to write your awesome server in Swift? At some point, you'll probably need to send Push Notifications to Android as well 😉

✅ Features

  • Full message Payload support: badges and sounds for iOS
  • Response parsing, instant send response feedback
  • Custom data payload support

💻 Installation

Swift Package Manager

.Package(url: "https://github.com/mdab121/swift-fcm.git", majorVersion: 0, minor: 2)

🔢 Usage

Simple Example

Sending a simple FCM Message is really simple. Just create a Firebase object that will deliver your messages.

let firebase = try Firebase(keyPath: "/path/to/your/key")

Create a Message, and send it!

let payload = Payload(message: "Hello SwfitFCM!")
let message = Message(payload: payload)
let token = DeviceToken("this_is_a_device_token")
try firebase.send(message: message, to: token) { response in
  // Check response.success to check if your message was delivered successfully
}

About

Simple Swift framework for sending Firebase Notifications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages