OneSignal.getDeviceState() Method Throws an Error and Causes App to Crash
maoryadin opened this issue · comments
Summary
Content:
Summary:
Encountered an error when using await OneSignal.getDeviceState();
which leads to an application crash.
Description:
While using the await OneSignal.getDeviceState();
method, an unexpected error occurred causing the application to crash. The stack trace details are provided below:
Stack Trace:
com.onesignal.OneSignal in getPushRegistratorFCM at line 1071
com.onesignal.OneSignal in getPushRegistrator at line 1062
com.onesignal.OneSignal in registerForPushToken at line 1080
com.onesignal.OneSignal in access$1400 at line 86
com.onesignal.OneSignal$7 in complete at line 1130
com.onesignal.OneSignalRemoteParams in processJson at line 211
com.onesignal.OneSignalRemoteParams in access$100 at line 12
com.onesignal.OneSignalRemoteParams$1 in onSuccess at line 156
com.onesignal.OneSignalRestClient$5 in run at line 279
java.lang.Thread in run at line 1012
The issue might be related to the push registration process as inferred from the stack trace. Any assistance in resolving this issue would be appreciated.
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
47
Environment
System:
OS: macOS 13.4
Shell: 5.9 - /bin/zsh
Binaries:
Node: 14.17.1 - ~/.nvm/versions/node/v14.17.1/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.1/bin/npm
Watchman: 2023.04.17.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.12.1 - /Users/maoryadin/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
npmPackages:
babel-preset-expo: ~9.2.1 => 9.2.2
expo: ^47.0.0 => 47.0.14
react: 18.1.0 => 18.1.0
react-dom: 18.1.0 => 18.1.0
react-native: 0.70.5 => 0.70.5
react-native-web: ~0.18.7 => 0.18.12
npmGlobalPackages:
eas-cli: 3.14.0
expo-cli: 6.3.8
Expo Workflow: managed
Reproducible demo or steps to reproduce from a blank project
const performUpdate = async () => {
try {
const state = await OneSignal.getDeviceState();
if (!state.userId) return;
return state.userId;
} catch (error) {
Sentry.Native.captureException(error);
console.log(error);
}
};
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.