Coder Social home page Coder Social logo

java-library's People

Contributors

aschuman0 avatar bamasyali avatar dependabot[bot] avatar devinsmythe avatar hkolbeck avatar jenniferjsmmiller avatar joshbranda avatar jrylander avatar krubasaur avatar madelgi avatar markobozicua avatar martin-vct avatar mdegiulio avatar mhooge avatar nadinyrosh avatar onlyleft avatar pdxmele avatar ptseng avatar rlepinski avatar rlubbat avatar robotadam avatar seanyc avatar skymorellici avatar sullis avatar uadeploy avatar vitaminmoo avatar z0br0wn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-library's Issues

Problems sending an iOS Push with IOSAlertData

When I create an IOSAlertData with a body it works, but when I create it with loc-key, I don't receive anything.

Any idea what I'm missing?

I've something like that:

IOSAlertData iosAlertData = IOSAlertData.newBuilder()
.setLocKey(locKey)
.setLocArgs(locArgs)
.build();

IllegalStateException in PushDetailResponseReader since 2017-05-22

Our application using 1.0.0 of the api now throws exceptions during report since 2017-05-22:

12:17:50.952 [New I/O worker #1] ERROR c.u.api.client.ResponseAsyncHandler - Exception thrown during response processing
java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
at com.google.common.base.Absent.get(Absent.java:49)
at com.urbanairship.api.reports.parse.PushDetailResponseReader.readPlatforms(PushDetailResponseReader.java:87)
at com.urbanairship.api.reports.parse.PushDetailResponseDeserializer$1.parse(PushDetailResponseDeserializer.java:87)
at com.urbanairship.api.reports.parse.PushDetailResponseDeserializer$1.parse(PushDetailResponseDeserializer.java:84)
at com.urbanairship.api.common.parse.StandardObjectDeserializer.deserialize(StandardObjectDeserializer.java:42)
at com.urbanairship.api.reports.parse.PushDetailResponseDeserializer.deserialize(PushDetailResponseDeserializer.java:109)
at com.urbanairship.api.reports.parse.PushDetailResponseDeserializer.deserialize(PushDetailResponseDeserializer.java:20)
...

Changed API version to 1.3.0, same problem. Stacktrace is attached.
report-exception.txt

ChannelType.EMAIL in NamedUserRequest BUG

According to api https://docs.airship.com/api/ua/#operation/api/named_users/associate/post
I should not set type email with namedUser Association. If I set it as null it throws a null pointer exception inside the client
Example with type:
NamedUserRequest requestNamed = NamedUserRequest.newAssociationRequest()
.setChannel(userData.getChannelId(), ChannelType.EMAIL)
.setNamedUserId("3647824");

Current Behavior:

{
"ok": false,
"error": "Could not parse request body.",
"error_code": 40002,
"details": {
"error": "Unrecognized device type email"
}
}
Example with type null:
NamedUserRequest requestNamed = NamedUserRequest.newAssociationRequest()
.setChannel(userData.getChannelId(), null)
.setNamedUserId("3647824");

Current Behavior:
throws a NullpointerException.

ChannelType is a required field in the client method call but not for the api

public NamedUserRequest setChannel(String channelId, ChannelType channelType) {

Missing notification_channel field in AndroidDevicePayload

Before completing the form below, please check the following:

  • [*] You are using the most recent version of the library.
  • You are using a supported version of Java for that library version.
  • This issue is reproducible.

I even checked the most recent snapshot

Expected Behavior

Push API supports notification_channel key in platform override section for Android.

See

https://docs.urbanairship.com/api/ua/#schemas/androidoverrideobject/notification_channel

Current Behavior

AndroidDevicePayload does not allow to specify notification_channel value, because correspondent property is missing

Possible Solution

add notification_channel field to AndroidDevicePayload and correspondent serializer/deserializer

How to mock UA?

Hi,

I would like to mock UrbanAirship http requests but it goes directly to an URL 'go.urbanairship.com'.

Is it possible to do this? Basically to test latencies, and unexpected errors

Thank you

Segment by static_list

Today is not possible to create a segment using static_list criteria on Java Client since SelectorType enum doesn't have this option.

https://github.com/urbanairship/java-library/blob/master/src/main/java/com/urbanairship/api/push/model/audience/SelectorType.java

In python library is easy, example:

from urbanairship.devices.segment import Segment
segment = Segment()
segment.criteria = {"and":[{"static_list":"my_list"}]}
segment.display_name = "my_segment"
segment.create(airship)

NamedUserRequest only supports disassociating a single channel

Before completing the form below, please check the following:

  • You are using the most recent version of the library.
  • You are using a supported version of Java for that library version.
  • This issue is reproducible.

Expected Behavior

https://docs.airship.com/api/libraries/java/#disassociate-named-user shows how to disassociate channels from a named user. The example is:

NamedUserRequest request = NamedUserRequest.newDisassociationRequest()
        .setChannel("ee4b5101-164c-485c-ad91-68b1d3d753cc", ChannelType.IOS)
        .setChannel("0ab7d6f0-0f61-4963-afe0-5ef53735b00d", ChannelType.ANDROID);

Response<String> response = client.execute(request);

This suggests it possible to disassociate multiple channels from a named user.

Current Behavior

Looking at the contents of the .setChannel method I noticed it overwrites the channel_id entry in the payload map, so calling .setChannel the second time undoes the effect of the first call. So, only the channel referenced in the last call to .setChannel is actually disassociated.

Possible Solution

Adjust either the documentation to reflect only a single channel can be disassociated per request, or allow the client to disassociate multiple channels using a single request.

Steps to Reproduce

  1. Create an instance of NamedUserRequest like this in a test:
NamedUserRequest request = NamedUserRequest.newDisassociationRequest()
        .setChannel("ee4b5101-164c-485c-ad91-68b1d3d753cc", ChannelType.IOS)
        .setChannel("0ab7d6f0-0f61-4963-afe0-5ef53735b00d", ChannelType.ANDROID);
  1. Inspect this instance in a debugger.
  2. See that the payload map only contains an entry for 0ab7d6f0-0f61-4963-afe0-5ef53735b00d. There is no sign of ee4b5101-164c-485c-ad91-68b1d3d753cc.

PushExpiry gets not accepted by UA server

According to http://docs.urbanairship.com/api/ua.html#push-options we can set an expiry option.

Using this Java library I create an expiry push like this:

DevicePayloadOverride devicePayload = null;
DeviceTypeData deviceTypeData = null;
Selector selector = null;
PushExpiry pushExpiry = null;
if (expireAt != null) {
    final PushExpiry.Builder pushExpiryBuilder = PushExpiry.newBuilder();
    pushExpiryBuilder.setExpiryTimeStamp(new DateTime(expireAt));
    pushExpiry = pushExpiryBuilder.build();
}

if (device.getOperatingSystem() == DeviceImpl.OperatingSystem.ANDROID) {
    final AndroidDevicePayload.Builder androidDevicePayloadBuilder = AndroidDevicePayload.newBuilder().setAlert(message);
    if (!CollectionUtils.isEmpty(extraEntries)) {
        for (final Map.Entry<String, String> extraEntry : extraEntries.entrySet()) {
            androidDevicePayloadBuilder.addExtraEntry(extraEntry.getKey(), extraEntry.getValue());
        }
    }
    androidDevicePayloadBuilder.setTimeToLive(pushExpiry);
    devicePayload = androidDevicePayloadBuilder.build();
    deviceTypeData = DeviceTypeData.of(DeviceType.ANDROID);
    selector = Selectors.apid(device.getPushToken());
} else if (device.getOperatingSystem() == DeviceImpl.OperatingSystem.IOS) {
    final IOSDevicePayload.Builder iosDevicePayloadBuilder = IOSDevicePayload.newBuilder().setAlert(message);
    if (!CollectionUtils.isEmpty(extraEntries)) {
        for (final Map.Entry<String, String> extraEntry : extraEntries.entrySet()) {
            iosDevicePayloadBuilder.addExtraEntry(extraEntry.getKey(), extraEntry.getValue());
        }
    }
    iosDevicePayloadBuilder.setExpiry(pushExpiry);
    devicePayload = iosDevicePayloadBuilder.build();
    deviceTypeData = DeviceTypeData.of(DeviceType.IOS);
    selector = Selectors.deviceToken(device.getPushToken());
} else {
    logger.warn(MARKER, "Unsupported OperationSystem {} for push, aborting.", device.getOperatingSystem());
    return;
}

final Notification notification = Notifications.notification(devicePayload);
final PushPayload pushPayload =
        PushPayload.newBuilder().setAudience(selector).setNotification(notification).setDeviceTypes(deviceTypeData).build();

final APIClientResponse<APIPushResponse> response = apiClient.push(pushPayload);

Note: expireAt is a java.util.Date.

In my opinion, this is correct usage of the API, but I get the following response from the REST service:

APIRequestException:
Message:Bad Request
HttpResponse:HTTP/1.1 400 Bad Request [Content-Type: application/vnd.urbanairship+json; version=3, Server: Jetty(8.y.z-SNAPSHOT), Date: Tue, 24 Mar 2015 10:12:07 GMT, Connection: close]
Error:APIError:Could not parse request body.
Code:Optional.of(40422)
Details:
APIErrorDetails:
Path:notification.android.time_to_live
Error:Unexpected token 'START_OBJECT' while parsing expiry time
Optional Location:Optional.of(Location:
Line:1
Column:163)

I debugged a bit and found the JSON sent to the server...

...when using expirySeconds:

{
   "audience":{
      "apid":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
   },
   "device_types":[
      "android"
   ],
   "notification":{
      "android":{
         "alert":"Blaaaa",
         "time_to_live":{
            "expirySeconds":396546366
         }
      }
   }
}

...when using expiryTimestamp:

{
   "audience":{
      "apid":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
   },
   "device_types":[
      "android"
   ],
   "notification":{
      "android":{
         "alert":"Test",
         "time_to_live":{
            "expiryTimestamp":"2015-03-29T08:20:00"
         }
      }
   }
}

Am I doing something wrong or is the Java client incorrectly serializing the JSON that gets sent to the server?

I am looking forward to any hint or feedback, thank you!

PS: I'm using version 0.3.2 from Maven central.

API_VALIDATE_PATH is incorrect

In version 0.1.3 of the APIClient class, the API_VALIDATE_PATH value is "/api/validate/" but it should be "/api/push/validate".

In its current form you always get a 404 response when calling APIClient.validate(PushPayload);

log4j-core and log4j-api dependnecies should be test scoped.

As it seems like log4j is only being directly references from within a single test class src/test/java/com/urbanairship/api/client/UrbanAirshipClientTest.java I don't see why log4j-core and -api dependencies are scoped compile instead of test.

Due to this, any project using the java-client also virtually depend on log4j.

jackson dependency libraries are not updated to 2.7.0

the urbanairship java-client 1.0.0, is not updated with the jackson libraries, so, in runtime gives an Exception because don't find the objects.

this are the correct libraries:
groupId>com.fasterxml.jackson.core
artifactId>jackson-databind
version>2.7.0

groupId>com.fasterxml.jackson.core
artifactId>jackson-core
version>2.7.0

No way to re-use AHC client between multiple UrbanAirshipClients

As of 1.x.x version of this library, we are running into an issue. We use several Urban Airship applications to push to a network of linked apps. Each UrbanAirshipClient creates an underlying AHC, with its own thread pool. The AHC is performance heavy and should be reused, so we don't want many of them around in our application, but since each UrbanAirshipClient is linked to the key/secret and creates a new AHC each time, it's too resource-intensive for us to use the 1.x.x library to push to our network of multiple Urban Airship apps. We were running out of threads due to creating too many UrbanAirshipClients.

Is there a workaround? I could see a way that possibly could allow you to re-use the AHC between multiple UrbanAirshipClients. Thanks,

Test issue

All bugs, feature requests, implementation concerns or general queries should be sent to our support team.

You are welcome to submit an issue here for bugs, but please also reach out to our support team as well.

Before completing the form below, please check the following:

  • You are using the most recent version of the library.
  • You are using a supported version of Java for that library version.
  • This issue is reproducible.

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce

Detailed Description

Possible Fix

Optional being serialized instead of PushOption

When I add PushOptions to the PushPayload it serializes as: ..., "options":{"present":true}...

Looks like it is just a missing call to get() in
jgen.writeObjectField("options", payload.getPushOptions()); here

No way to add custom headers to UrbanAirshipClient

Issue statement

I am integrating to Airship platform behind an API proxy running in application layer. Hence have the need to add additional request headers to pass the proxy server authentication.

Didn't find a proper way of doing so as the UrbanAirshipClient always:

  1. Pick up headers from request.getRequestHeaders()
  2. Override Authorization header and X-UA-Appkey header value based on client config.

private Map<String, String> createHeaders(Request request) {
Map<String, String> headers = new HashMap<>();
headers.put("User-Agent", userAgent);
Map<String, String> requestHeaders = request.getRequestHeaders();
if (requestHeaders != null) {
for (Map.Entry<String, String> entry : requestHeaders.entrySet()) {
headers.put(entry.getKey(), entry.getValue());
}
}
String auth;
if (request.bearerTokenAuthRequired()) {
Preconditions.checkArgument(bearerToken.isPresent(), "Bearer token required for request: " + request);
auth = "Bearer " + getBearerToken().get();
} else if (getAppSecret().isPresent()) {
auth = "Basic " + BaseEncoding.base64().encode((getAppKey() + ":" + getAppSecret().get()).getBytes());
} else if (bearerToken.isPresent() && request.canUseBearerTokenAuth()){
auth = "Bearer " + getBearerToken().get();
} else {
throw new IllegalArgumentException("Bearer token auth not supported for this request, app secret must be set for request: " + request);
}
headers.put("Authorization", auth);
headers.put("X-UA-Appkey", getAppKey());
return headers;
}

Feature request

Accept custom headers in the Client Builder class. So that one can easily pass through proxies & firewalls

Frequent SocketException (connection reset) and errors

We are experiencing frequent SocketExceptions when using the Push API. The problem is a connection reset. I've included an example stack trace below. I'm not sure exactly how to fix this problem. I remember in older versions of Apache HttpClient you could configure auto retries. We've used that mechanism before to get around this problem. Right now, we need to implement the retry logic ourselves, but it seems like this type of low level problem should be handled internally in the library itself.

21-Oct-2013 13:52:55,502 ERROR [pushNotificationMessageListenerContainer-6] com.xoom.notification.push.urbanairship.service.UrbanAirshipServiceImpl.makePushRequest(114) - Failed to make Urban Airship API push request
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.client.fluent.Executor.execute(Executor.java:202)
at com.urbanairship.api.client.APIClient.executePushRequest(APIClient.java:174)
at com.urbanairship.api.client.APIClient.push(APIClient.java:201)
at com.xoom.notification.push.urbanairship.service.UrbanAirshipServiceImpl.makePushRequest(UrbanAirshipServiceImpl.java:103)

Would like the option to set EU datacenter baseURI during client configuration.

Following docs while setting up a basic connection to client like so

return UrbanAirshipClient.newBuilder()
                .setKey(airshipProperties.key)
                .setSecret(airshipProperties.secret)
                .build()

Kept getting 401s. My mobile app developer colleagues were facing the same issue and got an email from support urging them (in the SDK) to set datacenter to EU programmatically. The client was invoking the US datacenter and our data was in EU, resulting in said errors. I thought I had to replicate the proposed solution in my server application. I can overwrite the client and use

.setClient(..)

but this is a little bit cryptic. I'd expect setting the correct baseUri to be exposed as configuration in the AsyncRequestClient or the docs referring to the client ovewrite specifically.

Not able to set connectionTimeout and socketTimeout

APIClient builder or api methods such as

public APIClientResponse<APIPushResponse> push(PushPayload payload)

should accept org.apache.http.params.BasicHttpParams so that we can set

  • connectionTimeout
  • socketTimeout
  • connectionRequestTimeout
  • staleConnectionCheckEnabled

By default these values are set to 0 which means infinite timeout which causes performance problem in code using this client.

Sometimes getting NoHttpResponseException from Push API

We are sometimes getting a NoHttpResponseException when using the Push API. I'm not sure exactly how to fix this problem. I remember in older versions of Apache HttpClient you could configure auto retries. We've used that mechanism before to get around this problem. Right now, we need to implement the retry logic ourselves, but it seems like this type of low level problem should be handled internally in the library itself.

21-Oct-2013 13:31:05,303 ERROR [pushNotificationMessageListenerContainer-10] com.xoom.notification.push.urbanairship.service.UrbanAirshipServiceImpl.makePushRequest(114) - Failed to make Urban Airship API push request
org.apache.http.NoHttpResponseException: The target server failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:95)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.client.fluent.Executor.execute(Executor.java:202)
at com.urbanairship.api.client.APIClient.executePushRequest(APIClient.java:174)
at com.urbanairship.api.client.APIClient.push(APIClient.java:201)
at com.xoom.notification.push.urbanairship.service.UrbanAirshipServiceImpl.makePushRequest(UrbanAirshipServiceImpl.java:103)
at com.xoom.notification.push.urbanairship.service.UrbanAirshipServiceImpl.pushMessageToUser(UrbanAirshipServiceImpl.java:72)

GCM registration

Hello,
I'm using your client to send notification to both iOS and Android platform.
For Apple, everything works as expected because I have the device token. However for Android, I only have the GCM Registration ID. Is there any way to use your client with that information in order to target one specific android device ?
BR,

ChannelTagRequest using Bearer authentication

Expected Behavior

Being able to send a ChannelTagRequest using Bearer authentication.
The REST API seems to allow Bearer authentication for this endpoint (https://docs.airship.com/api/ua/#operation/api/channels/tags/post).

Current Behavior

Exception in thread "main" java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
at com.google.common.base.Absent.get(Absent.java:43)
at com.urbanairship.api.client.UrbanAirshipClient.createHeaders(UrbanAirshipClient.java:97)
at com.urbanairship.api.client.UrbanAirshipClient.executeAsync(UrbanAirshipClient.java:58)
at com.urbanairship.api.client.UrbanAirshipClient.execute(UrbanAirshipClient.java:71)
at com.urbanairship.api.client.UrbanAirshipClient.execute(UrbanAirshipClient.java:66)

Tested with Java SDK 5.0.0.

Possible Solution

Override bearerTokenAuthRequired in ChannelTagRequest

ChannelTagRequest request = new ChannelTagRequest() {
            @Override
            public boolean bearerTokenAuthRequired() {
                return true;
            }
        }
         .addIOSChannels("XXX")
         .addTags("subscriptions", tags);

Steps to Reproduce

With the following code (given valid credentials and channel id), the exception is produced.

UrbanAirshipClient client = UrbanAirshipClient.newBuilder()
                .setBaseUri("https://go.airship.eu")
                .setKey("XXX")
                .setBearerToken("XXX")
                .build();

Set<String> tags = Set.of("tag");

ChannelTagRequest request = ChannelTagRequest.newRequest()
                .addIOSChannels("XXX")
                .addTags("subscriptions", tags);

Response<String> response = client.execute(request);

How can i send PushPayload with extra key

@UrbanGitBot

I am using the following to send push notifications

String appKey = "appKey";
String appSecret = "appSecret";

// Setup an authenticated APIClient with your application key and
// application master secret.
APIClient apiClient = APIClient.newBuilder()
.setKey(appKey)
.setSecret(appSecret)
.build();

// Setup a push payload to send to the API with our handy builders
PushPayload payload = PushPayload.newBuilder()
.setAudience(Selectors.all())
.setNotification(Notifications.notification("UA Push"))
.setDeviceTypes(DeviceTypeData.of(DeviceType.IOS))
.build();
// Try and send, handle anything that comes up
try {
APIClientResponse response = apiClient.push(payload);
logger.info("Sent a push message!");
}
// Non 200 responses throw an APIRequestException. Check the documentation
// to debug your request.
catch (APIRequestException ex){
logger.error("Non 200 request, checking error details and taking action");
}
// An underlying error occurred, most likely outside of the scope of the
// UA library, do some HTTP debugging
catch (IOException e){
logger.error("Broken pipe what?");
}

I want to add a extra key like "key":"value" to the PushPayload. How can i do it ?

Improve Precoditions.checkNotNull usage for Optionals

Preconditions.checkNotNull(bearerToken.get(), "Bearer token required for request: " + request);

The precondition won't fail as it won't ever be null.

* @throws IllegalStateException if the instance is absent ({@link #isPresent} returns {@code
* false}); depending on this specific exception type (over the more general {@link
* RuntimeException}) is discouraged

PushDetailResponse java doc is missing

I somehow try to make sense of PushDetailResponse:

private final long richDeletions;
private final long richResponses;
private final long richSends;
private final long sends;
private final long directResponses;
private final long influencedResponses;

but there is absolutely no javadoc in the class file. What do these fields do / mean?

UnknownHostException when behind a proxy

I am using version 1.0.0 and proxy configured with .setProxyInfo(ProxyInfo.newBuilder().setHost("host").setPassword(password")
.setPrincipal("user").setPort(port).setProtocol(ProxyInfo.ProxyInfoProtocol.HTTPS)
.build()

but throw Exception
java.net.UnknownHostException: go.urbanairship.com: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at java.net.InetAddress.getByName(InetAddress.java:1076)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.