We integrated the talk SDK according to the official document: https://developer.zendesk.com/documentation/classic-web-widget-sdks/talk-sdk/android/getting_started/, but it will be crashed when start a call.SDK version: zendesk.talk:talk-android:1.1.0
Operating system version: Android 12
Compile SDK version: 31
Target SDK version: 31
Logger results:
Fatal Exception: java.lang.RuntimeException: Unable to start service zendesk.talk.android.internal.call.service.TalkCallService@e59b040 with Intent { cmp=com.hhyu.neuron/zendesk.talk.android.internal.call.service.TalkCallService (has extras) }: java.lang.IllegalArgumentException: com.hhyu.neuron: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5112)
at android.app.ActivityThread.access$2200(ActivityThread.java:310)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2321)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8641)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)
Initialization code:
Zendesk.INSTANCE.init(
applicationContext,
BuildConfig.ZENDESK_URL,
BuildConfig.ZENDESK_APP_ID,
BuildConfig.ZENDESK_CLIENT_ID
)
val identity = AnonymousIdentity.Builder()
.withEmailIdentifier(user.email)
.withNameIdentifier(user.username)
.build()
Zendesk.INSTANCE.setIdentity(identity)
Related code:
val talk = Talk.create(Zendesk.INSTANCE) talk.startCallSetupFlow(this, digitalLine, null)
Root cause:
If your app targets Android 12, you must specify the mutability of each PendingIntent object that your app creates. This additional requirement improves your app’s security.https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability