Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.83 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.83 KB

SPProfiling

Ready use service with using Firebase. Included interface, manage auth process, recored devices and profile data.

Installation

Ready for use on iOS 13+.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Once you have your Swift package set up, adding as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/ivanvorobei/SPProfiling", .upToNextMajor(from: "1.0.2"))
]

Manually

If you prefer not to use any of dependency managers, you can integrate manually. Put Sources/SPProfiling folder in your Xcode project. Make sure to enable Copy items if needed and Create groups.

Usage

First call configure services:

let filePath = Bundle.main.path(forResource: Constants.Firebase.plist_filename, ofType: .empty)!
let options = FirebaseOptions(contentsOfFile: filePath)!
SPProfiling.configure(firebaseOptions: options)

All actions doing from ProfileModel.

ProfileModel.isAuthed
ProfileModel.isAnonymous
ProfileModel.currentProfile

ProfileModel.getProfile(userID...)
ProfileModel.getProfile(email...)

ProfileModel.signInApple(...)
ProfileModel.signInAnonymously(...)
ProfileModel.signOut(...)

let profileModel = ProfileModel.currentProfile
profileModel.setName(...)
profileModel.getAvatarURL(...)
profileModel.setAvatar(...)
profileModel.deleteAvatar(...)

// Ready-use interface
ProfileModel.showCurrentProfile(...)