OneSignal/OneSignal-Xamarin-SDK

[Bug]: Cannot receive notifications on Android 13.0

it11111111 opened this issue · 1 comments

What happened?

I am having an issue where notifications are not being received on devices with Android version 13.0 API 33. Notifications work fine in all other android versions and iOS.

I am using:

  • Android project target framework => 13.
  • OneSIgnalSDk - 4.1.3
  • Visual Studio 2022 17.3.6
  • there are no self-signed certificates being used in the app

Steps to reproduce?

1. I have followed the documentation and have placed these on the main and single projects (App.xml.cs, MainActivity.cs & AppDelegate.cs):
OneSignal.Default.Initialize("YOUR_ONESIGNAL_APP_ID");
OneSignal.Default.PromptForPushNotificationsWithUserResponse(true);

2. Notification prompt appears on Android 13.0 and notifications are allowed

3. I try sending a notification from the app, and from OneSIgnal's web UI and no notifications are received.

What did you expect to happen?

I expected the notifications to be received on the device with Android 13.0

OneSignal Xamarin SDK version

Release 4.1.3

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

11-04 15:32:27.033	Samsung SM-S906U1	Info	28707	ShtCoreImpl	(Berry)(1.10)stopSht/current state=false
11-04 15:32:27.033	Samsung SM-S906U1	Info	28707	ShtCoreImpl	(Berry)(1.10)updateRunningCondition : setting(false),conn(true),media(false),wear(false),screen(true),audiopath(true)
11-04 15:32:27.033	Samsung SM-S906U1	Info	28707	ShtCoreImpl	(Berry)(1.10)handleMediaStateUpdated(false)/current internal val : false
11-04 15:32:26.949	Samsung SM-S906U1	Info	910	lmkd	1(delay),0(swap), 0(freelimit) memory pressure events were skipped after a kill!
11-04 15:32:26.885	Samsung SM-S906U1	Warning	21065	OneSignal	Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
	... 39 more
11-04 15:32:26.884	Samsung SM-S906U1	Warning	21065	OneSignal	Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
	at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:654)
	at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:613)
	at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:613)
	at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:503)
	at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:423)
	at com.android.org.conscrypt.TrustManagerImpl.getTrustedChainForServer(TrustManagerImpl.java:351)
	at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:94)
	at android.security.net.config.RootTrustManager.checkServerTrusted(RootTrustManager.java:90)
	at com.android.org.conscrypt.ConscryptEngineSocket$2.checkServerTrusted(ConscryptEngineSocket.java:163)
	at com.android.org.conscrypt.Platform.checkServerTrusted(Platform.java:255)
	at com.android.org.conscrypt.ConscryptEngine.verifyCertificateChain(ConscryptEngine.java:1638)
	at com.android.org.conscrypt.NativeCrypto.ENGINE_SSL_read_direct(Native Method)
	at com.android.org.conscrypt.NativeSsl.readDirectByteBuffer(NativeSsl.java:569)
	at com.android.org.conscrypt.ConscryptEngine.readPlaintextDataDirect(ConscryptEngine.java:1095)
	at com.android.org.conscrypt.ConscryptEngine.readPlaintextData(ConscryptEngine.java:1079)
	... 24 more
11-04 15:32:26.884	Samsung SM-S906U1	Warning	21065	OneSignal	javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
	at com.android.org.conscrypt.SSLUtils.toSSLHandshakeException(SSLUtils.java:363)
	at com.android.org.conscrypt.ConscryptEngine.convertException(ConscryptEngine.java:1134)
	at com.android.org.conscrypt.ConscryptEngine.readPlaintextData(ConscryptEngine.java:1089)
	at com.android.org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:876)
	at com.android.org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:747)
	at com.android.org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:712)
	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:858)
	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.-$$Nest$mprocessDataFromSocket(Unknown Source:0)
	at com.android.org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:241)
	at com.android.org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:220)
	at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:196)
	at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)
	at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
	at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
	at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
	at com.onesignal.OneSignalRestClient.startHTTPConnection(OneSignalRestClient.java:193)
	at com.onesignal.OneSignalRestClient.access$100(OneSignalRestClient.java:46)
	at com.onesignal.OneSignalRestClient$4.run(OneSignalRestClient.java:114)
	at java.lang.Thread.run(Thread.java:1012)
11-04 15:32:26.884	Samsung SM-S906U1	Warning	21065	OneSignal	OneSignalRestClient: null Error thrown from network stack.

Code of Conduct

  • I agree to follow this project's Code of Conduct

use this Lib
<PackageReference Include="Anjo.Android.OneSignal" Version="4.8.4.1" />