Esempio n. 1
0
    void SendMessage()
    {
        mWaiting.SetActive(true);

        PublishOptions publishOptions = new PublishOptions();

        if (mForceNotify == true)
        {
            publishOptions.AddHeader(PublishOptions.ANDROID_TICKER_TEXT_TAG, mSendMessage);
            publishOptions.AddHeader(PublishOptions.ANDROID_CONTENT_TITLE_TAG, "Backendless example");
            publishOptions.AddHeader(PublishOptions.ANDROID_CONTENT_TEXT_TAG, mSendMessage);
        }
        DeliveryOptions deliveryOptions = new DeliveryOptions();

        deliveryOptions.PushBroadcast = DeliveryOptions.ALL;

        AsyncCallback <MessageStatus> callback = new AsyncCallback <MessageStatus>(
            status =>
        {
            mIsSendMessageFinish  = true;
            mIsSendMessageSuccess = true;
        },
            fault =>
        {
            mResultMessage        = "Error\n\nCode = " + fault.FaultCode + "\nMessage = " + fault.Message;
            mIsSendMessageFinish  = true;
            mIsSendMessageSuccess = false;
        });

        Backendless.Messaging.Publish(mSendMessage, publishOptions, deliveryOptions, callback);
    }