OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

OSNotification.isAppInFocus is always false on Android #163

Closed RodgerLeblanc closed 2 years ago

RodgerLeblanc commented 4 years ago

Description: OSNotification.isAppInFocus is always false on Android, even when receiving a notification while the app is in focus.

Environment Xamarin.Forms 3.6.0.344457 Com.OneSignal 3.4.1 (nuget)

Steps to Reproduce Issue:

  1. Add version 3.6.0.344457 of the Xamarin SDK to your project
  2. Add version 3.4.1 of the Com.OneSignal nuget to your project
  3. Initialize the SDK with your App ID and register a delegate for received notifications
  4. Inspect a received notification while the app is in focus
rgomezp commented 4 years ago

Thanks for your PR. We will review it soon. Cheers

stesvis commented 2 years ago

Having the same issue, always false. Following

tanaynigam commented 2 years ago

@RodgerLeblanc @stesvis Thanks for reporting the issue. We have a release OneSignalSDK.Xamarin-4.0.0 in which this issue no longer seems to exist.

We have removed OSNotification.isAppInFocus in version 4.0.0. You check out our documentation on the changes regarding the Xamarin API changes and the Notification payload in our OneSignal Xamarin 4.0.0 API reference documentation and OSNotification Payload documentation

Please note that we have changed the package name and namespace for the SDK from Com.OneSignal to OneSignalSDK.Xamarin and would require you to remove the previous package name and add the new package name to import the SDK in your code.

Additionally, when searching for the package on nuget.org, you will be required to search for OneSignalSDK.Xamarin to import the package