Angular 9 App Bridge

fvillar
New Member
1 0 0

Hi all! I'm currently developing a public app with embebed admin site. I'm trying to integrate App Bridge to the application, but without luck.

This is a piece of code trying to display a simple Toast message, it throws no error, the is initialized correctly.

import createApp from '@shopify/app-bridge';
import { Toast } from '@shopify/app-bridge/actions';
...

ngOnInit(): void {
    const app = createApp({
      apiKey: 'THE_API_KEY',
      shopOrigin: 'THE_SHOP.myshopify.com'
    });
const toast = Toast.create(app, {
        message: 'My sample message',
        duration: 3000
});
toast.dispatch(Toast.Action.SHOW);

Also, I have 2 endpoints, one the backend that redirects to installation and other one that render the Angular application.

 

Thanks!

0 Likes