Skip to content

Instantly share code, notes, and snippets.

View atanasovdejan's full-sized avatar

Dejan Atanasov atanasovdejan

View GitHub Profile
@atanasovdejan
atanasovdejan / checkup-privacy
Created July 2, 2019 16:11
checkup-privacy
Privacy Policy
Dejan Atanasov built the CheckUp app as a Free app. This SERVICE is provided by Dejan Atanasov at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at CheckUp unless otherwise defined in this Privacy Policy.
Privacy Policy
Your privacy is important to us. It is Georgian Bible's policy to respect your privacy regarding any information we may collect from you across our website, http://georgianbible.com, and other sites we own and operate.
We only ask for personal information when we truly need it to provide a service to you. We collect it by fair and lawful means, with your knowledge and consent. We also let you know why we’re collecting it and how it will be used.
We only retain collected information for as long as necessary to provide you with your requested service. What data we store, we’ll protect within commercially acceptable means to prevent loss and theft, as well as unauthorised access, disclosure, copying, use or modification.
We don’t share any personally identifying information publicly or with third-parties, except when required to by law.
Our website may link to external sites that are not operated by us. Please be aware that we have no control over the content and practices of these sites, and can
@atanasovdejan
atanasovdejan / UpdateProfileInfo.swift
Created August 4, 2018 11:13
Update Profile Picture and Display Name in Firebase User
func updateProfileInfo(withImage image: Data? = nil, name: String? = nil, _ callback: ((Error?) -> ())? = nil){
guard let user = Auth.auth().currentUser else {
callback?(nil)
return
}
if let image = image{
let profileImgReference = Storage.storage().reference().child("profile_pictures").child("\(user.uid).png")
_ = profileImgReference.putData(image, metadata: nil) { (metadata, error) in
@atanasovdejan
atanasovdejan / ProfileChangeRequest.swift
Created August 4, 2018 11:01
Profile Change Request in Firebase
func createProfileChangeRequest(photoUrl: URL? = nil, name: String? = nil, _ callback: ((Error?) -> ())? = nil){
if let request = Auth.auth().currentUser?.createProfileChangeRequest(){
if let name = name{
request.displayName = name
}
if let url = photoUrl{
request.photoURL = url
}
request.commitChanges(completion: { (error) in
@atanasovdejan
atanasovdejan / FirebasePasswordReset.swift
Created August 4, 2018 10:41
Reset Password for Firebase User
func sendPasswordReset(withEmail email: String, _ callback: ((Error?) -> ())? = nil){
Auth.auth().sendPasswordReset(withEmail: email) { error in
callback?(error)
}
}
@atanasovdejan
atanasovdejan / FirebaseSignOut.swift
Created August 4, 2018 10:17
Sign Out Firebase User
func signOut() -> Bool{
do{
try Auth.auth().signOut()
return true
}catch{
return false
}
}
@atanasovdejan
atanasovdejan / FirebaseReloadUser.swift
Created August 4, 2018 10:13
Firebase reload user details
func reloadUser(_ callback: ((Error?) -> ())? = nil){
Auth.auth().currentUser?.reload(completion: { (error) in
callback?(error)
})
}
@atanasovdejan
atanasovdejan / FirebaseVerifyEmail.swift
Created August 4, 2018 08:38
Verify Email with Firebase
func sendEmailVerification(_ callback: ((Error?) -> ())? = nil){
Auth.auth().currentUser?.sendEmailVerification(completion: { (error) in
callback?(error)
})
}
@atanasovdejan
atanasovdejan / FirebaseLogin.swift
Created August 3, 2018 22:53
Login on Firebase
func login(withEmail email: String, password: String, _ callback: ((Error?) -> ())? = nil){
Auth.auth().signIn(withEmail: email, password: password) { (user, error) in
if let e = error{
callback?(e)
return
}
callback?(nil)
}
}
@atanasovdejan
atanasovdejan / FirebaseRegister.swift
Created August 3, 2018 22:34
Create user with Firebase Authentication
func createUser(email: String, password: String, _ callback: ((Error?) -> ())? = nil){
Auth.auth().createUser(withEmail: email, password: password) { (user, error) in
if let e = error{
callback?(e)
return
}
callback?(nil)
}
}