コード例 #1
0
        public FCMData(int tenantId, String serverKey, String tokenId, String title, String content, PushMessageDataPayloadTypeEnum type, int msgIndex)
        {
            fcmMessage = new Message();
            fcmMessage.RegistrationIds = new List <String>()
            {
                tokenId
            };
            TenantId = tenantId;

            var data = new FCMDataPayloadSection(title, content, type, msgIndex);

            string json = JsonConvert.SerializeObject(data);

            fcmMessage.Data = data.DataSection;
        }
コード例 #2
0
        public PushMessageData(int tenantId, int numOfUsersIdPerMessage, String title, String content, PushMessageDataPayloadTypeEnum type, int msgIndex)
        {
            TenantId = tenantId;


            var data = new FCMDataPayloadSection(title, content, type, msgIndex);

            data.SetLongText("This is my long text");

            long[] ids    = new long[numOfUsersIdPerMessage];
            long   currId = 1000000;

            for (int i = 0; i < numOfUsersIdPerMessage; i++)
            {
                ids.SetValue(currId, i);
                currId++;
            }
            data.SetCustomerIdsAsRegistrationIds(ids);

            DataPayload = JsonConvert.SerializeObject(data.DataSection);
        }