我尝试在Android 8中制作通知。首先,定义通知渠道时出现了问题。之后,在安卓Oreo之前和安卓pre-Oreo的应用程序运行时,我得到了通知。我尝试使用Job Scheduler、JobIntentService和AsyncTask在应用程序不运行时在安卓Oreo中制作通知,但每次都会崩溃,并显示以下错误信息:
java.lang.RuntimeException: Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.MESSAGING_EVENT pkg=... (has extras) }: app is in background uid UidRecord{9078fd9 u0a148 RCVR idle procs:1 seq(0,0,0)}
我该怎么做才能在Firebase后台制作通知?