Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No permission to access this profile getGeneratePreview() error #268

Open
spiritcoder opened this issue Dec 7, 2023 · 0 comments
Open

Comments

@spiritcoder
Copy link

Which SDK version are you using?

Version 18

What's the issue?

I am able to generate an Iframe from the getGeneratePreview() method on ads creative, but can't load the Iframe.

Steps/Sample code to reproduce the issue

const account = new faceBookSDK.AdAccount(adAccountId);

        account
            .getAdCreatives(['id', 'body', 'image_url', 'thumbnail_url', 'object_story_spec'], {})
            .then(async (creatives) => {
                // Process the list of creatives
                const indexdata = creatives[13];
                const creativeFields = faceBookSDK.AdCreative.Fields;

                const creativeField = Object.keys(creativeFields);
                const adCreative = await new faceBookSDK.AdCreative(indexdata._data.id).get(creativeField);
                if (adCreative._data.object_story_speclink_data) {
                    delete adCreative._data.object_story_spec.link_data.image_url;
                } else {
                    delete adCreative._data.object_story_spec.video_data.image_url;
                }
                const generatepreviewss = new faceBookSDK.AdAccount(adAccountId) as any;
                const generatepreviews = await generatepreviewss.getGeneratePreviews(fields, {
                    creative: adCreative,
                    ad_format: 'mobile_feed_standard',
                });
                console.log(generatepreviews);
            })
            .catch((error) => {
                console.error(error);
            });

Observed Results:

It returned an IFrame that we want to preview on the frontend but we can't load the Iframe. It shows

No permission to access this profile
You don't have required permission to access this profile

  • What happened? This could be a description, log output, etc.

Expected Results:

  • What did you expect to happen?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant