Closed mozhn closed 3 years ago
I added the following code to understand exactly where I am experiencing the problem. Toast appears when the application is closed. In this case my startActivity code doesn't work. Is there anything that could cause this?
Toast.makeText(getApplicationContext(),"NOTIFICATION RECEIVED",Toast.LENGTH_LONG).show();
Hi @mozhn , Android 10 (API level 29) and higher place restrictions on when apps can start activities when the app is running in the background. I think your emulator API level is lower than 29. So that your startActivity method work successfully in emulator. But Mate 20 Pro has API level 29 and you can not start activity. You can examine this document : Activities Background Start
I specifically checked the emulators I tested. It worked smoothly on the emulator with Android 10. In the model I mentioned, I cannot start an activity even if the application does not close completely. I wonder how apps like WhatsApp do this.
Hello, first of all thank your for providing this repository. I have an app that starts the app when I get a data notification and then shows the call screen. The application needs to start via startActivity. Everything works as it should when I tested it with emulators included in AppGallery Developer. However, I found out that this feature was not working properly on a customer's device.
Customer device model: Huawei Mate 20 Pro
My HmsPushMessageService.java file