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]: .Net Maui -> Notification Permission Prompt is not appearing. #63

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

Comments

@palanikumar32
Copy link

palanikumar32 commented Sep 1, 2023

What happened?

Notification Permission Prompt not appearing if one signal is not initialized in constructor of App.xaml.cs or MainPage.xaml.cs
We want to subscribe one signal only after the user is logged in. So we moved the below line to login button click
OneSignal.Initialize("xxxxxxxxxxx");
after that Notification Permission Prompt is not appearing. We tried both
OneSignal.User.PushSubscription.OptIn();
and
OneSignal.InAppMessages.AddTrigger("showPrompt", "true");

Steps to reproduce?

Remove the below line in App start [public App(){ OneSignal.Initialize("xxxxxxxxxxx"); }]
OneSignal.Initialize("xxxxxxxxxxx");

What did you expect to happen?

Notification Permission Prompt is not appearing.

Relevant log output

No response

Code of Conduct

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

emawby commented Sep 1, 2023

@palanikumar32 Could you try OneSignal.Notifications.RequestPermissionAsync()

@palanikumar32
Copy link
Author

@palanikumar32 Could you try OneSignal.Notifications.RequestPermissionAsync()

Thanks for the reply, already tried no luck.

@emawby
Copy link
Contributor

emawby commented Sep 1, 2023

@palanikumar32 Could you try enabling verbose logging and reporting what you see in the logs? Do any other OneSignal methods work? Also is the behavior the same for both iOS and Android?

@palanikumar32
Copy link
Author

palanikumar32 commented Sep 2, 2023

@palanikumar32 Could you try enabling verbose logging and reporting what you see in the logs? Do any other OneSignal methods work? Also is the behavior the same for both iOS and Android?

Here i attached the logs, unfortunately right now I couldn't test the same behavior in IOS.
Problem is our App will get onesignal id only after login, so we want to trigger OneSignal.Initialize and permission dialog only on login success.
log-initialize-button-click.txt
log-subscribe-button-click.txt
OneSignalMaui-testapp.zip

Screenshot

@emawby
Copy link
Contributor

emawby commented Jan 17, 2024

@palanikumar32 I apologize for the late response. I am not able to reproduce this issue on Android or iOS. We are doing a release soon that updates the native iOS and Android SDK dependencies, uses .net7 tools instead of legacy Xamarin build tools, and fixes other various bugs. When that release is available I will ping here again and we can try to reproduce. I believe that this issue may be resolved by that release.

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