{"action":"created","issue":{"url":"https://api.github.com/repos/OneSignal/OneSignal-Cordova-SDK/issues/422","repository_url":"https://api.github.com/repos/OneSignal/OneSignal-Cordova-SDK","labels_url":"https://api.github.com/repos/OneSignal/OneSignal-Cordova-SDK/issues/422/labels{/name}","comments_url":"https://api.github.com/repos/OneSignal/OneSignal-Cordova-SDK/issues/422/comments","events_url":"https://api.github.com/repos/OneSignal/OneSignal-Cordova-SDK/issues/422/events","html_url":"https://github.com/OneSignal/OneSignal-Cordova-SDK/issues/422","id":357101185,"node_id":"MDU6SXNzdWUzNTcxMDExODU=","number":422,"title":"ERROR: HTTP Request (OSRequestRegisterUser) must contain app_id parameter","user":{"login":"rwillett","id":668923,"node_id":"MDQ6VXNlcjY2ODkyMw==","avatar_url":"https://avatars3.githubusercontent.com/u/668923?v=4","gravatar_id":"","url":"https://api.github.com/users/rwillett","html_url":"https://github.com/rwillett","followers_url":"https://api.github.com/users/rwillett/followers","following_url":"https://api.github.com/users/rwillett/following{/other_user}","gists_url":"https://api.github.com/users/rwillett/gists{/gist_id}","starred_url":"https://api.github.com/users/rwillett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwillett/subscriptions","organizations_url":"https://api.github.com/users/rwillett/orgs","repos_url":"https://api.github.com/users/rwillett/repos","events_url":"https://api.github.com/users/rwillett/events{/privacy}","received_events_url":"https://api.github.com/users/rwillett/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-09-05T07:34:19Z","updated_at":"2018-12-05T19:57:39Z","closed_at":"2018-09-09T08:59:19Z","author_association":"NONE","body":"**Description:**\r\nHi, we've just refactored our code to handle GDPR consent and are getting this error now. Until now we have had OneSignal working well in test systems. We're trying to move from another Push provider.\r\n\r\nAs part of the refactoring of code, we've moved anything to do with OneSignal to after we get consent from the user to store their data, if we never get any consent we never call the OneSignal registration code at all.\r\n\r\n**Environment**\r\n1. onesignal-cordova-plugin 2.4.3 \"OneSignal Push Notifications\"\r\n\r\n2. com.jcesarmobile.IDFVPlugin 1.0.0 \"Identifier For Vendor Plugin\"\r\ncom.rwillett.cordova.plugin.keychainutil 2.0.1 \"KeyChain Plugin for Cordova iOS (No iCloud Sync)\"\r\ncordova-background-geolocation 2.10.1 \"BackgroundGeolocation\"\r\ncordova-plugin-app-version 0.1.9 \"AppVersion\"\r\ncordova-plugin-background-fetch 5.2.1 \"CDVBackgroundFetch\"\r\ncordova-plugin-badge 0.8.7 \"Badge\"\r\ncordova-plugin-cocoalumberjack 0.0.4 \"CocoaLumberjack\"\r\ncordova-plugin-device 1.1.2 \"Device\"\r\ncordova-plugin-dialogs 2.0.1 \"Notification\"\r\ncordova-plugin-email 1.2.6 \"EmailComposer\"\r\ncordova-plugin-insomnia 4.2.0 \"Insomnia (prevent screen sleep)\"\r\ncordova-plugin-ionic-webview 1.1.16 \"cordova-plugin-ionic-webview\"\r\ncordova-plugin-local-notification 0.9.0-beta.3 \"LocalNotification\"\r\ncordova-plugin-network-information 1.1.0 \"Network Information\"\r\ncordova-plugin-splashscreen 5.0.1 \"Splashscreen\"\r\ncordova-plugin-sqlite-2 1.0.4 \"SQLitePlugin\"\r\ncordova-plugin-statusbar 2.4.1 \"StatusBar\"\r\ncordova-plugin-uniquedeviceid 1.3.2 \"UniqueDeviceID\"\r\ncordova-plugin-vibration 3.0.1 \"Vibration\"\r\ncordova-plugin-whitelist 1.3.3 \"Whitelist\"\r\ncordova-plugin-x-toast 2.6.0 \"Toast\"\r\nionic-plugin-keyboard 2.2.1 \"Keyboard\"\r\nlondon.jambuster.cordova.xcodedetector 0.1.2 \"Xcode Detector\"\r\nonesignal-cordova-plugin 2.4.3 \"OneSignal Push Notification\r\n\r\n**Steps to Reproduce Issue:**\r\n  1. Added onesignal-cordova-plugin 2.4.3 to project. \r\n  2. We have NOT initialized the plugin as we are awaiting consent from the user. \r\n  3. Wait for a few seconds (circa 10-15) and we get the error.\r\n  4. We have set the OneSignal debug level to 6 and nothing appears from OnSignal until this error pops up. Which is what we would expect as we have NOT called the registration code at this stage.\r\n\r\n```\r\n2018-09-05 07:50:22.983 Jambuster[30132:224937] ERROR: HTTP Request (OSRequestRegisterUser) must contain app_id parameter\r\n2018-09-05 07:50:22.984 Jambuster[30132:224069] ERROR: Encountered error during push registration with OneSignal: Error Domain=OneSignalError Code=-1 \"(null)\" UserInfo={error=HTTP Request (OSRequestRegisterUser) must contain app_id parameter}\r\n2018-09-05 07:50:22.984 Jambuster[30132:224069] ERROR: Encountered error during email registration with OneSignal: (null)\r\n```\r\n\r\nWe can see that there is a similiar issue at\r\n\r\nhttps://github.com/OneSignal/OneSignal-Unity-SDK/issues/77 \r\n\r\nwhere we are requested to reopen the issue. Since this is Cordova rather than Unity we have opened it here.\r\n"},"comment":{"url":"https://api.github.com/repos/OneSignal/OneSignal-Cordova-SDK/issues/comments/444623961","html_url":"https://github.com/OneSignal/OneSignal-Cordova-SDK/issues/422#issuecomment-444623961","issue_url":"https://api.github.com/repos/OneSignal/OneSignal-Cordova-SDK/issues/422","id":444623961,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDYyMzk2MQ==","user":{"login":"caipivara","id":76348,"node_id":"MDQ6VXNlcjc2MzQ4","avatar_url":"https://avatars2.githubusercontent.com/u/76348?v=4","gravatar_id":"","url":"https://api.github.com/users/caipivara","html_url":"https://github.com/caipivara","followers_url":"https://api.github.com/users/caipivara/followers","following_url":"https://api.github.com/users/caipivara/following{/other_user}","gists_url":"https://api.github.com/users/caipivara/gists{/gist_id}","starred_url":"https://api.github.com/users/caipivara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caipivara/subscriptions","organizations_url":"https://api.github.com/users/caipivara/orgs","repos_url":"https://api.github.com/users/caipivara/repos","events_url":"https://api.github.com/users/caipivara/events{/privacy}","received_events_url":"https://api.github.com/users/caipivara/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T19:57:39Z","updated_at":"2018-12-05T19:57:39Z","author_association":"NONE","body":"Im getting hte same error, how @rwillett did you solve it?\r\n\r\nUm using:\r\n\r\n```\r\n            var iosSettings = {};\r\n            iosSettings[\"kOSSettingsKeyAutoPrompt\"] = true;\r\n            iosSettings[\"kOSSettingsKeyInAppLaunchURL\"] = false;\r\n            \r\n            var notificationOpenedCallback = function(jsonData) {\r\n                console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));\r\n            };\r\n            \r\n            window.plugins.OneSignal.startInit(\"my-app-id\")\r\n            .handleNotificationOpened(notificationOpenedCallback)\r\n            .iOSSettings(iosSettings)\r\n            .inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.Notification)\r\n            .setSubscription(true)\r\n            .allowNotification(true)\r\n            .setLogLevel({logLevel: 6, visualLevel: 6})\r\n            .endInit();\r\n```\r\n"}}
{"actor":{"display_login":"caipivara"}}