app_id not found. You may be missing a Content-Type: application/json header.
Here i am init onesignal in my AppController and done everything. But it says your app_id is not found. How i can solve this.
@paveltech Make sure you have onesignal_app_id set in your build.gradle to your OneSignal app_id as noted in step 1.3 below.
https://documentation.onesignal.com/docs/android-sdk-setup
If this does not help please attach the logcat log showing the error. As well as your build.gradle and AndroidManifest.xml as we can take a look.
@paveltech Closing due to inactivity. We can reopen this issue if you can provide some of the details above or any other additional information.
I get the same error
@Ebraheemb Did you try the suggestions in the my message above? https://github.com/OneSignal/OneSignal-Android-SDK/issues/456#issuecomment-370175437 Please provide the files noted in the comments if it doesn't help.
I got the same return too, i have to send this message and title: 'Nova atualização para você', if i remove 'ç', 'ã' and 'ê', it works fine, i have to do something on php where i create the message, do you guys know what to do?
I tried header('Content-Type: application/json; charset=utf-8'); but no success.
I have same error. +1 Any solution ? Regards.
@Flaviocrtt Can you try the PHP example code from the OneSignal documentation below? https://documentation.onesignal.com/reference#section-send-to-all-subscribers-create-notification If this doesn't help I recommend contacting OneSignal support with more details since your making the request from PHP and your issue isn't related to the Android SDK.
@ggobea Please try double check everything noted in https://github.com/OneSignal/OneSignal-Android-SDK/issues/456#issuecomment-370175437 above. If this doesn't help please set OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE); before initializing OneSignal and use the following guide to get the full logcat from the device to help debug the issue.
https://documentation.onesignal.com/docs/troubleshooting-android#section-how-to-get-a-crash-or-error-log-from-an-android-device
@jkasten2 thanks for the answer. Inserting the headings and contents using utf8_encode() works fine and send correctly messages in portuguese like 'solicitação para você', my php code uses windows-1252 encoding.
$headings = [
"pt" => utf8_encode($this->Titulo)
];
$content = [
"pt" => utf8_encode($this->Mensagem)
];