unsubscribe static method
Unsubscribe from a topic already subscribed.
topic
is the name of that topic. The naming rules must follow FCM topic naming standards.
callback
is an optional function that will be called with result of Unsubscription.
Implementation
static Future<void> unsubscribe(String topic, {Function? callback}) async {
if(!Platform.isAndroid) return;
try {
if (await (_channel.invokeMethod("Pushe.unsubscribe", {"topic": topic}))) {
callback?.call();
}
} catch(ignored) {
}
return;
}