Hello everyone,
I just want to ask you guys a quick question. If you want to skip the text you can go to the summary question section on the bottom. Below you will see my code about the Facebook share. If the user is logged in, I check if the user has the “publish_actions” permission. If I find this permission, I use FB.ShareLink and also write this permission on the screen.
What I do not understand is when I try it with my facebook account, and close all the platform connections and permission through settings, I still can share and can see the “publish_actions” permission on the screen. I know that sharelink does not require “publish_actions” permission but you can see that in the code I only share if the user grants this permission. It does not matter if I login before share or login while sharing.
And I also tried to Loginwithpublishpermissions first. When I do that facebbok just asks for permission for standart properties. Mybe it is because I need to send the app to facebook for review or not I dont know but this still does not explain everything. But this is a seperate issue I guess, probably it has something to do with coding or developer page or app review.
Summary question :
What I wonder is, how come I have the “publish_actions” permission even tough I make a default login and my app does not ask for a permission?
I am also Logging with publishpermissions If I can not find the permission in the token,too. But I am not sharing all the code to keep it short, actually I am just sharing the necessary main parts.
Thanks in advnace for your help, I really want to understand the reason behind this.
void Awake()
{
if (!FB.IsInitialized) {
FB.Init (InitCallback, OnHideUnity);
} else {
FB.ActivateApp ();
}
permissionTextObject = GameObject.FindObjectOfType ();
}
public void FaceLogin(){
FB.LogInWithPublishPermissions (new List(){“publish_actions”} , AuthCallback);
}
public void FaceShare(){
AccessToken aToken = Facebook.Unity.AccessToken.CurrentAccessToken;
foreach (string permission in aToken.Permissions) {
if (permission == “publish_actions”) {
FB.ShareLink(
new System.Uri(“https://google.com.tr”),
callback: ShareCallback
);
permissionTextObject.gameObject.GetComponent().text = permission;
publishPermission = true;
return;
}
}
}