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 unsubscribe button in AMP version #255

Open
Zabi09 opened this issue Oct 10, 2020 · 3 comments
Open

No unsubscribe button in AMP version #255

Zabi09 opened this issue Oct 10, 2020 · 3 comments

Comments

@Zabi09
Copy link

Zabi09 commented Oct 10, 2020

Hello Jason and Team,

I am one of the developers of the AMPforWP plugin and currently, some of our users saying that the one signal unsubscribe button is no more visible after clicking on the subscribe button. See this video - https://monosnap.com/direct/VKlLw5V40vY1QbwuJynXSNjYu6n6QY

And also when I check the same on cloudways its a valid issue - https://wordpress-123147-847862.cloudwaysapps.com/faq-test/amp/

I have debugged a lot and finally found that there is some problem in service-worker-url or in helper-iframe-url and if I remove the code of yours of amp-web-push and add this code which I copied from the AMP https://playground.amp.dev/ then it's working fine

This is the code which is not working

<amp-web-push
id="amp-web-push" l
ayout="nodisplay"
helper-iframe-url="https://wordpress-123147-847862.cloudwaysapps.com/wp-content/plugins/accelerated-mobile-pages/includes/onesignal-integration/amp-helper-frame.html?appId=d46c313e-cc91-4d55-b809-1b41b836d57c"
permission-dialog-url="https://wordpress-123147-847862.cloudwaysapps.com/wp-content/plugins/accelerated-mobile-pages/includes/onesignal-integration/amp-permission-dialog.html?appId=d46c313e-cc91-4d55-b809-1b41b836d57c"
service-worker-url="https://wordpress-123147-847862.cloudwaysapps.com/wp-content/plugins/onesignal-free-web-push-notifications/sdk_files/OneSignalSDKWorker.js.php?appId=d46c313e-cc91-4d55-b809-1b41b836d57c">
</amp-web-push>

==========

This is the code which is working fine

<amp-web-push
id="amp-web-push"
layout="nodisplay"
helper-iframe-url="https://amp.dev/documentation/examples/components/amp-web-push/amp-web-push-helper-frame.html"
permission-dialog-url="https://amp.dev/documentation/examples/components/amp-web-push/amp-web-push-permission-dialog.html"
service-worker-url="https://amp.dev/documentation/examples/components/amp-web-push/sw.js" >
</amp-web-push>

==========

Will you please check once and let us know.

@MohammedKaludi
Copy link

Any update on this issue? @rgomezp @jasonpang

@OneSignal OneSignal deleted a comment from sync-by-unito bot Feb 19, 2021
@rgomezp
Copy link
Contributor

rgomezp commented Jun 30, 2021

Howdy y'all,
Thanks so much for your patience.

I dug into this and the issue seems to be around the helper-frame scope.

As you can see, the amp HTML shows the following in a test app I set up:

<amp-web-push id="amp-web-push" layout="nodisplay" helper-iframe-url="/wp-content/plugins/accelerated-mobile-pages/includes/onesignal-integration/amp-helper-frame.html?appId=a2bbb0ab-a15c-4c20-ba2d-dc06a6a6449b" permission-dialog-url="/wp-content/plugins/accelerated-mobile-pages/includes/onesignal-integration/amp-permission-dialog.html?appId=a2bbb0ab-a15c-4c20-ba2d-dc06a6a6449b" service-worker-url="/wp-content/plugins/onesignal-free-web-push-notifications/sdk_files/OneSignalSDKWorker.js.php?appId=a2bbb0ab-a15c-4c20-ba2d-dc06a6a6449b" class="i-amphtml-element i-amphtml-layout-nodisplay i-amphtml-built" hidden="" i-amphtml-layout="nodisplay"> </amp-web-push>

You will notice that the helper frame is on a different path than the service worker. The problem is that the service worker scope needs to be at an equal or higher scope to include the helper frame path.

Please fix this issue in your plugin and I think we should see it working.

Edit: not only is the button not working, from what I can tell the subscription isn't working either. So the OneSignal integration is currently completely broken with your plugin. Are you seeing otherwise? (e.g: can you send a test message and receive it successfully?)

@rgomezp
Copy link
Contributor

rgomezp commented Jul 7, 2021

@Zabi09 ,
Please see my note above.

For HTTP integrations, it looks like our os.tc helper frame is outdated and needs to be fixed on our side. Thanks for your patience while we try to resolve.

Cheers

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

3 participants