Page Plugin with iFrame does not work in mobile view
For the last few days, the code of Page Plugin's IFrame is not working. The Facebook page is not visible in the mobile view.
You can see how it looks in the picture I attached.
Tony-Marketing-API.cn is a vibrant community dedicated to Facebook, Meta,Google Ads api, app development, Instagram, and related technologies. It offers valuable bug solutions, troubleshooting cases, and problem-solving strategies shared by users. Stay updated with real-world solutions, development tips, and the latest trends in digital marketing and app development.
For the last few days, the code of Page Plugin's IFrame is not working. The Facebook page is not visible in the mobile view.
You can see how it looks in the picture I attached.
I'm creating an automation flow with puppeteer to log in to Facebook and get the User Access Token. The code is a NodeJS code and pretty simple for now:
require("dotenv").config(); const { tagmanager } = require("googleapis/build/src/apis/tagmanager"); const puppeteer = require("puppeteer"); (async () => { // Lança o navegador com a UI visível para que possamos acompanhar o processo const browser = await puppeteer.launch({ headless: false }); const page = await browser.newPage(); // Define a URL para o fluxo de login do Facebook const facebookLoginURL = `https://www.facebook.com/v16.0/dialog/oauth?client_id=${process.env.FB_APP_ID}&redirect_uri=${process.env.FB_REDIRECT_URI}&scope=email,public_profile&response_type=code`; // Vai para a página de login do Facebook await page.goto(facebookLoginURL); // Espera o span com o texto específico "Permitir todos os cookies" await page.waitForFunction(() => { const elements = Array.from(document.querySelectorAll("span")); // Verifica se algum elemento contém o texto "Permitir todos os cookies" const targetElement = elements.find( (element) => element.textContent.trim() === "Permitir todos os cookies" ); // Se o elemento for encontrado, retorna true para sair do loop if (targetElement) { return true; } // Continua o loop se não encontrar o elemento return false; }); // Encontra e clica diretamente com page.click() await page.evaluate(() => { const elements = Array.from(document.querySelectorAll("span")); // Verifica se algum elemento contém o texto "Permitir todos os cookies" const targetElement = elements.find( (element) => element.textContent.trim() === "Permitir todos os cookies" ); if (targetElement) { targetElement.setAttribute("id", "cookie-button"); // Atribui um ID temporário para garantir o seletor } }); await page.click("#cookie-button"); // Usa o seletor id para clicar diretamente // Espera que o campo de email esteja disponível e preenche com o seu usuário de teste await page.waitForSelector("#email"); await page.type("#email", process.env.FB_TEST_USER_EMAIL); // Preenche a senha com a senha do usuário de teste await page.type("#pass", process.env.FB_TEST_USER_PASSWORD); // Clica no botão de login await page.click('button[name="login"]'); // Espera o redirecionamento para a URL de callback await page.waitForNavigation(); // Obtém a URL atual (que deve conter o código de autenticação) const redirectedUrl = page.url(); console.log("Redirected URL:", redirectedUrl); //here we need to handle 2FA //... // Extraia o código da URL de redirecionamento const urlParams = new URLSearchParams(redirectedUrl.split("?")[1]); const authCode = urlParams.get("code"); console.log(`Auth Code: ${authCode}`); await browser.close(); })();
The puppeter code above comprises the following steps:
Open Facebook login page (OK)
Log in with user and password (OK)
Enter 2FA code (not OK)
Get User Access Token (not OK because of 3)
I'm having trouble with step 3, because I don't know how to get the code automatically, i.e. without having to enter it manually. Any solutions?
2FA is enabled in Meta Business Manager and I normally receive this code by SMS or via the Microsoft Authenticator app. I could perhaps disable 2FA for the user in question in the Meta Business Manager, but that's something I wouldn't want to do, as it reduces credibility on the Meta side, which could block the user.
So I'd like to "hear" from you about possible ways of dealing with this. Thanks in advance!
I want to handle with 2FA by using puppeteer to login on Facebook with a normal user account.
My ads account was suddenly deactivated for no reason. I haven't run a single ad in the last 5 years so it is not because of any ad or ad content. I need to run ads again. Here are some of the error messages I am getting: "Your account is restricted right now: You have been temporarily blocked from performing this action. (#2859015)" and "You're Restricted From Advertising. You can't run ads or manage ad accounts." I have submitted over 20 support tickets with no helpful responses from Meta - all form responses and telling me my account actually is active, which it is not. My payment method is valid, I just successfully loaded $1.00 onto the account. Can anyone direct me to someone who can help reactivate my account?
This is my first time trying to do react-native bridge. Problem is it always says it couldnt find the dependency, irrespective of my integration, I should be able to download the dependency right? I am trying to bridge: https://developer.imepay.com.np/#/andriod-sdk
I am not being able to implement the dependecy:
implementation 'com.swifttechnology.imepaysdk:payment-service:4.0.1
In my main/java/imepayintegration: ImepayModule.java:
package com.reactnativeimepay; import androidx.annotation.NonNull; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import java.util.Map; import java.util.HashMap; import com.swifttechnology.imepaysdk.IMEPayment; import com.swifttechnology.imepaysdk.IMEPaymentCallback; import com.swifttechnology.imepaysdk.ENVIRONMENT; public class ImepayModule extends ReactContextBaseJavaModule { private final ReactApplicationContext reactContext; public ImepayModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; } @Override public String getName() { return "ImepayModule"; } @ReactMethod public void performPayment(String merchantCode, String merchantName, String module, String username, String password, String referenceValue, String amount, String merchantTransactionRecordingUrl, Promise promise) { IMEPayment imePayment = new IMEPayment(reactContext, ENVIRONMENT.TEST); imePayment.performPayment(merchantCode, merchantName, merchantTransactionRecordingUrl, amount, referenceValue, module, username, password, new IMEPaymentCallback() { @Override public void onSuccess(int responseCode, String responseDescription, String transactionId, String msisdn, String amount, String refId) { promise.resolve("Payment successful"); } @Override public void onError(int responseCode, String responseDescription) { promise.reject("ERROR", responseDescription); } }); } }
ImepayPackage.java:
package com.reactnativeimepay; import java.util.Arrays; import java.util.Collections; import java.util.List; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; public class ImepayPackage implements ReactPackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Arrays.<NativeModule>asList(new ImepayModule(reactContext)); } @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { return Collections.emptyList(); } }
Hi,
The /me/accounts endpoint is returning an empty arrray, although I've authorized access to several pages and instagram accounts. This was working until about an hour ago but suddenly started failing.
I'm requesting the following scopes:
"read_insights",
"pages_show_list",
"business_management",
"pages_messaging",
"instagram_basic",
"instagram_manage_comments",
"instagram_manage_messages",
"pages_read_engagement",
"pages_manage_metadata",
"pages_read_user_content",
"public_profile"
And the debug_token endpoint returns the expected accounts. But /me/accounts returns this:
{
"data": []
}
What gives?