OnRegisterUser not possible
Description:
After following the setUp in the android doc of OneSignal, I have the following error :
- OneSignal: registerUser not possible
Environment
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'
implementation 'com.onesignal:OneSignal:[4.0.0, 4.99.99]'
Steps to Reproduce Issue: I have setup it in the following way
- AndroidManifest
<meta-data
android:name="com.onesignal.NotificationServiceExtension"
android:value="com.custom.package.oneSignal.OneSignalNotificationService">
</meta-data>
- MainActivity
OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);
OneSignal.initWithContext(this);
OneSignal.setAppId(MY_OS_KEY);
OneSignal.setNotificationOpenedHandler(this);
OSDeviceState deviceState = OneSignal.getDeviceState();
// OneSignal.disablePush(true);
assert deviceState != null;
String userId = deviceState.getUserId();
Log.d("userId ONE SIGNAL ", "getUserId: " + userId);
OneSignal.setExternalUserId(userId);
- OneSignalNotificationService, I put only the declaration in the code below, I only overwrite the remoteNotificationReceived method
public class OneSignalNotificationService implements OneSignal.OSRemoteNotificationReceivedHandler { }
Then, during the launch, I see my user in the dashboard OneSignal, but impossible to send him a notification, I think it comes from the error cited above.
After following the setUp in the android doc of OneSignal, I have the following error :
- OneSignal: registerUser not possible
Could you share what is above this logcat entry? Do you see any other errors in the logcat?
Then, during the launch, I see my user in the dashboard OneSignal, but impossible to send him a notification, I think it comes from the error cited above.
On the All Users page on the OneSignal dashboard what status does the device show? If it is unsubscribed it should show a reason why.
The status of the sent messages are "No Recipients".
And for the logcat I only have one error : 2022-06-14 09:40:29.073 8828-8828/com.scala.aeroportmp E/OneSignal: Waiting for remote params. Moving setExternalUserId() operation to a pending task queue.
@pfnts99 The "No Recipients" could mean you don't have any Users or it could mean they are all just unsubscribed. Could let us know what are seeing on the All User page on the dashboard?
Could you share the full logcat as well well? We are looking for if the remote params call is completing successful or not.
Make sure the device can access onesignal.com by opening a browse to it, this will rule out if anything is blocking the network connection.
Here is a screenshot of the dashboard where we can see that the last activity of my user is now.
Here are the logcats
[logcats.docx](https://github.com/OneSignal/OneSignal-Android-SDK/files/8928655/logcats.docx)
@pfnts99 I see this from the logs which reports the device subscribed for a FCM push token correctly.
2022-06-17 16:51:16.862 18763-18855/com.scala.confidential_app D/OneSignal: registerForPushToken completed with id: c5XOs-hiJ1w:APA91bEut7T2rGUyuG3EgQ5YXdgztndlesWnb8C5_54LIIEsQK5uSs2IP_sO5A5yJ90xElG7Q_LfweX0-TleXsLZS-adgLjkeAXlaXw7dQGo2dGKVPspAYMtt5pWlVYq_uYKyLMkFuGE status: 1
However your log doesn't show when your player is first created so it doesn't contain it's subscription status. Can you try uninstalling the app and reinstalling it and capture the log again? We are looking for the value of notification_types and any log message around that to give more information to the reason of the value.
Also on the dashboard we are looking for the "Subscripted" field status. It looks like you may have hide it so you have to turn it on from the options drop down on the top right and hit apply:

Hello,
I tried again with the manipulations you told me and it's still the same. Do you need the logs?
Hi,
Today i found this error "FirebaseMessaging.getToken not found, attempting to use FirebaseInstanceId.getToken". Just after "registerUser not possible" error.
@pfnts99 We must know the following to help with your issue:
- The "Subscribed" status of your player from the dashboard.
- A more complete log, from the time you open the app and 30 seconds after. Make sure the logging logcat is VERBOSE
Closing issue due to no response. Please @ mention me if we need to revisit this issue.
We have an updated major release available for our Android SDK with many improvements and enhancements! Please refer to the migration guide for more information on upgrading.
Thanks!