MessageStatus status = Backendless.Messaging.publish( “Hi Devices!”, publishOptions );
In the Push Notification Documentation yields an ambiguous method error call via the ide in intellij.
Both publish(String, Object) and publish(Object, PublishOptions) in Messaging match.
This is also true for some of the method when it takes more parameters.
The only way I was able to get the method to work was when Object message, publishOptions, deliveryOptions, new AsyncCallback<MessageStatus>() was called.
Hi Ersin,
We are already looking into it.
Regards, Ilya K
http://stackoverflow.com/questions/32294140/java-8-reference-to-method-is-ambiguous
This SO page has some good points, along with the links throughout the comments to the problem.
P.S. My project using both compileOptions and jdk1.8.0_92.jdk
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
This is not solved, but the best answer marked it as such. Please revert the status.
It is not a problem provide correct arguments to the method
Sergey your answer is not acceptable, is ambiguous and generic.
The “Basic push notification” example in the documentation still does not compile. Any object type that I try for the object argument does not work when publishOptions is the second and final parameter.
Because a double string with .publish(“String channel name”, “Object message”); works, specifically where a string is in place of the object for the second argument, I would expect the same Object message to work as a string in the first argument in the non working publishOptions example mentioned above.
When using a string as the Object argument and a new AsyncCallback<MessageStatus>() for the method with 2, and 3 arguments the same compile error occurs. However, when using the 4 argument method that includes the delivery options, the method compiles.
What is the Object argument suppose to be in my non working cases?
Why does a string not work in these cases?
An explanation and working example would be constructive. @Ilya Veklenko could you provide some input?
Ersin,
What needs to be done for the line of code in question is to make the following change (notice the cast for the first argument):
MessageStatus status = Backendless.Messaging.publish( (Object) "Hi Devices!", publishOptions );
Our doc has been updated with that change.
Regards,
Mark