Hello,
I am currently blocked for my app publishing because of the non detection of the app bridge connector.
I already submited 3 times without issue. The last blocking from shopify was about using our Auth inside the admin isntead of using a shopify url input. What we did by adding some Oauth page as silent redirect and popup.
Since that we got the blocking message:
That translate into:
Integrated App Checks
Automatically checked every 2 hours. Log in and interact with your app on a development store to generate visit data.
Use of the latest App Bridge script loaded from Shopify’s CDN
Use of session tokens for user authentication
I of course navigate my app and waiting 2h but the error persist.
I use
<script src="https://unpkg.com/@shopify/app-bridge"></script>
to load app bridge code and do something like:
const shopify_init = async (shopifyApiKey, verify_token_url, redirectUri) => {
var AppBridge = window["app-bridge"];
var AppBridgeUtils = AppBridge.utilities;
const params = new URLSearchParams(window.location.search);
const host = getHost(params);
const shop = getShop(params);
const app = AppBridge.createApp({ apiKey: shopifyApiKey, host: host });
if (redirectUri) {
app.loading(true);
const url = new URL(decodeURIComponent(redirectUri));
if (
[location.hostname, "admin.shopify.com"].includes(url.hostname) ||
url.hostname.endsWith(".myshopify.com")
) {
window.open(url, "_top");
} else {
throw new Error(
"Les applications ne peuvent utiliser que /exitiframe pour atteindre Shopify ou l'application elle-même."
);
}
}
try {
const token = await AppBridgeUtils.getSessionToken(app);
const response = await fetch(verify_token_url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-CSRFToken": "{{ csrf_token }}",
},
body: JSON.stringify({ token: token }),
});
const data = await response.json();
if (!data.success) {
throw new Error(data.error || "Erreur d'authentification");
} else {
}
} catch (error) {
console.error("Erreur Shopify :", error);
throw new Error("Erreur d'authentification");
}
return shop;
};
Other difference is that before this code was directly set in the html page and now it is in is specific js file that loaded in the html file.
I really doesn’t understand why it was working before and not anymore.
