Onesignal requesting URL with APP_ID from SDK?

Asked

Viewed 66 times

1

I’m using the code of OneSignal and I am not able to subscribe to users, because by accepting, it gives an error A bad HTTP response code (403) was received when fetching the script.. He’ll get the file OneSignalSDKWorker.jsbut still asks for my AP_ID together, even if not specifying this request, IE, asks this /OneSignalSDKWorker.js?appId=A_MINHA_APP_ID.

Here’s the code

<link rel="manifest" href="/manifest.json" />
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script>
<script>
  var OneSignal = window.OneSignal || [];
  OneSignal.push(function() {
    OneSignal.init({
      appId: "A_MINHA_APP_ID",
    });
  });
</script>

1 answer

0

In Onesignal’s doc, the call for this is different:

https://documentation.onesignal.com/docs/web-push-sdk

var OneSignal = OneSignal || [];

OneSignal.push(["init", {
  appId: "YOUR_APP_ID",
  // Your other init settings
}]);

Note that this goes from version to version, I’ve had problems with it for a stupid detail that they changed and all my apps stop working push.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.