public void SubscribeTopic(string topic, Action <Task> task = null) { if (!m_IsInit) { return; } FirebaseMessaging.SubscribeAsync(topic).ContinueWith(task); Log.i("Register topic Success"); }
// Initialize the Firebase database: protected virtual void InitializeFirebase() { FirebaseApp app = FirebaseApp.DefaultInstance; // NOTE: You'll need to replace this url with your Firebase App's database // path in order for the database connection to work correctly in editor. app.SetEditorDatabaseUrl("https://testing-krho.firebaseio.com/"); if (app.Options.DatabaseUrl != null) { app.SetEditorDatabaseUrl(app.Options.DatabaseUrl); } FirebaseMessaging.SubscribeAsync("DruzinaVrhovec").ContinueWith(task => { LogTaskCompletion(task, "SubscribeAsync"); }); }
private static void SetupPush() { FirebaseMessaging.RequestPermissionAsync(); if (StencilRemote.IsDeveloper()) { FirebaseMessaging.SubscribeAsync("dev/remote"); } else { FirebaseMessaging.UnsubscribeAsync("dev/remote"); } FirebaseMessaging.TokenReceived += (sender, args) => { Debug.Log($"Firebase/FCM Token: {args.Token}"); }; }
static void OnTokenReceivedHandler(object sender, TokenReceivedEventArgs token) { Debug.Log("Received Registration Token: " + token.Token); FirebaseMessaging.SubscribeAsync(MessagingConsts.Topics.RemoteConfigPush); }
public void SubscribleTopic(string nameTopic) { FirebaseMessaging.SubscribeAsync(nameTopic); }