FirebasePush class

Push web via Firebase Cloud Messaging (FCM). config é o objeto JS de configuração do Firebase (ex.: "{apiKey:'..',projectId:'..',appId:'..'}"), vapidKey é a chave Web Push do projeto e tokenEndpoint (opcional) recebe o token via POST para o backend salvar. Requer o worker firebase-messaging-sw.js na raiz pública do site (com a mesma config). Sem consent mode → pede permissão e registra o token só após o aceite.

Inheritance

Constructors

FirebasePush({required String config, required String vapidKey, String? tokenEndpoint, String sdkVersion = '10.12.2'})
const

Properties

config → String
final
consentMode → bool
Respeita o Google Consent Mode (init imediato). Padrão: não.
no setterinherited
gtagLoaderId → String?
ID usado no loader externo do gtag (só provedores Google retornam algo).
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
id → String
Identificador curto e único (ex.: ga4, meta).
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sdkVersion → String
final
tokenEndpoint → String?
final
vapidKey → String
final

Methods

headHtml() → String
Snippet JS de inicialização (sem a tag <script>).
override
noscriptHtml() → String
HTML de fallback para <noscript> (vazio = nenhum).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
trackFn() → String
Função JS function(ev,p){...} chamada a cada evento rastreado.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited