Comments (11)
Hello @meyumeapps -- you can model the behavior of an implicit or selector like so:
Selector orTags = Selectors.tags("tag1", "tag2", "tag3");
Note that this will still be serialized as an explicit or selector, i.e.:
// Result after serialization
{
"or": [
{"tag": "tag1"},
{"tag": "tag2"},
{"tag": "tag3"},
]
}
Unfortunately, there is no analogous method for an "and" selector -- you must call Selectors.tag
explicitly for each tag you wish to reference:
Selector andTags = Selectors.and(
Selectors.tag("tag1"),
Selectors.tag("tag2"),
Selectors.tag("tag3")
);
from java-library.
Alternatively, if you know which tags you're sending to before constructing the request, you can define a segment and simply send to the segment:
Selector tagSegment = Selectors.segment("my-segment");
This will actually reduce the size of the payload, but it requires that you build the segment ahead of time.
from java-library.
Thanks @madelgi . Our tags are dynamic so I don't think the segment idea will work.
We are facing two problems:
- more than 1000 tags
- large message (> 2Mb)
Do you have any thoughts on how I can resolve these please?
from java-library.
Hi @meyumeapps, do you mind explaining what your use case is? 1000 tags is an enormous query, and it's possible we offer a tool (perhaps named users) that would be more suitable for accomplishing your goals.
There are a number of features we're trying to add to the java library right now, and I don't think we're going to get around to updating the serialization method for tags. However, we'd consider a patch if you want to submit something. Before that, though, we should see if there's is an implementation for your use case that doesn't use tags.
from java-library.
Sure, we send notifications for our weather sites. Each site has a unique id.
Users subscribe to receive notifications for a weather site e.g. their home location or perhaps where they work.
We have over 6,000 sites and therefore have to send a push notification for each affected site. For example, if there was a severe weather warning covering much of the UK then we would want to send a push to UA listing the affected sites. Each tag would be a site id.
from java-library.
Ah, interesting. This is a bit of an edge case, and I don't think our other features can help us out here. If you want to submit a PR that adds the implicit-or functionality, we'd be happy to review it. I'm sorry we couldn't help you more directly!
from java-library.
Will certainly look at submitting the PR.
However, can you tell me if we would still hit the 1000 tag limit with the implicit-or functionality ?
from java-library.
No such limit exists for the push API -- maybe you're thinking of the 1000 tag limit in place for segment creation?
Also, I'd recommend searching through or posting in the forums. You may be able to get additional help there.
from java-library.
This is the limit I was concerned about:
Have I misunderstood?
from java-library.
That limit is advised, but it's not enforced by the push API. If you exceed it, you shouldn't encounter an error.
from java-library.
Ah, excellent news, thank you 👍
from java-library.
Related Issues (20)
- log4j-core and log4j-api dependnecies should be test scoped. HOT 1
- No way to add custom headers to UrbanAirshipClient HOT 1
- Test issue
- UnknownHostException when behind a proxy HOT 1
- PushDetailResponse java doc is missing HOT 3
- Update guava to version 21.0 HOT 2
- IllegalStateException in PushDetailResponseReader since 2017-05-22 HOT 5
- No way to re-use AHC client between multiple UrbanAirshipClients HOT 2
- How to mock UA?
- Missing notification_channel field in AndroidDevicePayload HOT 1
- GCM registration HOT 3
- Would like the option to set EU datacenter baseURI during client configuration. HOT 1
- Enable Dependabot to keep dependencies updated
- NamedUserRequest only supports disassociating a single channel HOT 2
- CVEs in current release dependencies HOT 1
- ChannelTagRequest using Bearer authentication HOT 1
- CustomEventUser does not support NamedUserId HOT 1
- ChannelType.EMAIL in NamedUserRequest BUG HOT 1
- Improve Precoditions.checkNotNull usage for Optionals HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-library.