push-plugin icon indicating copy to clipboard operation
push-plugin copied to clipboard

Remove error callback and settings from unregister function on Android

Open PeterStaev opened this issue 9 years ago • 2 comments

Currently the onErrorCallback is not used at all and the settings are used only to get senderID. Settings should cached like it is done for iOS and then unregister should pull the senderID from the cached settings.

PeterStaev avatar Jan 07 '17 17:01 PeterStaev

@PeterStaev

Thanks for your input. Please find below my comments.

  • Since version 0.1.0 the error callback of the unregister method is put in use.
  • The signature of the unregister method accepts the Sender I from an options parameter. Technically speaking, in your second suggestion, the options will be available only if the register method is called before calling unregister, which is not always the case. My understanding is that we may want to keep the API of the plugin as cleaner as possible.

Can you please elaborate on the above if you have further considerations, ideas or you think I am not completely understanding it. Thanks in advance.

AntonDobrev avatar Jan 13 '17 11:01 AntonDobrev

Hey @AntonDobrev , for the second part, are there any use cases where you would call unregister before calling register first (except user error)? If you look at the iOS implementation for the registerUserNotificationSettings it also assumes that you call register first https://github.com/NativeScript/push-plugin/blob/master/push-plugin.ios.js#L59.

PeterStaev avatar Jan 13 '17 14:01 PeterStaev