NativeScript / nativescript-facebook

NativeScript plugin, wrapper of native Facebook SDK for Android and iOS
Apache License 2.0
79 stars 50 forks source link

Cant Request Publish Permission #60

Closed francorobles closed 6 years ago

francorobles commented 7 years ago

Hi All,

Any idea how to request publish permission after login? Below is my code, but this doesn't seem to work.

var fbLogout = require("nativescript-facebook").logout,
    fbRequestPublishPermissions = require("nativescript-facebook").requestPublishPermissions,
    fbLogin = require("nativescript-facebook").login;

var permissions = ["publish_actions", "user_location", "manage_pages", "publish_pages","pages_show_list"];

                fbLogout(function() {
                    fbLogin(function (err, fbData) {
                        if (err) {
                            alert(err.message);
                        }
                        else {
                            var theToken = fbData.token;
                            fbRequestPublishPermissions(permissions, function() {

                            });
                        }
                    });
                });
tbozhikov commented 7 years ago

Hi @francorobles, do you test this code in the plugin's demo (working with the demo's default FB app), or you are using it with your own FB app? In case you work with the demo's default FB app - requestPublishPermissions will not work because the demo's FB app does not have enabled any of the login permissions you are trying to request. On the other hand, if you use your own FB app, make sure you:

NickIliev commented 6 years ago

Closing due to inactivity