Ejemplo n.º 1
0
    // Examples of using OneSignal In-App Message triggers
    private void OneSignalInAppMessageTriggerExamples()
    {
        // Add a single trigger
        OneSignal.AddTrigger("key", "value");

        // Get the current value to a trigger by key
        var triggerValue = OneSignal.GetTriggerValueForKey("key");

        // Add multiple triggers
        OneSignal.AddTriggers(new Dictionary <string, object>()
        {
            { "key1", "value1" }, { "key2", 2 }
        });

        // Delete a trigger
        OneSignal.RemoveTriggerForKey("key");

        // Delete a list of triggers
        OneSignal.RemoveTriggersForKeys(new List <string>()
        {
            "key1", "key2"
        });

        // Temporarily puase In-App messages; If true is passed in.
        // Great to ensure you never interrupt your user while they are in the middle of a match in your game.
        OneSignal.PauseInAppMessages(false);
    }