perfecty-push-wp icon indicating copy to clipboard operation
perfecty-push-wp copied to clipboard

Browser is not supported or the SDK is not enabled

Open 18rrs opened this issue 3 years ago • 5 comments

installed 3 times in a row and the same message is shown in browser: Browser is not supported or the SDK is not enabled settings are plugins default. browser chrome, edge, firefox.. same error "/perfectly/push" is not created and i dont know if its suppose to i have Vapid private and public keys in form. please.. what i dont do or what is the problem?

18rrs avatar Apr 12 '22 10:04 18rrs

Hi @themsk666 did you enable the Public Widget in https://docs.perfecty.org/wp/configuration/#1-public-widget ?

rwngallego avatar Apr 16 '22 09:04 rwngallego

Hi @rwngallego, of course i have enabled. I dont know what else cand i do. Thank for you reply.

18rrs avatar Apr 16 '22 09:04 18rrs

Our check function looks like this:

const start = async (customOptions = {}) => {
  ...

  if (!isSupportedAndEnabled()) {
    Logger.info('Browser is not supported or the SDK is not enabled')
    return false
  }

  const isSupportedAndEnabled = () => {
    return (Features.isSupported() && Options.enabled)
  }

  const isSupported = () => {
    return ('PushManager' in window) && ('serviceWorker' in window.navigator)
  }
  ...
}

so if ('PushManager' in window) && ('serviceWorker' in window.navigator) returns true in your Chrome developer console, then there's no other reason why we log that message.

rwngallego avatar Apr 16 '22 09:04 rwngallego

the function that return the error looks different on my sdk.min.js.. case 0: if (t = r.length > 0 && void 0 !== r[0] ? r[0] : {}, E.init(t), m({ verbose: E.loggerVerbose, level: E.loggerLevel }), x("Starting Perfecty Push SDK"), w("SDK options", E), te()) { e.next = 8; break } return x("Browser is not supported or the SDK is not enabled"), e.abrupt("return", !1); anyway.. i cant make it work.. :(

18rrs avatar Apr 19 '22 10:04 18rrs

Hi @themsk666 it's the same code, except you're looking at the raw JS vanilla/optimized output, while I was sharing the ES6 equivalent

rwngallego avatar Apr 28 '22 21:04 rwngallego