OneSignal-Unity-SDK icon indicating copy to clipboard operation
OneSignal-Unity-SDK copied to clipboard

Android - Xiaomi - On user pushed notification app is not opening version 3.0.1

Open kabouras33 opened this issue 3 years ago • 2 comments

What happened?

I was using version 2.x.x and everything worked fine i migrated to version 3.0.1 follwing the migration guide.I can receive notifications but when pressed app is not opening.Strange but the toogle messages on onNotificationOpened appear

`void Start() {

    OneSignal.Default.Initialize("xxxx-xxxx-xxxx-xxxx");
    OneSignal.Default.NotificationOpened += onNotificationOpened;
    OneSignal.Default.SetLaunchURLsInApp(true);
    OneSignal.Default.PromptForPushNotificationsWithUserResponse();
   }


private void onNotificationOpened(NotificationOpenedResult result)
{
    SceneManager.LoadScene("home");
    ToastHelper.ShowToast("hello");
    ToastHelper.ShowToast(result.notification.ToString());
    ToastHelper.ShowToast(result.action.ToString());
    
}

 private void OneSignalPromptForPushNotificationsReponse(bool accepted)
{
    
}`

Steps to reproduce?

install onesignalexample add my app id and i can accept notifications but it doesnt redirect to my app

What did you expect to happen?

redirect to my app after push the notification

Unity version

2020.3.30

OneSignal Unity SDK version

3.0.1

Platform

Android

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

kabouras33 avatar May 04 '22 12:05 kabouras33

Ok thats very odd,i was trying on the same device i used before, xiaomi, and i noticed that i have to give manual permission to Display pop-up windows while running in the backround ,to work.....?????any ideas

kabouras33 avatar May 04 '22 13:05 kabouras33

@kabouras33 Thanks for reporting, this is a Xiaomi specific issue we are tracking in https://github.com/OneSignal/OneSignal-Android-SDK/issues/1494.

jkasten2 avatar May 05 '22 06:05 jkasten2