1
I’m having trouble picking up the id from onesignal device.
I am trying to use the following method:
var getId = function(){
window.plugins.OneSignal.getIds(function(ids) {
alert('getIds: ' + JSON.stringify(ids));
});
}
Before that I am starting the onesginal and is receiving the notifications normally.
window.plugins.OneSignal
.startInit("APP_ID")
.handleNotificationOpened(notificationOpenedCallback)
.endInit();
console is giving this error:
Refused to execute inline Event Handler because it violates the following Content Security Policy Directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-Eval". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline Execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
Besides Cordova, which framework you’re using?!
– viana
none, just testing the notifications
– Jefferson Mello Olynyki
solved changed to this goal <meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' unsafe-inline '*; script-src 'self' unsafe-inline 'unsafe-Eval' *; img-src * data: 'unsafe-inline'">
– Jefferson Mello Olynyki
Cool, you can insert the answer in your question yourself.
– viana