GoogleCloudPlatform / gradle-appengine-templates

Freemarker based templates that build with the gradle-appengine-plugin
438 stars 205 forks source link

sendMessage in MessagingEndpoint missing annotation #52

Closed seanpjanson closed 9 years ago

seanpjanson commented 9 years ago

I'm no sure if it is an intentional omission, but my generated backend does not have @ApiMethod(name = "sendMessage") annotation for public void sendMessage(@Named("message") String message)

It can also be seen in the screenshot with 3 red numbers '2' here.

image

loosebazooka commented 9 years ago

I'm not sure what you mean?

The @ApiMethod annotation is optional https://cloud.google.com/appengine/docs/java/endpoints/annotations#apimethod_method-scoped_annotations

seanpjanson commented 9 years ago

I thought that the "sendMessage" method needs annotation (like @ApiMethod(name = "sendMessage") in order to be accessible from an android app.

seanpjanson commented 9 years ago

BTW, I think that it the GCMEndpoints template will need major change in relation to deprecation of GoogleCloudMessaging.gcm.register() method. It is now in conflict with this

loosebazooka commented 9 years ago

"all public, non static, non bridge methods in a class with an @Api annotation are exposed in the API, whether they have an @ApiMethod annotation or not" So it will be added to the API with the @ApiMethod annotation.

With regards to this template being deprecated, we're working on an update, I will try to add a disclaimer or something to this tutorial.

seanpjanson commented 9 years ago

Thank you, did not know that, sorry. Closing.