facebook twitter hatena line email

Unity/Firebase/CloudMessaging

提供: 初心者エンジニアの簡易メモ
2019年6月1日 (土) 22:01時点におけるAdmin (トーク | 投稿記録)による版 (DL&Import)

移動: 案内検索

DL&Import

FirebaseMessaging.unitypackage

サンプル

public void Start() {
  Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
  Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
}

public void OnTokenReceived(object sender, Firebase.Messaging.TokenReceivedEventArgs token) {
  UnityEngine.Debug.Log("Received Registration Token: " + token.Token);
}

public void OnMessageReceived(object sender, Firebase.Messaging.MessageReceivedEventArgs e) {
  UnityEngine.Debug.Log("Received a new message from: " + e.Message.From);
}

参考

公式fcm https://firebase.google.com/docs/cloud-messaging/unity/client?hl=ja