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

[question]: How to enable Data / Silent notification with no permission on OneSignal 5.x #1853

Open
1 task done
danielesegato opened this issue Sep 26, 2023 · 5 comments
Open
1 task done

Comments

@danielesegato
Copy link

danielesegato commented Sep 26, 2023

How can we help?

On the documentation page for data notifications here: https://documentation.onesignal.com/docs/data-notifications

it say, and I quote:

Android Data Notification Setup
The OneSignal SDK is set up to only send data notifications to subscribed users. If you want to target unsubscribed users with data notifications, you will need to follow this workaround.

Data notifications are handled within the NotificationExtenderService - This can be set up to receive data notifications when your app is not running, or to override how notifications are shown in the notification shade.

Except the workaround linked is for iOS SDK.

In OneSignal 4.x there was a method to call (as specified on issue 1538):

OneSignal.unsubscribeWhenNotificationsAreDisabled(false)

that was enough to enable silent notifications when no permission was given.

Can you please update the documentation to add full information on how to manage data notification in Android?

Thank you

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

@danielesegato thank you for sharing. We're investigating and will get back to you as soon as possible.

@danielesegato
Copy link
Author

@jennantilla do you have any update for me?

@danielesegato
Copy link
Author

@jennantilla can I please have an update?

@jennantilla
Copy link
Contributor

@danielesegato thank you for your patience!

We are looking at adding this capability to our API, but currently, the workaround for iOS will work on Android as well:

  1. Create a 2nd OneSignal app to register the push tokens. You can get the token with this method even if the user did not accept notifications.
  2. Use the OneSignal Create Subscription REST API call to register the device to your secondary OneSignal app_id for your silent notifications.

Hope this helps! Let us know if you have any additional questions or concerns.

@danielesegato
Copy link
Author

The 2nd OneSignal app is problematic for us. Do you have an ETA on when this capability will be added?

You had it before the 5.0 SDK.

@jkasten2 jkasten2 reopened this Mar 1, 2024
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

3 participants