OneSignal / OneSignal-Flutter-SDK

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

Add canRequest to Android #753

Closed nan-li closed 1 year ago

nan-li commented 1 year ago

Description

One Line Summary

OneSignal.Notifications.canRequest() has been fixed for Android in https://github.com/OneSignal/OneSignal-Android-SDK/pull/1798, make it available in Flutter SDK.

Details

Motivation

Add OneSignal.Notifications.canRequest() functionality to Android. It was previously iOS-only, with Android always returning false.

Scope

Adds OneSignal.Notifications.canRequest() functionality to Android.

Note that the method OneSignal.Notifications.canRequest() returns whether or not the device has been prompted for push already, and may not indicate on Android whether or not a push prompt will display.

Testing

Manual testing

Testing on Android emulator API 33:

  1. New app install and see canRequest = true
  2. Prompt for push and accept
  3. See canRequest = false which is correct

Affected code checklist

Checklist

Overview

Testing

Final pass


This change is Reviewable