Reputation: 99
I'm developing an hybrid app using Ionic. The app is receiving incoming calls through SIP communication and it is working fine... except for Android 10 devices.
When the app is in background/foreground it is working as expected. However, when I kill it, it doesn't.
The expected behaviour is at is follows:
The current behaviour (with Android 10) is:
The traces in Android Studio are:
2020-02-05 17:29:01.591 7064-7117/com.qv.app D/Push_FCMService: onMessage - from: XXXXXXXXXXX
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: sender id = XXXXXXXXXXXX
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: normalize extras
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: key = content-available
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: replace key content-available with content-available
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: key = force-start
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: replace key force-start with force-start
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: key = priority
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: replace key priority with priority
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: key = msg
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: replace key msg with msg
2020-02-05 17:29:01.592 7064-7117/com.qv.app D/Push_FCMService: key = notId
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: replace key notId with notId
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: key = title
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: replace key title with title
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: no locale found for key = title, error Value Qvadis of type java.lang.String cannot be converted to JSONObject
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: key = coldstart
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: replace key coldstart with coldstart
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: key = visibility
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: replace key visibility with visibility
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: background
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: message =[null]
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: title =[TestTitle]
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: contentAvailable =[1]
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: forceStart =[1]
2020-02-05 17:29:01.593 7064-7117/com.qv.app D/Push_FCMService: create notification
2020-02-05 17:29:01.612 7064-7117/com.qv.app D/Push_FCMService: Using channel ID = PushPluginChannel
2020-02-05 17:29:01.620 7064-7117/com.qv.app D/Push_FCMService: stored icon=null
2020-02-05 17:29:01.620 7064-7117/com.qv.app D/Push_FCMService: stored iconColor=null
2020-02-05 17:29:01.620 7064-7117/com.qv.app D/Push_FCMService: stored sound=true
2020-02-05 17:29:01.620 7064-7117/com.qv.app D/Push_FCMService: stored vibrate=true
2020-02-05 17:29:01.620 7064-7117/com.qv.app D/Push_FCMService: no icon resource found - using application icon
2020-02-05 17:29:01.621 7064-7117/com.qv.app D/Push_FCMService: create actions: with in-line
2020-02-05 17:29:01.626 7064-7117/com.qv.app D/Push_FCMService: app is not running but we should start it and put in background
2020-02-05 17:29:01.627 7064-7117/com.qv.app I/Timeline: Timeline: Activity_launch_request time:6280056
2020-02-05 17:29:01.634 7064-7088/com.qv.app W/com.qvadis.app: Reducing the number of considered missed Gc histogram windows from 147 to 100
This is the syntax I'm using for the notification:
{"registration_ids":["..xxxx..."], "data":{"visibility":"-1","content-available": "1", "force-start": "1", "priority": 2, "message": "msgTest", "notId": "24", "title": "titleTest"}, "priority":"high" }
Any thoughts? Did any of you encounter this problem before? If any of you need more information, feel free to ask, I'll answer gladly.
Edit: These are the guidelines Android give regarding restrictions on starting activities on Android 10 https://developer.android.com/guide/components/activities/background-starts
Thank you very much in advance, Borja.
Upvotes: 1
Views: 303
Reputation: 99
I've already found a solution to this.
In my case I had to do two different things:
With those two things, I was able to launch the app and show the cordova call UI.
Upvotes: 2