마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

GCM 푸시 질문이요 ㅠ

0 추천
앱을 실행 하고 푸시을 보내면 잘 날라 오는대

앱을 닫고 푸시을 보내면 앱 오류가 뜨면서 종료가 되버리네요 ㅠ

백그라운드에서 실행이 안되는거 같은대

혹시 아시는분 답변 부탁 드립니다. ㅠ

 

퍼미션 권한두 전부 들어가 있습니다. ~

 

<activity

android:name="com.test_App.Popup"

android:excludeFromRecents="true"

android:allowTaskReparenting="true"

android:screenOrientation="portrait"

android:theme="@android:style/Theme.Translucent" />

<activity android:exported="true" android:name="com.plugin.gcm.PushHandlerActivity" />

 <activity

android:name="com.test_App.popup.ShareDialog"

android:screenOrientation="portrait"

android:theme="@android:style/Theme.Translucent">

</activity>

<receiver android:name="com.plugin.gcm.CordovaGCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">

<intent-filter>

<action android:name="com.google.android.c2dm.intent.RECEIVE" />

<action android:name="com.google.android.c2dm.intent.REGISTRATION" />

 

<category android:name="com.test_App" />

</intent-filter>

</receiver>

<service android:name="com.plugin.gcm.GCMIntentService" />

 

 

 

11-02 12:15:21.386 8332-8332/com.test_App V/GCMBroadcastReceiver: onReceive: com.google.android.c2dm.intent.RECEIVE
11-02 12:15:21.389 8332-8332/com.test_App V/GCMRegistrar: Setting the name of retry receiver class to com.plugin.gcm.CordovaGCMBroadcastReceiver
11-02 12:15:21.390 8332-8332/com.test_App V/GCMBroadcastReceiver: GCM IntentService class: com.plugin.gcm.GCMIntentService
11-02 12:15:21.394 8332-8332/com.test_App V/GCMBaseIntentService: Acquiring wakelock
11-02 12:15:21.406 8332-8332/com.test_App E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.test_App, PID: 8332
    java.lang.RuntimeException: Unable to start receiver com.plugin.gcm.CordovaGCMBroadcastReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.test_App cmp=com.test_App/com.plugin.gcm.GCMIntentService (has extras) }: app is in background uid UidRecord{ff101d9 u0a276 RCVR idle procs:1 seq(0,0,0)}
        at android.app.ActivityThread.handleReceiver(ActivityThread.java:3397)
        at android.app.ActivityThread.-wrap18(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1780)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
     Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.test_App cmp=com.test_App/com.plugin.gcm.GCMIntentService (has extras) }: app is in background uid UidRecord{ff101d9 u0a276 RCVR idle procs:1 seq(0,0,0)}
        at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1538)
        at android.app.ContextImpl.startService(ContextImpl.java:1484)
        at android.content.ContextWrapper.startService(ContextWrapper.java:663)
        at android.content.ContextWrapper.startService(ContextWrapper.java:663)
        at com.google.android.gcm.GCMBaseIntentService.runIntentInService(GCMBaseIntentService.java:282)
        at com.google.android.gcm.GCMBroadcastReceiver.onReceive(GCMBroadcastReceiver.java:55)
        at android.app.ActivityThread.handleReceiver(ActivityThread.java:3390)
        at android.app.ActivityThread.-wrap18(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1780)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.test_App cmp=com.test_App/com.plugin.gcm.GCMIntentService (has extras) }: app is in background uid UidRecord{68e7395 u0a276 RCVR idle pr
썬썬썬 (150 포인트) 님이 2018년 11월 2일 질문
썬썬썬님이 2018년 11월 2일 수정

2개의 답변

0 추천
 
채택된 답변
Oreo 버전에서 백그라운드 서비스 제한이 많아진것 때문에 생기는 오류같은데요. 검색해보니 JobScheduler를 이용하라는 글들이 보이네요. 이쪽을 알아보시는게 어떨지 싶네요.
익명사용자 님이 2018년 11월 2일 답변
썬썬썬님이 2018년 11월 2일 채택됨
감사 합니다. 참고 해서 알아봐야겠네요 ~~
0 추천
쎄미 (162,410 포인트) 님이 2018년 11월 2일 답변
답변 감사 합니다.~~
...