Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ANR com.onesignal.OSSubscriptionObserver.onOSSubscriptionChanged #616

Open
1 task done
shefich opened this issue Jun 6, 2023 · 6 comments
Open
1 task done

Comments

@shefich
Copy link

shefich commented Jun 6, 2023

What happened?

Errors from the Google Play console. ANRs happen.

Steps to reproduce?

1. Install OneSignal SDK in Unity.

What did you expect to happen?

I expected not to see the ANRs.

Unity version

2021.3.26
2020.3.48

OneSignal Unity SDK version

3.0.10
3.0.11

Platform

Android

Relevant log output

#00  pc 0x00000000000bbb68  /apex/com.android.runtime/lib64/bionic/libc.so (nanosleep+8)
  #01  pc 0x00000000004b210c  /data/app/com.xxx.xxx-QEcGqZDCNiW86MdL-cVT1w==/lib/arm64/libil2cpp.so
  #02  pc 0x00000000004bed5c  /data/app/com.xxx.xxx-QEcGqZDCNiW86MdL-cVT1w==/lib/arm64/libil2cpp.so
  #03  pc 0x00000000004d5130  /data/app/com.xxx.xxx-QEcGqZDCNiW86MdL-cVT1w==/lib/arm64/libil2cpp.so
  #04  pc 0x000000000048214c  /data/app/com.xxx.xxx-QEcGqZDCNiW86MdL-cVT1w==/lib/arm64/libil2cpp.so
  #05  pc 0x000000000029c824  /data/app/com.xxx.xxx-QEcGqZDCNiW86MdL-cVT1w==/lib/arm64/libunity.so
  #06  pc 0x0000000000156d1c  /data/app/com.xxx.xxx-QEcGqZDCNiW86MdL-cVT1w==/lib/arm64/libunity.so
  #07  pc 0x0000000000156c34  /data/app/com.xxx.xxx-QEcGqZDCNiW86MdL-cVT1w==/lib/arm64/libunity.so
  at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native method)
  at com.unity3d.player.ReflectionHelper.a (unavailable)
  at com.unity3d.player.ReflectionHelper$1.invoke (unavailable)
  at java.lang.reflect.Proxy.invoke (Proxy.java:1006)
  at com.onesignal.OSSubscriptionObserver.onOSSubscriptionChanged (OSSubscriptionObserver.java)
  at java.lang.reflect.Method.invoke (Native method)
  at com.onesignal.OSObservable$1.run (OSObservable.java:87)
  at android.os.Handler.handleCallback (Handler.java:900)
  at android.os.Handler.dispatchMessage (Handler.java:103)
  at android.os.Looper.loop (Looper.java:219)
  at android.app.ActivityThread.main (ActivityThread.java:8668)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1109)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@shefich
Copy link
Author

shefich commented Jun 22, 2023

Any news? Too many ANRs!

@shepherd-l
Copy link
Contributor

Sorry for the late response

What is your code in your push subscription changed callback? It might be causing the issue

@shefich
Copy link
Author

shefich commented Jul 5, 2023

Don't have any callbacks for subscription. So the issue could be with the code/logic in your code or native code.
The only my code is the code which asks for push permission:

var currentStatus = OneSignal.Default.NotificationPermission;
if (currentStatus == NotificationPermission.NotDetermined) {
	var response = await OneSignal.Default.PromptForPushNotificationsWithUserResponse();
	if (response == NotificationPermission.Authorized) {
		// user accepted push notifications
		if (PlayerPrefs.GetInt("postPushes", 1) == 1) StartCoroutine(SetDailyReminder());
	}
} else
{
	if (PlayerPrefs.GetInt("postPushes", 1) == 1) StartCoroutine(SetDailyReminder());
}

@shepherd-l
Copy link
Contributor

Thanks for the info!

I was unable to reproduce this issue myself
Are you able to reproduce the issue?

Can you provide the devices the issue occurs on and what version of Android they are on

@shefich
Copy link
Author

shefich commented Jul 6, 2023

Android 11. Samsung devices A20, A01.
These devices are from Crashlytics. Can't find the Google Play devices (time passed and there's no such filters as "key" in Crashlytics).

@shefich
Copy link
Author

shefich commented Jul 8, 2023

More devices: HUAWEI HWMAR, HONOR HWKSA-M, HONOR HWSTK-HF, HUAWEI HWPOT-H, HUAWEI HWSTK-HF.
Android OSs 9 and 10.
And full stacktrace attached.
stacktrace.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants