Enableing Facebook Users to Make posts
up vote
0
down vote
favorite
I was able to set up my app so that a user can register with an email and password and was able to make a post but when I integrated the facebook login, I was not able to make any posts (writing to Firebase), I looked into permissions that might be necessary for those users but wasnt able to find anything. The following is my code for my posting to firebase
@IBAction func handlePostButton(_ sender: Any)
guard let userProfile = UserService.currentUserProfile else return
//Firebase code
//Lets make a reference to the database
let postref = Database.database().reference().child("posts").childByAutoId() //This will assign this post a specific identifier that we can reference it by.
//This is referencing the place where you write a post
let postObject = [
"author":[
"uid": userProfile.uid,
"photoURL": userProfile.photoURL.absoluteString,
"username": userProfile.username
],
"text": textView.text,
"timestamp": [".sv": "timestamp"] //This is actually getting the time from Firebase, this is a server value.
] as [String:Any]
postref.setValue(postObject, withCompletionBlock: Error, ref in
if Error == nil
self.dismiss(animated: true, completion: nil)
else
self.creatAlert(title: "Error", message: "Error making a Post!")
)
not sure what else I should put up.
ios swift firebase-realtime-database firebase-authentication facebook-login
|
show 1 more comment
up vote
0
down vote
favorite
I was able to set up my app so that a user can register with an email and password and was able to make a post but when I integrated the facebook login, I was not able to make any posts (writing to Firebase), I looked into permissions that might be necessary for those users but wasnt able to find anything. The following is my code for my posting to firebase
@IBAction func handlePostButton(_ sender: Any)
guard let userProfile = UserService.currentUserProfile else return
//Firebase code
//Lets make a reference to the database
let postref = Database.database().reference().child("posts").childByAutoId() //This will assign this post a specific identifier that we can reference it by.
//This is referencing the place where you write a post
let postObject = [
"author":[
"uid": userProfile.uid,
"photoURL": userProfile.photoURL.absoluteString,
"username": userProfile.username
],
"text": textView.text,
"timestamp": [".sv": "timestamp"] //This is actually getting the time from Firebase, this is a server value.
] as [String:Any]
postref.setValue(postObject, withCompletionBlock: Error, ref in
if Error == nil
self.dismiss(animated: true, completion: nil)
else
self.creatAlert(title: "Error", message: "Error making a Post!")
)
not sure what else I should put up.
ios swift firebase-realtime-database firebase-authentication facebook-login
make a post where exactly? on facebook? in your app?
– luschn
Nov 10 at 8:58
@luschn make a post in my app, but the actual question is just writing to the firebase
– user443902
Nov 10 at 14:34
ok, but right now all we know is "it does not work", you need to be more specific. did you debug it?
– luschn
Nov 11 at 14:21
@luschn I tried but couldn’t get any resolution, I already have my rules set for auth users to write and read posts, I’m not sure if my Facebook user is considered “authenticated”
– user443902
Nov 11 at 14:22
Could you confirm thatFacebook
is enabled (and you provided AppID and App Secret) in the "sign-in method" configuration for Authentication in Firebase?
– Peter Pajchl
Nov 13 at 17:28
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I was able to set up my app so that a user can register with an email and password and was able to make a post but when I integrated the facebook login, I was not able to make any posts (writing to Firebase), I looked into permissions that might be necessary for those users but wasnt able to find anything. The following is my code for my posting to firebase
@IBAction func handlePostButton(_ sender: Any)
guard let userProfile = UserService.currentUserProfile else return
//Firebase code
//Lets make a reference to the database
let postref = Database.database().reference().child("posts").childByAutoId() //This will assign this post a specific identifier that we can reference it by.
//This is referencing the place where you write a post
let postObject = [
"author":[
"uid": userProfile.uid,
"photoURL": userProfile.photoURL.absoluteString,
"username": userProfile.username
],
"text": textView.text,
"timestamp": [".sv": "timestamp"] //This is actually getting the time from Firebase, this is a server value.
] as [String:Any]
postref.setValue(postObject, withCompletionBlock: Error, ref in
if Error == nil
self.dismiss(animated: true, completion: nil)
else
self.creatAlert(title: "Error", message: "Error making a Post!")
)
not sure what else I should put up.
ios swift firebase-realtime-database firebase-authentication facebook-login
I was able to set up my app so that a user can register with an email and password and was able to make a post but when I integrated the facebook login, I was not able to make any posts (writing to Firebase), I looked into permissions that might be necessary for those users but wasnt able to find anything. The following is my code for my posting to firebase
@IBAction func handlePostButton(_ sender: Any)
guard let userProfile = UserService.currentUserProfile else return
//Firebase code
//Lets make a reference to the database
let postref = Database.database().reference().child("posts").childByAutoId() //This will assign this post a specific identifier that we can reference it by.
//This is referencing the place where you write a post
let postObject = [
"author":[
"uid": userProfile.uid,
"photoURL": userProfile.photoURL.absoluteString,
"username": userProfile.username
],
"text": textView.text,
"timestamp": [".sv": "timestamp"] //This is actually getting the time from Firebase, this is a server value.
] as [String:Any]
postref.setValue(postObject, withCompletionBlock: Error, ref in
if Error == nil
self.dismiss(animated: true, completion: nil)
else
self.creatAlert(title: "Error", message: "Error making a Post!")
)
not sure what else I should put up.
ios swift firebase-realtime-database firebase-authentication facebook-login
ios swift firebase-realtime-database firebase-authentication facebook-login
edited Nov 10 at 0:43
Frank van Puffelen
221k25362387
221k25362387
asked Nov 9 at 23:53
user443902
105
105
make a post where exactly? on facebook? in your app?
– luschn
Nov 10 at 8:58
@luschn make a post in my app, but the actual question is just writing to the firebase
– user443902
Nov 10 at 14:34
ok, but right now all we know is "it does not work", you need to be more specific. did you debug it?
– luschn
Nov 11 at 14:21
@luschn I tried but couldn’t get any resolution, I already have my rules set for auth users to write and read posts, I’m not sure if my Facebook user is considered “authenticated”
– user443902
Nov 11 at 14:22
Could you confirm thatFacebook
is enabled (and you provided AppID and App Secret) in the "sign-in method" configuration for Authentication in Firebase?
– Peter Pajchl
Nov 13 at 17:28
|
show 1 more comment
make a post where exactly? on facebook? in your app?
– luschn
Nov 10 at 8:58
@luschn make a post in my app, but the actual question is just writing to the firebase
– user443902
Nov 10 at 14:34
ok, but right now all we know is "it does not work", you need to be more specific. did you debug it?
– luschn
Nov 11 at 14:21
@luschn I tried but couldn’t get any resolution, I already have my rules set for auth users to write and read posts, I’m not sure if my Facebook user is considered “authenticated”
– user443902
Nov 11 at 14:22
Could you confirm thatFacebook
is enabled (and you provided AppID and App Secret) in the "sign-in method" configuration for Authentication in Firebase?
– Peter Pajchl
Nov 13 at 17:28
make a post where exactly? on facebook? in your app?
– luschn
Nov 10 at 8:58
make a post where exactly? on facebook? in your app?
– luschn
Nov 10 at 8:58
@luschn make a post in my app, but the actual question is just writing to the firebase
– user443902
Nov 10 at 14:34
@luschn make a post in my app, but the actual question is just writing to the firebase
– user443902
Nov 10 at 14:34
ok, but right now all we know is "it does not work", you need to be more specific. did you debug it?
– luschn
Nov 11 at 14:21
ok, but right now all we know is "it does not work", you need to be more specific. did you debug it?
– luschn
Nov 11 at 14:21
@luschn I tried but couldn’t get any resolution, I already have my rules set for auth users to write and read posts, I’m not sure if my Facebook user is considered “authenticated”
– user443902
Nov 11 at 14:22
@luschn I tried but couldn’t get any resolution, I already have my rules set for auth users to write and read posts, I’m not sure if my Facebook user is considered “authenticated”
– user443902
Nov 11 at 14:22
Could you confirm that
Facebook
is enabled (and you provided AppID and App Secret) in the "sign-in method" configuration for Authentication in Firebase?– Peter Pajchl
Nov 13 at 17:28
Could you confirm that
Facebook
is enabled (and you provided AppID and App Secret) in the "sign-in method" configuration for Authentication in Firebase?– Peter Pajchl
Nov 13 at 17:28
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53234735%2fenableing-facebook-users-to-make-posts%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
make a post where exactly? on facebook? in your app?
– luschn
Nov 10 at 8:58
@luschn make a post in my app, but the actual question is just writing to the firebase
– user443902
Nov 10 at 14:34
ok, but right now all we know is "it does not work", you need to be more specific. did you debug it?
– luschn
Nov 11 at 14:21
@luschn I tried but couldn’t get any resolution, I already have my rules set for auth users to write and read posts, I’m not sure if my Facebook user is considered “authenticated”
– user443902
Nov 11 at 14:22
Could you confirm that
Facebook
is enabled (and you provided AppID and App Secret) in the "sign-in method" configuration for Authentication in Firebase?– Peter Pajchl
Nov 13 at 17:28