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

CancelNotification #77

Closed bbl-Laobu closed 6 years ago

bbl-Laobu commented 6 years ago

Do you have an ETA for the release of the CancelNotification feature (both iOS and Android)?

In our application (app to plan events), we set local scheduled notifications as 'reminders' for planned events in our app. For now, if the event is moved in time by the user, we have no means of deleting the now wrongly scheduled notification and replace it with a new one. So being able to cancel the old notification and replacing it with a new one would be the way to go but not possible at this stage.

Also, other related useful features would be:

Any suggested workarounds or ETA's on those?

Many thanks for your feedback and a great product.

Nightsd01 commented 6 years ago

You can use our REST API to cancel a notification that is scheduled for the future. This endpoint normally requires your REST API key (something you do not want to put in your app). However, if you are cancelling a notification that is only scheduled to be shown to an individual user, it will work without the API key.

https://documentation.onesignal.com/reference#cancel-notification

Note: Currently the Android OneSignal SDK has a method called cancelNotification, but it will only cancel a notification that is already being shown to the user.

We have considered adding this endpoint to our SDK's but we feel that if people need this functionality they should generally use local notifications

bbl-Laobu commented 6 years ago

To be clear, I was actually talking about creating local notifications on the device itself. So, indeed no REST API's are required.

The scenario would be to use the com.onesignal Xamarin SDK to set local notifications (no interaction with the REST API). This is indeed already possible without using the API key. Great!

Now what I was referring to is being able to interact with previously said notifications. To cancel (IOS & Droid), get a LIST and clear local notifications would be really useful.

For now, we could partly resolve our request by using different plugins (ex Plugin.DeviceNotifications or Xam.Plugins.Notifier) but both have some limitations and are just another plugin to learn and maintain.

Seems to me it would be desirable to have this in the onesignal xamarin sdk. This way we would have one SDK for both Local and Remote Push Notifications.

Anyways, just a suggestion but on our side would certainly be greatly appreciated. ;)

jkasten2 commented 6 years ago

@bbl-Laobu The postNotification method in OneSignal actually schedules the message on OneSignal's servers. This SDK and the native OneSignal SDK this uses does not support local notifications at this time.