OneSignal-Android-SDK icon indicating copy to clipboard operation
OneSignal-Android-SDK copied to clipboard

app_id not found. You may be missing a Content-Type: application/json header.

Open pavelsust opened this issue 8 years ago • 8 comments

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.

pavelsust avatar Mar 03 '18 09:03 pavelsust

@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.

jkasten2 avatar Mar 03 '18 19:03 jkasten2

@paveltech Closing due to inactivity. We can reopen this issue if you can provide some of the details above or any other additional information.

jkasten2 avatar Mar 21 '18 05:03 jkasten2

whatsapp image 2018-04-30 at 15 07 45 I get the same error

Ebraheemb avatar Apr 30 '18 12:04 Ebraheemb

@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.

jkasten2 avatar May 02 '18 22:05 jkasten2

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.

Flaviocrtt avatar Aug 17 '18 16:08 Flaviocrtt

I have same error. +1 Any solution ? Regards.

ggobea avatar Sep 14 '18 06:09 ggobea

@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 avatar Sep 20 '18 03:09 jkasten2

@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) ];

Flaviocrtt avatar Mar 18 '19 19:03 Flaviocrtt