I can't add code in Studio-Designer-Injections.
I paste it, but the submit button doesn't work.
UNA version 14.
-
- · PavelS
- ·
It seems to me that you are trying to enter everything twice, once in the UNA administration and once in Injection. Of course I could be wrong, it's not enough information
-
-
·
LeonidS
- ·
Hello @Claudio Acosta !
First of all, this code looks like the OneSignal integration. In this case, you don't need to insert it because UNA already has the necessary code for that just enter your key and secret in the Studio->Settings->Push notifications area.
Second point is placed in the disabled possibility to insert the complex Javascript code to the server by security reasons.
-
·
LeonidS
-
Hi Leonid
Yes, it's the OneSignal integration.
Specifically, what I did was configure the "OneSignal: App ID" and "OneSignal: REST API Key" fields in Studio->Settings->Push. Then I uploaded the OneSignalSDKWorker file to the root directory of my website.
Is this correct, or should I not upload that file?
Anyway, I tried both with and without the .js file in the root directory, and it doesn't work either way. The subscription window never appears.
-
Hi Pavel
Thanks for your interest.
What I did was what I just wrote to Leonid.
-
Hello, I think there is no need to upload OneSignalSDKWorker because UNA already contains it and it is in plugins_public. What I wrote in the first post is that you cannot have OneSignal 2x. Once in administration in UNA and in Injection.They will fight each other and it will not work.
-
Hi @PavelS
The only thing currently configured is "OneSignal: App ID" in Studio-Settings-Push, and it's not working. The pop-up window to allow or disable notifications isn't appearing. My web is https://trabajoar.ar
-
Check if you have the address correctly..Your Site URL must exactly match your actual domain. For example, https://trabajoar.ar is not the same as https://www.trabajoar.ar.
And then check that the OneSignalSDKWorker.js file is accessible directly from the domain.
-
You didn't insert the RET API Key in the settings, that's why you have the Javascript error like:
{"errors":["app_id must be a valid UUID"]}So it would be good to fix this point first and check how it will affect.
-
- · Claudio Acosta
- ·
After clearing my browsing data (which I've always done), the subscription worked; that is, the pop-up window appeared asking if I wanted to subscribe to notifications. It's worth mentioning that I agreed to subscribe to notifications, then clicked "Allow" in the pop-up window. But the welcome notification never appears, even though I configured "Send welcome notification after subscribing" in OneSignal.
At this point, the only thing I had configured was the OneSignal App ID in Studio-Settings-Push.
However, the OneSignal dashboard showed that I had only subscribed via email.
So I added the OneSignalSDKWorker.js file to the root directory of my website, cleared my browsing data again, and went back to https://trabajoar.ar. This time, after agreeing to receive notifications, the OneSignal dashboard showed two subscriptions: one via email and one via push notifications. I don't know if there's a connection or if it was just a coincidence.
That's as far as I got. I tried sending a test push notification from OneSignal, and I sent it, but it's not arriving.
In Studio-Settings-Push, I didn't enter anything in "REST API Key" because I'm not sure how to get this information. I assume I need to add a key (screenshot attached), but it says there that it shouldn't be exposed, so I don't understand. When I add a key, a very long string is automatically generated. I'm not sure if that string is the REST API key or if I should use a different string called "key id".
Thank you very much.
-
Hello @Claudio Acosta The REST API Key must remain secret — that’s why OneSignal warns you not to expose it publicly. But that does NOT mean you shouldn’t enter it anywhere.
The key you created should be placed in: Studio → OneSignal → REST API Key ----- It's exactly the one you created according to the screenshot you sent.
Previously, OneSignal only registered your email subscription because the REST API Key wasn’t configured as dear @LeonidS mentioned.
But do NOT share your REST API Key anywhere publicly!!!
-
Hi @PavelS
I added the REST API key in Studio > Settings > Push.
Now both subscriptions appear in OneSignal (email and push).
What I still can't get working is for a test push notification to arrive.
Thank you so much for your help.