// NOTE: This example uses the next generation Twilio helper library - for more
// information on how to download and install this version, visit
// https://www.twilio.com/docs/libraries/java
import com.twilio.Twilio;
import com.twilio.rest.notify.v1.service.Notification;

public class Example {
    // Find your Account Sid and Token at twilio.com/user/account
    public static final String ACCOUNT_SID = "ACCOUNT_SID";
    public static final String AUTH_TOKEN = "AUTH_TOKEN";

    public static final String SERVICE_SID = "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    public static void main(String[] args) {
        // Initialize the client
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        Notification notification = Notification
                .creator(SERVICE_SID)
                .setTitle("Generic loooooooong title for all Bindings")
                .setBody("This is the body for all Bindings")
                .setIdentity("00000001")
                .setFcm("{\"notification\":{\"title\":\"New alert\"," +
                        "\"body\" : \"Hello Bob!\"}}")
                .setApn("{\"aps\" : " +
                        "{ \"alert\": " +
                        "{\"title\":\"New alert\"," +
                        "\"body\" : \"Hello Bob!\"}")
                .create();

        System.out.println(notification.getSid());
    }
}

@@ -946,16 +946,147 @@
 00001%22)%0A
+                .setData(%22%7B%5C%22custom_key1%5C%22:%5C%22custom value 1%5C%22,%22 + %0A                         %22%5C%22custom_key2%5C%22:%5C%22custom value 2%5C%22%7D%22,%0A
         

Update send-notification-detailed.7.x.java